Fix workflow #5
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 }} |