Skip to content

Commit ab9e8b9

Browse files
committed
ci(zstd): replace softprops release action with official GitHub actions
- Remove softprops/action-gh-release in favor of actions/create-release@v1 and actions/upload-release-asset@v1 - Create release via `actions/create-release` and upload both `.tar.zst` artifacts with `actions/upload-release-asset` - Ensure compliance with org’s allowed actions policy Signed-off-by: Srikanth Muppandam <smuppand@qti.qualcomm.com>
1 parent b660166 commit ab9e8b9

File tree

1 file changed

+32
-24
lines changed

1 file changed

+32
-24
lines changed

.github/workflows/zstd.yml

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

33
on:
44
push:
5-
# Match semver tags like v1.2.3
65
tags:
76
- 'v*.*.*'
8-
# Allow manual runs from the Actions UI
97
workflow_dispatch:
108

119
jobs:
1210
release:
1311
runs-on: ubuntu-latest
14-
1512
steps:
1613
- name: Checkout repository
1714
uses: actions/checkout@v4
@@ -24,30 +21,41 @@ jobs:
2421
- name: Extract version info
2522
id: version
2623
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
3228
3329
- name: Create .tar.zst archives
3430
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
4939
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
5244
env:
5345
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

Comments
 (0)