Skip to content

Release

Release #10

Workflow file for this run

name: Release
on:
workflow_dispatch:
inputs:
tag:
description: "Git tag to build and release (e.g. v0.1.2)"
required: true
type: string
permissions:
contents: write
jobs:
build:
name: Build ${{ matrix.target }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
asset: diecut-x86_64-linux.tar.gz
- target: aarch64-apple-darwin
os: macos-latest
asset: diecut-aarch64-macos.tar.gz
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.tag }}
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.target }}
- name: Build
run: cargo build --release --target ${{ matrix.target }}
- name: Package
run: |
cd target/${{ matrix.target }}/release
tar czf ../../../${{ matrix.asset }} diecut
cd ../../..
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.asset }}
path: ${{ matrix.asset }}
release:
name: Create Release
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
merge-multiple: true
- name: Upload to GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ inputs.tag }}
files: |
diecut-x86_64-linux.tar.gz
diecut-aarch64-macos.tar.gz