Merge pull request #126 from smuppand/main #5
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 the GITHUB_TOKEN write access so we can create releases & upload assets | |
permissions: | |
contents: write | |
on: | |
push: | |
# Trigger on semver tags like v1.2.3 | |
tags: | |
- 'v*.*.*' | |
workflow_dispatch: # allow 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=test-definitions/ \ | |
"${{ 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 | |
with: | |
tag_name: ${{ steps.version.outputs.tag_name }} | |
release_name: Release ${{ steps.version.outputs.tag_name }} | |
draft: false | |
prerelease: false | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Upload .tar.zst to GitHub Release | |
uses: actions/upload-release-asset@v1 | |
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 |