Skip to content

Commit c60b692

Browse files
Copilotigaw
andcommitted
fix: upload versioned binary to SFTP server on release tag push
The upload-test-binary job was never uploading a versioned binary (e.g. nvme-cli-v3.0-a.3-x86_64) because: 1. upload.yml listened for `release: published` events, but releases are created by release.yml using GITHUB_TOKEN. GitHub prevents GITHUB_TOKEN-triggered actions from firing other workflow events, so `release: published` never fired. 2. The build step checked `GITHUB_EVENT_NAME == release` which also never evaluated to true for the same reason. 3. The container job defaults to `sh`, not `bash`, so `[[ ]]` syntax would have failed. Fix: add `tags: v*` to the push trigger so the workflow runs when a version tag is pushed, and use a POSIX-compatible `case` statement checking `GITHUB_REF` to create the versioned binary using `GITHUB_REF_NAME` as the tag name. Co-authored-by: igaw <[email protected]>
1 parent b76288e commit c60b692

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

.github/workflows/upload.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ name: Upload
1111
on:
1212
push:
1313
branches: [master]
14+
tags:
15+
- 'v*'
1416
release:
1517
types: [published]
1618

@@ -41,9 +43,11 @@ jobs:
4143
scripts/build.sh static
4244
mkdir upload
4345
cp .build-ci/nvme upload/nvme-cli-latest-x86_64
44-
if [ "${GITHUB_EVENT_NAME}" = "release" ]; then
45-
cp .build-ci/nvme "upload/nvme-cli-${VERSION}-x86_64"
46-
fi
46+
case "${GITHUB_REF}" in
47+
refs/tags/v*)
48+
cp .build-ci/nvme "upload/nvme-cli-${GITHUB_REF_NAME}-x86_64"
49+
;;
50+
esac
4751
4852
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
4953
name: upload artifacts to github

0 commit comments

Comments
 (0)