Skip to content

Commit

Permalink
action: get latest tag by Github API
Browse files Browse the repository at this point in the history
Use https://api.github.com/repos/Dragonflyoss/nydus/releases/latest to get the
latest tag of nydus, and used in smoke/integration-test.

Signed-off-by: Yadong Ding <ding_yadong@foxmail.com>
  • Loading branch information
Desiki-high committed Nov 6, 2023
1 parent 8b81a99 commit 4c43d9e
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions .github/workflows/smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ env:
CARGO_TERM_COLOR: always
IMAGE: wordpress
TAG: 6.1.1
NYDUS_STABLE_VERSION: v2.2.3
NYDUS_STABLE_VERSION_EXPORT: v2_2_3

jobs:
contrib-build:
Expand Down Expand Up @@ -151,8 +149,10 @@ jobs:
- name: Prepare Older Binaries
id: prepare-binaries
run: |
versions=(v0.1.0 ${{env.NYDUS_STABLE_VERSION}})
version_archs=(v0.1.0-x86_64 ${{env.NYDUS_STABLE_VERSION}}-linux-amd64)
export NYDUS_STABLE_VERSION=$(curl https://api.github.com/repos/Dragonflyoss/nydus/releases/latest | jq -r '.tag_name')
versions=(v0.1.0 ${NYDUS_STABLE_VERSION})
version_archs=(v0.1.0-x86_64 ${NYDUS_STABLE_VERSION}-linux-amd64)
for i in ${!versions[@]}; do
version=${versions[$i]}
version_arch=${version_archs[$i]}
Expand All @@ -177,8 +177,11 @@ jobs:
sudo install -D -m 755 contrib/nydusify/cmd/nydusify /usr/bin/nydus-latest
sudo install -D -m 755 target/release/nydusd target/release/nydus-image /usr/bin/nydus-latest
versions=(v0.1.0 ${{env.NYDUS_STABLE_VERSION}} latest)
version_exports=(v0_1_0 ${{env.NYDUS_STABLE_VERSION_EXPORT}} latest)
export NYDUS_STABLE_VERSION=$(curl https://api.github.com/repos/Dragonflyoss/nydus/releases/latest | jq -r '.tag_name')
export NYDUS_STABLE_VERSION_EXPORT="${NYDUS_STABLE_VERSION//./_}"
versions=(v0.1.0 ${NYDUS_STABLE_VERSION} latest)
version_exports=(v0_1_0 ${NYDUS_STABLE_VERSION_EXPORT} latest)
for i in ${!version_exports[@]}; do
version=${versions[$i]}
version_export=${version_exports[$i]}
Expand Down

0 comments on commit 4c43d9e

Please sign in to comment.