From 9226c227902830c8d5f71070586f4d5fe78ecdb2 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Mon, 18 May 2026 14:42:20 -0400 Subject: [PATCH] ci: Add crates.io trusted publishing workflow Triggers on version tags (both v* and bare 0.x.y styles used historically). Assisted-by: OpenCode (Claude Sonnet 4.6) Signed-off-by: Colin Walters --- .github/workflows/cratesio-release.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/workflows/cratesio-release.yml diff --git a/.github/workflows/cratesio-release.yml b/.github/workflows/cratesio-release.yml new file mode 100644 index 00000000..9716ab32 --- /dev/null +++ b/.github/workflows/cratesio-release.yml @@ -0,0 +1,17 @@ +# See https://crates.io/docs/trusted-publishing +name: Publish to crates.io +on: + push: + tags: ['v*', '[0-9]*'] # Triggers on version tags (e.g. v0.4.46 or 0.4.46) +jobs: + publish: + runs-on: ubuntu-24.04 + permissions: + id-token: write # Required for OIDC token exchange + steps: + - uses: actions/checkout@v6 + - uses: rust-lang/crates-io-auth-action@v1 + id: auth + - run: cargo publish + env: + CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}