Skip to content

v0.4.1

v0.4.1 #22

Workflow file for this run

name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
release:
types: [ published ]
workflow_dispatch:
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: taiki-e/install-action@v2
with: { 'tool': 'just' }
- uses: actions/checkout@v4
- name: Ensure this crate has not yet been published (on release)
if: github.event_name == 'release'
run: just check-if-published
- uses: Swatinem/rust-cache@v2
if: github.event_name != 'release' && github.event_name != 'workflow_dispatch'
- run: just ci-test
- name: Check semver
uses: obi1kenobi/cargo-semver-checks-action@v2
msrv:
name: Test MSRV
runs-on: ubuntu-latest
steps:
- uses: taiki-e/install-action@v2
with: { tool: just }
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
if: github.event_name != 'release' && github.event_name != 'workflow_dispatch'
- name: Read crate metadata
id: metadata
run: echo "rust-version=$(sed -ne 's/rust-version *= *\"\(.*\)\"/\1/p' Cargo.toml)" >> $GITHUB_OUTPUT
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ steps.metadata.outputs.rust-version }}
components: rustfmt
- run: just ci-test-msrv
publish:
name: Publish to crates.io
if: startsWith(github.ref, 'refs/tags/')
needs: [ test, msrv ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Publish to crates.io
run: cargo publish
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}