Fix workflow #17
Workflow file for this run
This file contains 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: Release | |
on: | |
push: | |
tags: | |
- "v*" | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
# Ensure the the version in Cargo.toml matches the tag | |
validate-tag: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- run: test $(grep '^version' Cargo.toml | sed -n 's/.*\([0-9]\+\.[0-9]\+\.[0-9]\+\).*/v\1/p') = ${{ github.ref_name }} | |
build-linux: | |
runs-on: ubuntu-latest | |
needs: validate-tag | |
steps: | |
- uses: actions/checkout@v4 | |
- name: build | |
run: cargo build --release | |
- name: make tarball | |
run: mkdir rudric-linux && cp target/release/rudric README.md rudric-linux && tar -czf rudric-linux.tar.gz rudric-linux | |
- name: upload tarball | |
uses: actions/upload-artifact@v4 | |
with: | |
name: uploads-linux | |
path: rudric-linux.tar.gz | |
build-mac-x86-64: | |
runs-on: macOS-14-large | |
needs: validate-tag | |
steps: | |
- uses: actions/checkout@v4 | |
- name: build | |
run: cargo build --release | |
- name: make zip | |
run: mkdir rudric-mac-x86-64 && cp target/release/rudric README.md rudric-mac-x86-64 && zip -r rudric-mac-x86-64.zip rudric-mac-x86-64 | |
- name: upload zip | |
uses: actions/upload-artifact@v4 | |
with: | |
name: uploads-mac-x86-64 | |
path: rudric-mac-x86-64.zip | |
build-mac-arm64: | |
runs-on: macOS-14 | |
needs: validate-tag | |
steps: | |
- uses: actions/checkout@v4 | |
- name: build | |
run: cargo build --release | |
- name: make zip | |
run: mkdir rudric-mac-arm64 && cp target/release/rudric README.md rudric-mac-arm64 && zip -r rudric-mac-arm64.zip rudric-mac-arm64 | |
- name: upload zip | |
uses: actions/upload-artifact@v4 | |
with: | |
name: uploads-mac-arm64 | |
path: rudric-mac-arm64.zip | |
release: | |
runs-on: ubuntu-latest | |
needs: | |
- build-linux | |
- build-mac-x86-64 | |
- build-mac-arm64 | |
steps: | |
- name: download artifacts | |
id: download_artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
path: uploads | |
pattern: uploads-* | |
merge-multiple: true | |
- name: release | |
uses: softprops/action-gh-release@v2 | |
with: | |
generate_release_notes: true | |
files: | | |
uploads/rudric-linux.tar.gz | |
uploads/rudric-mac-x86-64.zip | |
uploads/rudric-mac-arm64.zip | |
publish: | |
runs-on: ubuntu-latest | |
needs: | |
- release | |
steps: | |
- uses: actions/checkout@v4 | |
- run: cargo publish --token ${{ secrets.CARGO_TOKEN }} |