Merge pull request #129 from smuppand/main #8
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Zstd Archive Release | |
# Grant write access so we can create releases & upload assets | |
permissions: | |
contents: write | |
on: | |
push: | |
# Only run on semver-style tags like v1.2.3 | |
tags: | |
- 'v*.*.*' | |
workflow_dispatch: # (Optional) allows manual runs | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install zstd | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y zstd | |
- name: Extract version info | |
id: version | |
run: | | |
TAG="${GITHUB_REF#refs/tags/}" # e.g. v1.2.3 | |
echo "tag_name=$TAG" >> $GITHUB_OUTPUT | |
- name: Create .tar.zst archive | |
run: | | |
git archive --format=tar \ | |
--prefix=qcom-linux-testkit/ \ | |
"${{ steps.version.outputs.tag_name }}" \ | |
| zstd -o "${GITHUB_WORKSPACE}/${{ steps.version.outputs.tag_name }}.tar.zst" | |
- name: Create GitHub Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.PAT }} # your PAT secret with repo scope | |
with: | |
tag_name: ${{ steps.version.outputs.tag_name }} | |
release_name: Release ${{ steps.version.outputs.tag_name }} | |
draft: false | |
prerelease: false | |
- name: Upload .tar.zst to GitHub Release | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.PAT }} # same PAT here | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ${{ github.workspace }}/${{ steps.version.outputs.tag_name }}.tar.zst | |
asset_name: ${{ steps.version.outputs.tag_name }}.tar.zst | |
asset_content_type: application/zstd |