feat: add cargo publish reusable workflow - #26
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a reusable GitHub Actions workflow for publishing Rust crates to crates.io with optional environment protection.
Changes:
- Adds OIDC-based crates.io authentication.
- Supports optional GitHub environments.
- Publishes locked Rust packages with submodules enabled.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Please pin the two used actions |
10c608a to
7943f06
Compare
|
Could you add some more in-code documentation when to use/not to use the environment arg? Also, similarly to the dry-run, please document how the selection of packages works in our repos, i.e. we run on workspace and explicitly disable via cargo.toml publish=false |
ecd69a7 to
affc3b5
Compare
peinjoh
left a comment
There was a problem hiding this comment.
This is something we should discuss generally here: Do we want to allow concurrency of this job per repo? I can think of some misconfig / rerun situations were we end up with concurrently running publish of the same package, which might cause wierd results / race conditions.
We can also discuss add this later, slightly out of scope. Opinions?
ac9ff50 to
8221d3a
Compare
|
I added a repo-specific concurrency group (Code) as well as a "cargo publish --dry-run"-step for checking the publishability (Code). About the possible permission minimization: |
8221d3a to
93a21e4
Compare
Note: A new tag should be created after the merge.
This PR addresses #18.
It adds a reusable workflow for publishing Rust packages to crates.io.
The optional
environmentinput preserves thereleaseenvironment used byvers-rs, while callers without an environment can omit it.