Use the pkgs to get the latest version (#2682)

* Use the pkgs to get the latest version

* disable fail fast
This commit is contained in:
Maycon Santos 2024-10-02 11:48:42 +02:00 committed by GitHub
parent 5932298ce0
commit a3a479429e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 2 deletions

View File

@ -13,6 +13,7 @@ concurrency:
jobs: jobs:
test-install-script: test-install-script:
strategy: strategy:
fail-fast: false
max-parallel: 2 max-parallel: 2
matrix: matrix:
os: [ubuntu-latest, macos-latest] os: [ubuntu-latest, macos-latest]

View File

@ -33,14 +33,16 @@ get_release() {
local RELEASE=$1 local RELEASE=$1
if [ "$RELEASE" = "latest" ]; then if [ "$RELEASE" = "latest" ]; then
local TAG="latest" local TAG="latest"
local URL="https://pkgs.netbird.io/releases/latest"
else else
local TAG="tags/${RELEASE}" local TAG="tags/${RELEASE}"
local URL="https://api.github.com/repos/${OWNER}/${REPO}/releases/${TAG}"
fi fi
if [ -n "$GITHUB_TOKEN" ]; then 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/' | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/'
else else
curl -s "https://api.github.com/repos/${OWNER}/${REPO}/releases/${TAG}" \ curl -s "${URL}" \
| grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/' | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/'
fi fi
} }