@@ -2,16 +2,13 @@ name: Zstd Archive Release
2
2
3
3
on :
4
4
push :
5
- # Match semver tags like v1.2.3
6
5
tags :
7
6
- ' v*.*.*'
8
- # Allow manual runs from the Actions UI
9
7
workflow_dispatch :
10
8
11
9
jobs :
12
10
release :
13
11
runs-on : ubuntu-latest
14
-
15
12
steps :
16
13
- name : Checkout repository
17
14
uses : actions/checkout@v4
@@ -24,30 +21,41 @@ jobs:
24
21
- name : Extract version info
25
22
id : version
26
23
run : |
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"
30
- echo "tag_name=$TAG_NAME" >> $GITHUB_OUTPUT
31
- echo "short_tag=$SHORT_TAG" >> $GITHUB_OUTPUT
24
+ TAG="${GITHUB_REF#refs/tags/}"
25
+ SHORT="${TAG#v}"
26
+ echo "tag_name=$TAG" >> $GITHUB_OUTPUT
27
+ echo "short_tag=$SHORT" >> $GITHUB_OUTPUT
32
28
33
29
- name : Create .tar.zst archives
34
30
run : |
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"
46
-
47
- - name : Upload .tar.zst archives to GitHub Release
48
- uses : softprops/action-gh-release@v2
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
+
36
+ - name : Create GitHub Release
37
+ id : create_release
38
+ uses : actions/create-release@v1
49
39
with :
50
- # Pick up both .tar.zst files at the workspace root
51
- files : ' *.tar.zst'
40
+ tag_name : ${{ steps.version.outputs.tag_name }}
41
+ release_name : Release ${{ steps.version.outputs.tag_name }}
42
+ draft : false
43
+ prerelease : false
52
44
env :
53
45
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
46
+
47
+ - name : Upload full-tag .tar.zst
48
+ uses : actions/upload-release-asset@v1
49
+ with :
50
+ upload_url : ${{ steps.create_release.outputs.upload_url }}
51
+ asset_path : ${{ github.workspace }}/${{ steps.version.outputs.tag_name }}.tar.zst
52
+ asset_name : ${{ steps.version.outputs.tag_name }}.tar.zst
53
+ 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