Skip to content

Fix workflow

Fix workflow #5

Workflow file for this run

name: "Publish to crates.io"
on:
push:
tags:
- "*"
jobs:
publish:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: "Checkout"
uses: actions/checkout@v5
- name: "Run tests"
run: cargo test
- name: Verify version matches tag
run: |
TAG=${GITHUB_REF#refs/tags/}
VERSION=$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[0].version')
if [ "$TAG" != "$VERSION" ]; then
echo "Tag version ($TAG) does not match Cargo.toml version ($VERSION)"
exit 1
fi
- name: "Run publish dry run"
run: cargo publish --dry-run
- name: Publish
run: cargo publish --locked --token ${{ secrets.CARGO_REGISTRY_TOKEN }}