Merge pull request #125 from smuppand/main #4
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: | |
tags: | |
- 'v*.*.*' | |
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: | | |
TAG="${GITHUB_REF#refs/tags/}" | |
SHORT="${TAG#v}" | |
echo "tag_name=$TAG" >> $GITHUB_OUTPUT | |
echo "short_tag=$SHORT" >> $GITHUB_OUTPUT | |
- name: Create .tar.zst archives | |
run: | | |
git archive --format=tar --prefix=test-definitions/ "${{ steps.version.outputs.tag_name }}" \ | |
| zstd -o "$GITHUB_WORKSPACE/${{ steps.version.outputs.tag_name }}.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: 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 full-tag .tar.zst | |
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 | |
- name: Upload short-tag .tar.zst | |
uses: actions/upload-release-asset@v1 | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ${{ github.workspace }}/${{ steps.version.outputs.short_tag }}.tar.zst | |
asset_name: ${{ steps.version.outputs.short_tag }}.tar.zst | |
asset_content_type: application/zstd |