name: Release
on:
push:
tags:
- "[0-9]*"
permissions:
contents: write
env:
CARGO_TERM_COLOR: always
jobs:
build:
name: Publish crate
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Verify tag and Cargo version match
run: |
VERSION=$(bash ./scripts.dev/get-version.sh)
TAG=${GITHUB_REF_NAME#v}
[ "$VERSION" = "$TAG" ]
- name: Cache
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Run tests
run: |
cargo test --all-targets
- name: Publish limabean crate
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATE_DEPLOY_TOKEN }}
run: |
cargo publish