Skip to content

Commit

Permalink
Use the pkgs to get the latest version (#2682)
Browse files Browse the repository at this point in the history
* Use the pkgs to get the latest version

* disable fail fast
  • Loading branch information
mlsmaycon authored Oct 2, 2024
1 parent 5932298 commit a3a4794
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/install-script-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ concurrency:
jobs:
test-install-script:
strategy:
fail-fast: false
max-parallel: 2
matrix:
os: [ubuntu-latest, macos-latest]
Expand Down
6 changes: 4 additions & 2 deletions release_files/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,16 @@ get_release() {
local RELEASE=$1
if [ "$RELEASE" = "latest" ]; then
local TAG="latest"
local URL="https://pkgs.netbird.io/releases/latest"
else
local TAG="tags/${RELEASE}"
local URL="https://api.github.com/repos/${OWNER}/${REPO}/releases/${TAG}"
fi
if [ -n "$GITHUB_TOKEN" ]; then
curl -H "Authorization: token ${GITHUB_TOKEN}" -s "https://api.github.com/repos/${OWNER}/${REPO}/releases/${TAG}" \
curl -H "Authorization: token ${GITHUB_TOKEN}" -s "${URL}" \
| grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/'
else
curl -s "https://api.github.com/repos/${OWNER}/${REPO}/releases/${TAG}" \
curl -s "${URL}" \
| grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/'
fi
}
Expand Down

0 comments on commit a3a4794

Please sign in to comment.