62 lines
1.7 KiB
YAML
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
|