1
1
name : Zstd Archive Release
2
2
3
+ # Grant the GITHUB_TOKEN write access so we can create releases & upload assets
4
+ permissions :
5
+ contents : write
6
+
3
7
on :
4
8
push :
9
+ # Trigger on semver tags like v1.2.3
5
10
tags :
6
11
- ' v*.*.*'
7
- workflow_dispatch :
12
+ workflow_dispatch : # allow manual runs
8
13
9
14
jobs :
10
15
release :
11
16
runs-on : ubuntu-latest
17
+
12
18
steps :
13
19
- name : Checkout repository
14
20
uses : actions/checkout@v4
@@ -21,17 +27,15 @@ jobs:
21
27
- name : Extract version info
22
28
id : version
23
29
run : |
24
- TAG="${GITHUB_REF#refs/tags/}"
25
- SHORT="${TAG#v}"
30
+ TAG="${GITHUB_REF#refs/tags/}" # e.g. v1.2.3
26
31
echo "tag_name=$TAG" >> $GITHUB_OUTPUT
27
- echo "short_tag=$SHORT" >> $GITHUB_OUTPUT
28
32
29
- - name : Create .tar.zst archives
33
+ - name : Create .tar.zst archive
30
34
run : |
31
- git archive --format=tar --prefix=test-definitions/ "${{ steps.version.outputs.tag_name }}" \
32
- | zstd -o "$GITHUB_WORKSPACE/${{ steps.version.outputs.tag_name }}.tar.zst"
33
- git archive --format=tar --prefix=test-definitions/ "${{ steps.version.outputs.tag_name }}" \
34
- | zstd -o "$GITHUB_WORKSPACE/${{ steps.version.outputs.short_tag }}.tar.zst"
35
+ git archive --format=tar \
36
+ --prefix=test-definitions/ \
37
+ "${{ steps.version.outputs.tag_name }}" \
38
+ | zstd -o "${ GITHUB_WORKSPACE} /${{ steps.version.outputs.tag_name }}.tar.zst"
35
39
36
40
- name : Create GitHub Release
37
41
id : create_release
@@ -44,18 +48,10 @@ jobs:
44
48
env :
45
49
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
46
50
47
- - name : Upload full-tag .tar.zst
51
+ - name : Upload .tar.zst to GitHub Release
48
52
uses : actions/upload-release-asset@v1
49
53
with :
50
54
upload_url : ${{ steps.create_release.outputs.upload_url }}
51
55
asset_path : ${{ github.workspace }}/${{ steps.version.outputs.tag_name }}.tar.zst
52
56
asset_name : ${{ steps.version.outputs.tag_name }}.tar.zst
53
57
asset_content_type : application/zstd
54
-
55
- - name : Upload short-tag .tar.zst
56
- uses : actions/upload-release-asset@v1
57
- with :
58
- upload_url : ${{ steps.create_release.outputs.upload_url }}
59
- asset_path : ${{ github.workspace }}/${{ steps.version.outputs.short_tag }}.tar.zst
60
- asset_name : ${{ steps.version.outputs.short_tag }}.tar.zst
61
- asset_content_type : application/zstd
0 commit comments