Skip to content

Unify Rust SDK release with publish.yml workflow#1237

Merged
stephentoub merged 4 commits intomainfrom
tclem/unify-rust-release
May 9, 2026
Merged

Unify Rust SDK release with publish.yml workflow#1237
stephentoub merged 4 commits intomainfrom
tclem/unify-rust-release

Conversation

@tclem
Copy link
Copy Markdown
Member

@tclem tclem commented May 8, 2026

Now that 0.1.0 has shipped, fold the Rust crate into the same unified publish.yml workflow that ships Node, .NET, and Python so we stop maintaining a separate release-plz two-PR flow and a hand-curated CHANGELOG.md. Rust now follows exactly the same dist-tag rules as the other SDKs: publish on latest and prerelease, skip on unstable.

What changes for releases

  • One workflow trigger ships everything. Publish SDK packages (publish.yml) computes the shared version, then publishes Node, .NET, Python, and Rust at that version on the same run.
  • Rust gets a version-scoped GitHub Release. In addition to the cross-language vX.Y.Z release, the workflow tags rust/vX.Y.Z and creates a Rust-scoped release with notes auto-generated from PR titles since the previous Rust tag (auto-detects rust/v*, falls back to rust-v* for the first run).
  • No more hand-edited CHANGELOG.md. Notes are PR-title driven, matching the other SDKs. The 0.1.0 curated entry is preserved at the existing rust-v0.1.0 git tag.
  • Cargo's standard semver behavior protects stable users from prereleases. cargo add and bare version requirements skip prereleases by default; users have to opt in explicitly with e.g. version = "1.0.0-beta.4".

Implementation notes

  • publish-rust job pins Rust 1.94.0 (matching rust-sdk-tests.yml), uses Swatinem/rust-cache@v2, dry-runs always, and only does the real publish on main.
  • rust/Cargo.toml carries 0.0.0-dev as a placeholder; CI overrides it via sed at publish time, mirroring the Node 0.1.0-dev pattern.
  • Tag style is rust/vX.Y.Z to match the existing go/vX.Y.Z style for the Go submodule. The historical rust-v0.1.0 tag still works as the first auto-notes start point.
  • Deleted: rust-release-pr.yml, rust-publish-release.yml, rust/release-plz.toml, rust/CHANGELOG.md.
  • Dropped cargo semver-checks from rust-sdk-tests.yml — none of the other language SDKs enforce semver in CI, and Rust shouldn't be the odd one out.
  • rust/RELEASING.md rewritten as a short pointer doc covering the unified flow, Cargo prerelease semantics, yanking, and emergency manual publish.
  • Verified locally: cargo publish --dry-run --allow-dirty packages cleanly at a realistic version (0.3.0); cargo build succeeds at the 0.0.0-dev placeholder.

Next release

Trigger publish.yml with dist-tag=prerelease to ship 1.0.0-beta.4 across all four SDKs (Rust as a crates.io prerelease). Trigger with dist-tag=latest to ship 1.0.0 stable when ready.

tclem and others added 3 commits May 8, 2026 13:44
Fold the Rust crate into the same manual publish.yml workflow that
ships Node, .NET, and Python. Retire release-plz, the two-PR flow,
and the hand-curated CHANGELOG.md.

Rust ships only on dist-tag=latest runs and is hard-guarded to ^0\.
versions to prevent accidentally publishing 1.x while the crate is
still pre-1.0. The cross-language release notes continue at vX.Y.Z;
Rust gets its own scoped GitHub Release at rust/vX.Y.Z with notes
auto-generated from PR titles since the previous Rust tag.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Drop the pre-1.0 ^0\. guard and the 'latest only' gate on the Rust
publish job. Rust now follows the same dist-tag rules as Python and
.NET: publish on 'latest' and 'prerelease', skip on 'unstable'.

Cargo's standard semver behavior already protects stable users from
prereleases — 'cargo add' and bare version requirements skip
prereleases by default, so users have to opt in explicitly.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
None of the other language SDKs enforce semver compatibility in CI;
Rust shouldn't either. Out of step with the rest of the repo.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 8, 2026 20:51
@tclem tclem requested a review from a team as a code owner May 8, 2026 20:51
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR folds the Rust crate’s release/publish process into the repo’s unified .github/workflows/publish.yml workflow (alongside Node, .NET, and Python), removing the Rust-only release-plz flow and moving Rust release notes to GitHub’s generated notes.

Changes:

  • Add a publish-rust job to publish.yml, and create Rust-scoped tags/releases (rust/vX.Y.Z) during the unified release run.
  • Switch Rust crate versioning to a placeholder (0.0.0-dev) that is overridden in CI at publish time.
  • Remove Rust-specific release-plz workflows/config/changelog and update Rust release documentation accordingly.
Show a summary per file
File Description
rust/RELEASING.md Rewritten to describe the unified publish workflow, tag/release notes behavior, yanking, and emergency publish steps.
rust/release-plz.toml Deleted (release-plz configuration no longer used).
rust/README.md Adds a link to Rust-scoped GitHub Releases for per-version notes.
rust/CHANGELOG.md Deleted (release notes now generated from PR titles / GitHub release notes).
rust/Cargo.toml Sets crate version to 0.0.0-dev placeholder; removes release-plz file from excludes list.
rust/Cargo.lock Updates lockfile’s local package version to match the placeholder.
.github/workflows/rust-sdk-tests.yml Removes cargo semver-checks step from CI.
.github/workflows/rust-release-pr.yml Deleted (Rust release PR workflow removed).
.github/workflows/rust-publish-release.yml Deleted (Rust publish workflow removed).
.github/workflows/publish.yml Adds Rust publish job and a Rust-scoped tag + GitHub release creation step.

Copilot's findings

Comments suppressed due to low confidence (1)

rust/RELEASING.md:90

  • Same portability issue as above: sed -i '' ... is macOS/BSD sed-specific. Provide a Linux/GNU sed alternative or use a portable file-edit command so maintainers on Linux can restore the placeholder version reliably.
# Restore the placeholder.
sed -i '' -E 's/^version = ".*"$/version = "0.0.0-dev"/' Cargo.toml
  • Files reviewed: 9/10 changed files
  • Comments generated: 3

Comment thread .github/workflows/publish.yml Outdated
Comment thread .github/workflows/publish.yml Outdated
Comment thread rust/RELEASING.md
- Use 'grep -vFx' instead of 'grep -v "^TAG$"' for prev-tag lookup.
  Tag values contain dots that would be treated as regex metachars.
- Pass --prerelease to the Rust 'gh release create' when the
  workflow is triggered with dist-tag=prerelease, matching how the
  cross-language release step is labeled.
- Replace BSD-sed invocations in rust/RELEASING.md with portable
  'perl -i -pe' so the manual publish steps work on both macOS
  and Linux.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@tclem tclem requested a review from stephentoub May 8, 2026 21:14
# Rust gets its own version-scoped GitHub Release with notes
# derived from PR titles since the previous Rust tag. The
# cross-language `vX.Y.Z` release above still exists; this one
# is the canonical reference for Rust users.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have an agent that writes release notes for the main GitHub Release after each release ships. Not a prereq for this PR but at some point it may be beneficial to use the same technique.

@stephentoub stephentoub added this pull request to the merge queue May 9, 2026
Merged via the queue into main with commit 55b3b1c May 9, 2026
22 checks passed
@stephentoub stephentoub deleted the tclem/unify-rust-release branch May 9, 2026 02:08
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.

4 participants