Skip to content

Commit b660166

Browse files
authored
Merge pull request qualcomm-linux#124 from smuppand/main
ci(zstd): output .tar.zst artifacts to workspace root and simplify upload
2 parents 07b9e22 + 9ec65f5 commit b660166

File tree

1 file changed

+24
-16
lines changed

1 file changed

+24
-16
lines changed

.github/workflows/zstd.yml

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@ name: Zstd Archive Release
22

33
on:
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

911
jobs:
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

Comments
 (0)