-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add meshix-cli-bin package #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
5669bae
feat: add meshix-cli-bin package
anand-testcompare d8f5b35
fix: use authenticated meshix package updates
anand-testcompare 34a6395
fix: skip meshix package bumps without release access
anand-testcompare a6911f3
fix: tighten meshix package update guidance
anand-testcompare File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| pkgbase = meshix-cli-bin | ||
| pkgdesc = Meshix CLI for run inspection and generation workflows | ||
| pkgver = 0.0.1 | ||
| pkgrel = 1 | ||
| url = https://github.com/shpitdev/meshix-observability | ||
| install = meshix-cli-bin.install | ||
| arch = x86_64 | ||
| license = LicenseRef-proprietary | ||
| makedepends = github-cli | ||
| provides = meshix-cli | ||
| conflicts = meshix-cli | ||
|
|
||
| pkgname = meshix-cli-bin |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| # Maintainer: Anand Pant | ||
|
|
||
| pkgname=meshix-cli-bin | ||
| pkgver=0.0.1 | ||
| pkgrel=1 | ||
| pkgdesc="Meshix CLI for run inspection and generation workflows" | ||
| arch=('x86_64') | ||
| url="https://github.com/shpitdev/meshix-observability" | ||
| license=('LicenseRef-proprietary') | ||
| install="${pkgname}.install" | ||
| makedepends=('github-cli') | ||
| provides=('meshix-cli') | ||
| conflicts=('meshix-cli') | ||
|
|
||
| # Public PKGBUILD, private release asset. Users need GitHub access to the shpitdev org. | ||
| _asset="meshix-cli_v${pkgver}_linux_amd64.tar.gz" | ||
| _sha256='a6f8fa1b8c12fa8705bc508efe13b8f462c375016edee0683ceb577370ac1911' | ||
|
|
||
| prepare() { | ||
| gh release download "v${pkgver}" \ | ||
| --repo shpitdev/meshix-observability \ | ||
| --pattern "${_asset}" \ | ||
| --dir . --clobber | ||
|
|
||
| echo "${_sha256} ${_asset}" | sha256sum -c | ||
| tar xzf "${_asset}" | ||
| } | ||
|
|
||
| package() { | ||
| install -Dm755 "meshix-cli_v${pkgver}_linux_amd64/meshix-cli" \ | ||
| "${pkgdir}/usr/bin/meshix-cli" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| post_install() { | ||
| cat <<'EOF' | ||
| ==> meshix-cli-bin: package-manager installs provide the stable meshix-cli command only. | ||
| ==> Start with: | ||
| ==> meshix-cli --help | ||
| ==> | ||
| ==> For a checkout-linked dev command, install meshix-cli-dev from a local checkout. | ||
| EOF | ||
| } | ||
|
|
||
| post_upgrade() { | ||
| post_install | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,97 @@ | ||
| #!/usr/bin/env bash | ||
| set -euo pipefail | ||
|
|
||
| optional=false | ||
| if (($# > 1)); then | ||
| echo "usage: $0 [--optional]" >&2 | ||
| exit 1 | ||
| fi | ||
| if (($# == 1)); then | ||
| if [[ "$1" != "--optional" ]]; then | ||
| echo "usage: $0 [--optional]" >&2 | ||
| exit 1 | ||
| fi | ||
| optional=true | ||
| fi | ||
|
|
||
| repo_root="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)" | ||
| pkgbuild="${repo_root}/meshix-cli-bin/PKGBUILD" | ||
| repo="shpitdev/meshix-observability" | ||
| requested_version="${MESHIX_CLI_VERSION:-latest}" | ||
|
|
||
| resolve_release_json() { | ||
| local version="$1" | ||
| local endpoint | ||
| local output="" | ||
|
|
||
| if [[ -z "${version}" || "${version}" == "latest" ]]; then | ||
| endpoint="repos/${repo}/releases/latest" | ||
| else | ||
| if [[ "${version}" != v* ]]; then | ||
| version="v${version}" | ||
| fi | ||
| endpoint="repos/${repo}/releases/tags/${version}" | ||
| fi | ||
|
|
||
| if [[ -n "${SHPIT_GH_TOKEN:-}" ]]; then | ||
| if output="$(GH_TOKEN="${SHPIT_GH_TOKEN}" gh api "${endpoint}" 2>/dev/null)"; then | ||
| printf '%s' "${output}" | ||
| return 0 | ||
| fi | ||
| if [[ -n "${GITHUB_ACTIONS:-}" && "${optional}" == "true" ]]; then | ||
| echo "Skipping meshix-cli-bin: SHPIT_GH_TOKEN does not currently grant release access to ${repo}." >&2 | ||
| printf '__SKIP__' | ||
| return 0 | ||
| fi | ||
| echo "SHPIT_GH_TOKEN could not read the private meshix-cli release in ${repo}." >&2 | ||
| return 1 | ||
| elif [[ -n "${GITHUB_ACTIONS:-}" ]]; then | ||
| if [[ "${optional}" == "true" ]]; then | ||
| echo "Skipping meshix-cli-bin: SHPIT_GH_TOKEN is not configured in GitHub Actions." >&2 | ||
| printf '__SKIP__' | ||
| return 0 | ||
| fi | ||
| echo "SHPIT_GH_TOKEN is required in GitHub Actions to read the private meshix-cli release." >&2 | ||
| return 1 | ||
| else | ||
| gh api "${endpoint}" | ||
| fi | ||
| } | ||
|
|
||
| release_json="$(resolve_release_json "${requested_version}")" | ||
| if [[ "${release_json}" == "__SKIP__" ]]; then | ||
| exit 0 | ||
| fi | ||
| pkgver="$(jq -r '.tag_name | ltrimstr("v")' <<<"${release_json}")" | ||
| asset_json="$(jq -c ' | ||
| .assets | ||
| | map(select(.name | test("_linux_amd64\\.tar\\.gz$"))) | ||
| | first | ||
| ' <<<"${release_json}")" | ||
| release_asset="$(jq -r '.name // empty' <<<"${asset_json}")" | ||
| sha256="$(jq -r '.digest // empty' <<<"${asset_json}")" | ||
|
|
||
| if [[ -z "${release_asset}" || "${release_asset}" == "null" ]]; then | ||
| if [[ "${optional}" == "true" ]]; then | ||
| echo "Skipping meshix-cli-bin: release is missing a linux amd64 archive." >&2 | ||
| exit 0 | ||
| fi | ||
| echo "meshix-cli release is missing a linux amd64 archive" >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| if [[ -z "${sha256}" || "${sha256}" == "null" ]]; then | ||
| if [[ "${optional}" == "true" ]]; then | ||
| echo "Skipping meshix-cli-bin: release is missing an asset digest." >&2 | ||
| exit 0 | ||
| fi | ||
| echo "meshix-cli release is missing an asset digest" >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| sha256="${sha256#sha256:}" | ||
|
|
||
| perl -0pi -e "s/^pkgver=.*/pkgver=${pkgver}/m" "${pkgbuild}" | ||
| perl -0pi -e "s/^_sha256=.*/_sha256='${sha256}'/m" "${pkgbuild}" | ||
|
|
||
| "${repo_root}/scripts/render-srcinfo.sh" "${repo_root}/meshix-cli-bin" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.