Skip to content

fix(release): read binary [package] version, not workspace 0.x version#395

Merged
domcyrus merged 1 commit into
mainfrom
fix/release-tooling-workspace-version
Jun 16, 2026
Merged

fix(release): read binary [package] version, not workspace 0.x version#395
domcyrus merged 1 commit into
mainfrom
fix/release-tooling-workspace-version

Conversation

@domcyrus

Copy link
Copy Markdown
Owner

Why

The workspace split (#367) added a [workspace.package] version = "0.2.0" line to Cargo.toml that sorts ahead of the binary's [package] version (currently 1.3.0). Several release tools derive the version with grep '^version' Cargo.toml | head -1, which now reads 0.2.0 (the library version) instead of the binary version.

Left unfixed, the next release would have:

  • pre-release-check.sh fail version-consistency with a false 0.2.0 != x.y.z mismatch, blocking the pre-release gate.
  • ppa-release.yml build the Ubuntu PPA package as 0.2.0, and — worse — git archive the ancient v0.2.0 tag (2024 source) as the release source (BASE_VERSIONRELEASE_TAG="v0.2.0").
  • obs-release.yml mis-derive the version on the non-tag fallback path.

release.yml is unaffected (it already uses toml get Cargo.toml package.version).

What

  • Read the binary version by anchoring on the [package] section:
    awk -F'"' '/^\[package\]/{p=1} p && /^version = /{print $2; exit}' Cargo.toml
    Applied in pre-release-check.sh, ppa-release.yml (both reads), and the obs-release.yml fallback.
  • Fix the pre-release-check.sh Dockerfile asset scan: the baked-in oui.gz/services assets moved to crates/rustnet-core/, so the src/-only include_bytes! scan silently validated nothing. Now scans crates/ too and covers include_str! (the services asset). The Dockerfile itself was already correct.
  • RELEASE.md: document the two version tracks (binary 1.x vs library 0.x) and the four-crate crates.io publish order.

Verification

./scripts/pre-release-check.sh 1.3.0 against current main now reports the correct Cargo.toml version: 1.3.0 and validates both crates/rustnet-core/assets/{oui.gz,services} against the Dockerfile. cargo test --workspace passes.

The workspace split added a [workspace.package] version = "0.2.0" line that
sorts ahead of the binary's [package] version in Cargo.toml. Release tooling
that did `grep '^version' | head -1` then read 0.2.0 instead of the binary
version, which would:

- make pre-release-check.sh fail version consistency with a false mismatch
- build the Ubuntu PPA package as 0.2.0, and (worse) git-archive the ancient
  v0.2.0 tag as the release source
- mis-derive the OBS fallback version on non-tag runs

Anchor all three on the [package] section via awk. Also fix the
pre-release-check Dockerfile asset scan: the baked-in oui.gz/services assets
moved to crates/rustnet-core/, so the src/-only include_bytes\! scan silently
checked nothing; scan crates/ too and cover include_str\!. Update RELEASE.md
for the two version tracks and the four-crate crates.io publish order.
@domcyrus domcyrus merged commit b417885 into main Jun 16, 2026
5 checks passed
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.

1 participant