name: Release
on:
push:
tags:
- 'v*'
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo test --verbose
# Validate packaging end-to-end without uploading (no token needed).
- run: cargo publish --dry-run
# Real upload. Version comes from Cargo.toml, NOT the git tag.
- run: cargo publish
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}