diff --git a/.github/workflows/release-plz.yml b/.github/workflows/release-plz.yml deleted file mode 100644 index bd237de1..00000000 --- a/.github/workflows/release-plz.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: Release-plz - -on: - push: - branches: - - main - -jobs: - release-plz-pr: - name: Release PR - runs-on: ubuntu-latest - permissions: - contents: write - pull-requests: write - steps: - - uses: actions/checkout@v6 - with: - fetch-depth: 0 - - uses: dtolnay/rust-toolchain@stable - - uses: MarcoIeni/release-plz-action@v0.5 - with: - command: release-pr - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - release-plz-release: - name: Release - runs-on: ubuntu-latest - permissions: - contents: write - steps: - - uses: actions/checkout@v6 - with: - fetch-depth: 0 - - uses: dtolnay/rust-toolchain@stable - - uses: MarcoIeni/release-plz-action@v0.5 - with: - command: release - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..013bdd21 --- /dev/null +++ b/.github/workflows/release.yml @@ -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 }} diff --git a/release-plz.toml b/release-plz.toml deleted file mode 100644 index 6c3b022e..00000000 --- a/release-plz.toml +++ /dev/null @@ -1,11 +0,0 @@ -[workspace] -changelog_update = true -git_tag_name = "v{{ version }}" -git_release_enable = true -publish = true -pr_draft = true - -[[package]] -name = "discovery_client" -release = false -publish = false diff --git a/release.toml b/release.toml new file mode 100644 index 00000000..c11b4e28 --- /dev/null +++ b/release.toml @@ -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 ` 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"] diff --git a/simple-someip-embassy-net/Cargo.toml b/simple-someip-embassy-net/Cargo.toml index 6d9fb8a6..73f771bc 100644 --- a/simple-someip-embassy-net/Cargo.toml +++ b/simple-someip-embassy-net/Cargo.toml @@ -6,6 +6,7 @@ license = "MIT OR Apache-2.0" description = "embassy-net `TransportFactory` / `TransportSocket` adapter for the simple-someip crate" repository = "https://github.com/luminartech/simple_someip" readme = "README.md" +publish = false # This crate is the reference no_std backend for `simple-someip`'s # trait surface. It depends on `simple-someip` with