name: Release (crates.io)
on:
push:
tags:
- "v*"
permissions:
contents: read
jobs:
publish-crate:
name: Publish mp4box to crates.io
runs-on: ubuntu-latest
env:
CARGO_TERM_COLOR: always
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Show rustc / cargo versions
run: |
rustc -V
cargo -V
- name: Cache cargo registry + target
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Run tests (safety before publish)
run: cargo test --all --all-features
- name: Publish to crates.io
run: cargo publish --all-features --locked