ci(deploy): trusted publishing#423
Merged
Merged
Conversation
Replace the static CRATE_AUTH_TOKEN secret with OIDC-based Trusted Publishing using rust-lang/crates-io-auth-action, which exchanges a short-lived token at publish time instead of storing a long-lived credential in the repository. https://claude.ai/code/session_013tt2ucFPTnTnGGM1RLG19m
Bind the publish job to a "release" GitHub Actions environment so that environment protection rules, such as required reviewers, gate the issuance of the crates.io Trusted Publishing token. https://claude.ai/code/session_013tt2ucFPTnTnGGM1RLG19m
Performance Regression Reportscommit: 5d47f68 --quantity=apparent-size --max-depth=1 --min-ratio=0.01
LogsJSON{
"results": [
{
"command": "pdu",
"mean": 0.10259226206500001,
"stddev": 0.013452636602506271,
"median": 0.09389166444,
"user": 0.05555532,
"system": 0.3037409966666667,
"min": 0.09067796344,
"max": 0.12565450444,
"times": [
0.12207032144,
0.12031135144,
0.12565450444,
0.09346292544,
0.09067796344,
0.09134550644,
0.09999191944000001,
0.11308873544,
0.12054945844,
0.12043258244,
0.12149808344,
0.11837161744000001,
0.09103491044,
0.09165617244,
0.09167835544,
0.09560288944,
0.10914684644,
0.09432040344,
0.09178537644,
0.09191376944,
0.09151997844,
0.09138879144,
0.09199317944,
0.09271864744
],
"exit_codes": [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
]
},
{
"command": "pdu-0.20.0",
"mean": 0.09139085787750001,
"stddev": 0.0006692576150037054,
"median": 0.09127308694,
"user": 0.053839601249999994,
"system": 0.30226958000000004,
"min": 0.09026682044,
"max": 0.09358933044000001,
"times": [
0.09245852244,
0.09198947744,
0.09145360344,
0.09358933044000001,
0.09103361244,
0.09202980844,
0.09071645644,
0.09106865444000001,
0.09090917544,
0.09118264644,
0.09096503944,
0.09132716344,
0.09180431944,
0.09143109944,
0.09109490444,
0.09102022244,
0.09132885644,
0.09152239644,
0.09122250544,
0.09152035344000001,
0.09098172444,
0.09117418244,
0.09132366844,
0.09139203044000001,
0.09190799544,
0.09096896444000001,
0.09037911944,
0.09026682044,
0.09122232644,
0.09148792444,
0.09288889844,
0.09084564944
],
"exit_codes": [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
]
}
]
} |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the release deployment workflow to publish the crate to crates.io via OIDC-based Trusted Publishing, avoiding long-lived registry credentials stored as GitHub secrets.
Changes:
- Switch crates.io authentication from
cargo loginwithsecrets.CRATE_AUTH_TOKENtorust-lang/crates-io-auth-action@v1. - Pass the short-lived crates.io token to
cargo publishviaCARGO_REGISTRY_TOKEN. - Configure the publish job with a
releaseenvironment and requestid-token: writepermissions for OIDC.
Specifying a job-level permissions block resets every unlisted scope to none. Restore the contents:read access that actions/checkout relies on, matching the build jobs in this workflow. https://claude.ai/code/session_013tt2ucFPTnTnGGM1RLG19m
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
Switch crates.io publishing from a long-lived API token to Trusted Publishing (OIDC).
publish_cargo_cratejob now usesrust-lang/crates-io-auth-action@v1to exchange a GitHub OIDC token for a short-lived crates.io token at publish time, instead ofcargo loginwith theCRATE_AUTH_TOKENsecret. The token is auto-revoked when the job ends, so no long-lived credential lives in the repository.releaseGitHub Actions environment so environment protection rules (e.g. required reviewers, tag restrictions) gate token issuance.https://claude.ai/code/session_013tt2ucFPTnTnGGM1RLG19m