Merge pull request #4 from Rodeapps/bench/customize-parallel-scaling #1
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 | |
| # Publishes the crate when a version tag (v*) is pushed. | |
| # Auth uses crates.io Trusted Publishing (OIDC) — no long-lived token is | |
| # stored in GitHub. One-time setup on crates.io: add a Trusted Publisher for | |
| # this repository pointing at this workflow file (publish.yml). | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| # Required for Trusted Publishing: the OIDC token exchange with crates.io. | |
| id-token: write | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - name: Verify tag matches Cargo.toml version | |
| run: | | |
| TAG="${GITHUB_REF_NAME#v}" | |
| CRATE_VER="$(grep -m1 '^version' Cargo.toml | sed -E 's/.*"(.*)".*/\1/')" | |
| echo "tag=$TAG crate=$CRATE_VER" | |
| if [ "$TAG" != "$CRATE_VER" ]; then | |
| echo "::error::tag v$TAG does not match Cargo.toml version $CRATE_VER" | |
| exit 1 | |
| fi | |
| - name: Authenticate to crates.io (Trusted Publishing) | |
| uses: rust-lang/crates-io-auth-action@v1 | |
| id: auth | |
| - name: Publish | |
| run: cargo publish | |
| env: | |
| CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }} |