Skip to content

Commit 657249b

Browse files
funcppclaude
andauthored
ci: use Trusted Publishing for crates.io instead of long-lived token (#9)
crates.io added OIDC Trusted Publishing for GitHub Actions in July 2025. This brings crates.io in line with PyPI (which the publish-pypi job already uses) and removes the need to store a CARGO_REGISTRY_TOKEN secret in the repo — the workflow exchanges a GitHub-issued OIDC token for a 30-minute crates.io access token at publish time. Before this can run on a real tag, register the Trusted Publisher on crates.io: sqllineage crate → Settings → Trusted Publishing → add GitHub repo funcpp/sqllineage, workflow release.yml, environment crates-io. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 20c62ca commit 657249b

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,17 @@ jobs:
124124
needs: [build, test]
125125
runs-on: ubuntu-latest
126126
environment: crates-io
127+
permissions:
128+
id-token: write
129+
contents: read
127130
steps:
128131
- uses: actions/checkout@v6
129132

130133
- uses: dtolnay/rust-toolchain@stable
131134

132-
- run: cargo publish -p sqllineage --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
135+
- uses: rust-lang/crates-io-auth-action@v1
136+
id: auth
137+
138+
- run: cargo publish -p sqllineage
139+
env:
140+
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}

0 commit comments

Comments
 (0)