Skip to content

Commit bcb14ff

Browse files
committed
build: upload versioned binary to SFTP server
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. Signed-off-by: Daniel Wagner <[email protected]>
1 parent a49c53c commit bcb14ff

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)