@@ -2,9 +2,11 @@ name: Zstd Archive Release
2
2
3
3
on :
4
4
push :
5
+ # Match semver tags like v1.2.3
5
6
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 :
8
10
9
11
jobs :
10
12
release :
@@ -15,31 +17,37 @@ jobs:
15
17
uses : actions/checkout@v4
16
18
17
19
- 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
19
23
20
24
- name : Extract version info
21
25
id : version
22
26
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"
25
30
echo "tag_name=$TAG_NAME" >> $GITHUB_OUTPUT
26
31
echo "short_tag=$SHORT_TAG" >> $GITHUB_OUTPUT
27
32
28
- - name : Create .tar.zst archives using git archive
33
+ - name : Create .tar.zst archives
29
34
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"
34
46
35
47
- name : Upload .tar.zst archives to GitHub Release
36
48
uses : softprops/action-gh-release@v2
37
49
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'
43
52
env :
44
53
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
45
-
0 commit comments