slugify/.github/workflows/release.yml
Fabio Montefuscolo a8ca0db8b0
Some checks failed
CI / Code Quality (push) Failing after 3s
CI / Test Suite (push) Failing after 2s
Release / Build - macos-latest (aarch64-apple-darwin) (push) Waiting to run
Release / Build - ubuntu-latest (x86_64-unknown-linux-gnu) (push) Failing after 3s
feat: github actions
2026-04-19 11:22:59 +02:00

62 lines
1.7 KiB
YAML

name: Release
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
permissions:
contents: write
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
jobs:
build:
name: Build - ${{ matrix.platform.os }} (${{ matrix.platform.target }})
strategy:
fail-fast: false
matrix:
platform:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
asset: slugify-linux-x86_64
- os: macos-latest
target: aarch64-apple-darwin
asset: slugify-macos-aarch64
runs-on: ${{ matrix.platform.os }}
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
target: ${{ matrix.platform.target }}
- uses: actions/cache@v4
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
- uses: actions/cache@v4
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-git-${{ hashFiles('**/Cargo.lock') }}
- uses: actions/cache@v4
with:
path: target
key: ${{ runner.os }}-${{ matrix.platform.target }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
- name: Build
run: cargo build --release --locked --target ${{ matrix.platform.target }}
- name: Prepare asset
run: |
strip target/${{ matrix.platform.target }}/release/slugify
cp target/${{ matrix.platform.target }}/release/slugify ${{ matrix.platform.asset }}
- uses: softprops/action-gh-release@v2
with:
files: ${{ matrix.platform.asset }}
generate_release_notes: true