Files
codewhale/.github/workflows/crates-publish.yml
T
Hunter Bown 32443ae91b Fix CI: Remove redundant toolchain input from dtolnay/rust-toolchain@stable
The dtolnay/rust-toolchain action already specifies the toolchain version
in the action reference (@stable). Adding toolchain: stable as an input
was causing 'toolchain is a required input' errors.

Fixed in:
- ci.yml
- release.yml
- crates-publish.yml
2026-01-28 09:58:28 -06:00

31 lines
870 B
YAML

name: Publish to Crates.io
on:
release:
types: [published]
workflow_dispatch:
jobs:
publish:
name: Publish to crates.io
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Verify version matches tag
if: github.event_name == 'release'
run: |
TAG_VERSION=${GITHUB_REF#refs/tags/v}
CARGO_VERSION=$(cargo metadata --format-version 1 --no-deps | jq -r '.packages[0].version')
if [ "$TAG_VERSION" != "$CARGO_VERSION" ]; then
echo "Tag version ($TAG_VERSION) does not match Cargo.toml version ($CARGO_VERSION)"
exit 1
fi
- name: Publish to crates.io
run: cargo publish
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}