Merge pull request #124 from smuppand/main #2
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 | |
on: | |
push: | |
# Match semver tags like v1.2.3 | |
tags: | |
- 'v*.*.*' | |
# Allow manual runs from the Actions UI | |
workflow_dispatch: | |
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: | | |
# If triggered by a tag push, GITHUB_REF is refs/tags/vX.Y.Z | |
TAG_NAME="${GITHUB_REF#refs/tags/}" | |
SHORT_TAG="${TAG_NAME#v}" # strip leading "v" | |
echo "tag_name=$TAG_NAME" >> $GITHUB_OUTPUT | |
echo "short_tag=$SHORT_TAG" >> $GITHUB_OUTPUT | |
- name: Create .tar.zst archives | |
run: | | |
# full-tag archive (vX.Y.Z.tar.zst) | |
git archive --format=tar \ | |
--prefix=test-definitions/ \ | |
"${{ steps.version.outputs.tag_name }}" \ | |
| zstd -o "$GITHUB_WORKSPACE/${{ steps.version.outputs.tag_name }}.tar.zst" | |
# short-tag archive (X.Y.Z.tar.zst) | |
git archive --format=tar \ | |
--prefix=test-definitions/ \ | |
"${{ steps.version.outputs.tag_name }}" \ | |
| zstd -o "$GITHUB_WORKSPACE/${{ steps.version.outputs.short_tag }}.tar.zst" | |
- name: Upload .tar.zst archives to GitHub Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
# Pick up both .tar.zst files at the workspace root | |
files: '*.tar.zst' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |