Skip to content

v0.3.0

v0.3.0 #78

Workflow file for this run

name: Release
on:
pull_request:
branches: [main]
types: [labeled,closed]
jobs:
build-artifacts:
if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'release')
strategy:
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
- target: x86_64-apple-darwin
os: macos-latest
- target: aarch64-apple-darwin
os: macos-latest
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Add target
run: rustup target add ${{ matrix.target }}
- name: Compile binary
run: cargo build --locked --release --target ${{ matrix.target }}
- name: Tar artifacts
run: |
cd target/${{ matrix.target }}/release
tar -czf ${{ matrix.target }}.tar.gz depot
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.target }}
path: target/${{ matrix.target }}/release/${{ matrix.target }}.tar.gz
publish-crates:
needs: build-artifacts
runs-on: ubuntu-latest
steps:
- name: Install cargo-workspaces
uses: baptiste0928/cargo-install@v2
with:
crate: cargo-workspaces
- name: Checkout
uses: actions/checkout@v4
- name: Login to crates.io
run: cargo login ${{ secrets.CRATES_IO_TOKEN }}
- name: Publish crates
run: cargo ws publish --from-git --yes
- name: Add a tag for the merged commit
uses: christophebedard/tag-version-commit@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
version_regex: 'v([0-9]+\.[0-9]+\.[0-9]+)'
version_tag_prefix: 'v'
publish-artifacts:
needs: publish-crates
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
- name: Publish artifacts
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.event.pull_request.title }}
files: |
x86_64-unknown-linux-gnu/x86_64-unknown-linux-gnu.tar.gz
x86_64-apple-darwin/x86_64-apple-darwin.tar.gz
aarch64-apple-darwin/aarch64-apple-darwin.tar.gz