-
Notifications
You must be signed in to change notification settings - Fork 0
build(release): migrate from release-plz to cargo-release #141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
e7bed56
build(release): migrate from release-plz to cargo-release
JustinKovacich 2b39669
ci: allow publish from detached HEAD on tag push (--allow-branch '*')
JustinKovacich 02b892e
ci(release): scope semver to host features + publish only simple-someip
JustinKovacich aaf660a
ci(release): tag-push-only trigger + least-privilege token
JustinKovacich b005bf8
docs(release): refresh publish-gate comment
JustinKovacich File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| name: Release | ||
|
|
||
| # Tag-push only. Semver gating on PRs is already covered by | ||
| # `CI / SemVer Check` in ci.yml (same action + feature set); this workflow's | ||
| # job is the publish gate, so it only needs to run when a release tag lands. | ||
| on: | ||
| push: | ||
| tags: ["v*"] | ||
|
|
||
| # Read-only: no job creates tags/releases or pushes to the repo. semver-checks | ||
| # only reads the tree; publish pushes to crates.io via CARGO_REGISTRY_TOKEN, | ||
| # not the GITHUB_TOKEN. | ||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| semver-checks: | ||
| name: Semver Checks | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| with: | ||
| fetch-depth: 0 | ||
| - uses: dtolnay/rust-toolchain@stable | ||
| - uses: Swatinem/rust-cache@v2 | ||
| # Scope to the alloc/host feature set, matching ci.yml's SemVer Check. | ||
| # The action's default `all-features` group unions `bare-metal-runtime` | ||
| # (no-alloc, nightly) with the alloc features, which trips the | ||
| # mutual-exclusion `compile_error!` in lib.rs — rustdoc fails to build | ||
| # and the whole check aborts. The host API is what we semver-gate; the | ||
| # bare-metal lane is nightly-only and checked elsewhere. | ||
| - uses: obi1kenobi/cargo-semver-checks-action@v2 | ||
| with: | ||
| package: simple-someip | ||
| feature-group: only-explicit-features | ||
| features: std,tracing,client,client-tokio,server,server-tokio,bare_metal,embassy_channels | ||
|
|
||
| publish: | ||
| name: Publish to crates.io | ||
| needs: semver-checks | ||
| # GATED: enable by setting repo variable SIMPLE_SOMEIP_PUBLISH_ENABLED=true | ||
| # once CARGO_REGISTRY_TOKEN exists in secrets and the team decides to cut a | ||
| # first version. Publishing goes to crates.io and needs only the token + | ||
| # crates.io reachability — not the Kellnr proxy (that fronts crates.io for | ||
| # dft-side consumption of the published crate, a separate concern). | ||
| if: github.event_name == 'push' && vars.SIMPLE_SOMEIP_PUBLISH_ENABLED == 'true' | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| with: | ||
| fetch-depth: 0 | ||
| - uses: dtolnay/rust-toolchain@stable | ||
| - uses: Swatinem/rust-cache@v2 | ||
| - run: cargo install cargo-release --version '^0.25' --locked | ||
| # --package simple-someip (NOT --workspace): `cargo release publish` is | ||
| # the explicit publish subcommand and does NOT honor the `publish = false` | ||
| # manifest flags on the examples / embassy-net member — `--workspace` | ||
| # makes it attempt to publish all 7 members and `cargo publish` then | ||
| # rejects the non-publishable ones. Only `simple-someip` is published. | ||
| # --allow-branch '*': a tag-push CI run is in detached-HEAD state, which | ||
| # cargo-release's branch check would otherwise reject. Publishing is | ||
| # already gated by the job `if:` above; this only relaxes the ref check. | ||
| - run: cargo release publish --package simple-someip --allow-branch '*' --no-confirm --execute | ||
| env: | ||
| CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} |
This file was deleted.
Oops, something went wrong.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| # Only `simple-someip` is ever released from this workspace. The examples and | ||
| # `simple-someip-embassy-net` carry `publish = false` in their own manifests, | ||
| # and CI publishes with `cargo release publish --package simple-someip` (see | ||
| # .github/workflows/release.yml) — so `tag-name`/`tag-message` are unambiguous | ||
| # and `shared-version = false` is safe (no second crate to collide tags with). | ||
| shared-version = false | ||
| # Disables auto-publish in the `cargo release <version>` bump+tag flow; the | ||
| # actual publish is the deliberate, gated `cargo release publish` step in CI. | ||
| publish = false | ||
| registry = "crates-io" | ||
| tag-name = "v{{version}}" | ||
| tag-message = "simple-someip v{{version}}" | ||
| pre-release-commit-message = "chore(release): v{{version}}" | ||
| allow-branch = ["main"] | ||
| pre-release-hook = ["cargo", "test", "--workspace", "--locked"] | ||
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.