@@ -2,9 +2,11 @@ name: Zstd Archive Release
22
33on :
44 push :
5+ # Match semver tags like v1.2.3
56 tags :
6- - ' v*.*.*' # match v1.2.3, v10.20.30, etc.
7- workflow_dispatch : # allow manual runs
7+ - ' v*.*.*'
8+ # Allow manual runs from the Actions UI
9+ workflow_dispatch :
810
911jobs :
1012 release :
@@ -15,31 +17,37 @@ jobs:
1517 uses : actions/checkout@v4
1618
1719 - name : Install zstd
18- run : sudo apt-get update && sudo apt-get install -y zstd
20+ run : |
21+ sudo apt-get update
22+ sudo apt-get install -y zstd
1923
2024 - name : Extract version info
2125 id : version
2226 run : |
23- TAG_NAME="${GITHUB_REF#refs/tags/}" # e.g. v1.2.3
24- SHORT_TAG="${TAG_NAME#v}" # strip leading "v" → 1.2.3
27+ # If triggered by a tag push, GITHUB_REF is refs/tags/vX.Y.Z
28+ TAG_NAME="${GITHUB_REF#refs/tags/}"
29+ SHORT_TAG="${TAG_NAME#v}" # strip leading "v"
2530 echo "tag_name=$TAG_NAME" >> $GITHUB_OUTPUT
2631 echo "short_tag=$SHORT_TAG" >> $GITHUB_OUTPUT
2732
28- - name : Create .tar.zst archives using git archive
33+ - name : Create .tar.zst archives
2934 run : |
30- git archive --format=tar --prefix=test-definitions/ ${{ steps.version.outputs.tag_name }} \
31- | zstd -o ../${{ steps.version.outputs.tag_name }}.tar.zst
32- git archive --format=tar --prefix=test-definitions/ ${{ steps.version.outputs.tag_name }} \
33- | zstd -o ../${{ steps.version.outputs.short_tag }}.tar.zst
35+ # full-tag archive (vX.Y.Z.tar.zst)
36+ git archive --format=tar \
37+ --prefix=test-definitions/ \
38+ "${{ steps.version.outputs.tag_name }}" \
39+ | zstd -o "$GITHUB_WORKSPACE/${{ steps.version.outputs.tag_name }}.tar.zst"
40+
41+ # short-tag archive (X.Y.Z.tar.zst)
42+ git archive --format=tar \
43+ --prefix=test-definitions/ \
44+ "${{ steps.version.outputs.tag_name }}" \
45+ | zstd -o "$GITHUB_WORKSPACE/${{ steps.version.outputs.short_tag }}.tar.zst"
3446
3547 - name : Upload .tar.zst archives to GitHub Release
3648 uses : softprops/action-gh-release@v2
3749 with :
38- tag_name : ${{ steps.version.outputs.tag_name }}
39- name : Release ${{ steps.version.outputs.tag_name }}
40- files : |
41- ../${{ steps.version.outputs.tag_name }}.tar.zst
42- ../${{ steps.version.outputs.short_tag }}.tar.zst
50+ # Pick up both .tar.zst files at the workspace root
51+ files : ' *.tar.zst'
4352 env :
4453 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
45-
0 commit comments