ci: use Trusted Publishing for crates.io#9
Open
funcpp wants to merge 1 commit into
Open
Conversation
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>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
crates.io added OIDC Trusted Publishing for GitHub Actions in July 2025 (rust-lang RFC 3691, blog post). Switch the
publish-cratesjob to use it instead of a long-livedCARGO_REGISTRY_TOKENsecret.Benefits:
publish-pypijob, which already uses PyPI's OIDC Trusted Publishing.One-time setup before tagging v0.2.0
On crates.io: go to
sqllineagecrate → Settings → Trusted Publishing → add a GitHub publisher with:funcppsqllineagerelease.ymlcrates-ioThe environment name must match
environment: crates-ioin the workflow. Thecrates-ioGitHub Environment doesn't strictly need to exist yet — but creating it lets you add reviewer / branch protection rules around the publish step.Test plan
git diff— onlyrelease.ymlchanged; 9 inserted, 1 removed.publish-cratesjob acquires a token via the auth action andcargo publishsucceeds.🤖 Generated with Claude Code