Skip to content

Conversation

@alexcrichton
Copy link
Member

This commit updates the publish scripts and CI configuration to use the "Trusted Publishing" workflow on crates.io. This enables removal of the long-lived token assigned to this repository in favor of short-lived ephemeral tokens scoped to just the publish.yml workflow.

Here CI configuration is updated to avoid using the token in the environment. Instead it uses rust-lang/crates-io-auth-action@v1 to acquire a token during publishing. Documentation is added for how to add a crate to this repository as it now requires that the crate is published on crates.io before it's added to this repository. That ensures that the trusted publishing workflow is in place before a PR is merged. Finally the publish.rs script is updated to avoid owner management on version bumps but also check on PRs that the owners are configured correctly.

This commit updates the publish scripts and CI configuration to use the
"Trusted Publishing" workflow on crates.io. This enables removal of the
long-lived token assigned to this repository in favor of short-lived
ephemeral tokens scoped to just the `publish.yml` workflow.

Here CI configuration is updated to avoid using the token in the
environment. Instead it uses `rust-lang/crates-io-auth-action@v1` to
acquire a token during publishing. Documentation is added for how to add
a crate to this repository as it now requires that the crate is
published on crates.io before it's added to this repository. That
ensures that the trusted publishing workflow is in place before a PR is
merged. Finally the `publish.rs` script is updated to avoid owner
management on version bumps but also check on PRs that the owners are
configured correctly.
@alexcrichton alexcrichton requested a review from a team as a code owner August 13, 2025 21:02
@alexcrichton alexcrichton requested review from fitzgen and removed request for a team August 13, 2025 21:02
@alexcrichton
Copy link
Member Author

I expect CI to fail temporarily as the wasm-encoder crate doesn't have permissions set up. That'll be resolved shortly, however.

After this PR merges I plan on publishing a point release to ensure that this all works.

alexcrichton added a commit to alexcrichton/wit-bindgen that referenced this pull request Aug 13, 2025
Similar to bytecodealliance/wasm-tools#2281 but for this repository. The
main benefit is removal of a long-lived token, and the main consequence
is that crates will need to be published to crates.io with a placeholder
before being merged in here.
github-merge-queue bot pushed a commit to bytecodealliance/wit-bindgen that referenced this pull request Aug 13, 2025
* Migrate this workspace to using trusted publishing

Similar to bytecodealliance/wasm-tools#2281 but for this repository. The
main benefit is removal of a long-lived token, and the main consequence
is that crates will need to be published to crates.io with a placeholder
before being merged in here.

* Prints-to-panics

* Add necessary CI configuration keys
@alexcrichton alexcrichton enabled auto-merge August 14, 2025 19:19
@alexcrichton alexcrichton added this pull request to the merge queue Aug 14, 2025
Merged via the queue into bytecodealliance:main with commit 68eda96 Aug 14, 2025
64 of 66 checks passed
@alexcrichton alexcrichton deleted the trusted-publishign branch August 14, 2025 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants