Sync Cargo.lock before cargo build --locked in release workflow#204
Merged
Conversation
The release for v0.1.1 was tagged with a Cargo.toml bumped to 0.1.1 but Cargo.lock still listing 0.1.0; `cargo build --locked` failed, the Publish GitHub Release step was skipped, and the release was created with no assets attached. `scripts/release.sh` regenerates Cargo.lock before the tag is pushed, so the common path is already safe. This step adds a fallback so a tag created without going through that script (or where the lockfile drifted for any other reason) still produces a release artifact instead of an empty release object.
Contributor
Author
|
@xlc — two requests:
Context: Downstream CI (polkadot-fellows/runtimes#1180, open-web3-stack/polkadot-ecosystem-tests#622) currently consumes Subway via |
1 task
xlc
approved these changes
May 21, 2026
Member
|
I made v0.1.2 release instead of trying to figure out how to re-release v0.1.1 |
Contributor
Author
|
@xlc works for me; thanks 👍 |
rockbmb
added a commit
to rockbmb/runtimes
that referenced
this pull request
May 21, 2026
`acala/subway:v0.1.2` is the first release tag with a working release artifact ([the v0.1.1 build was tagged with a stale `Cargo.lock`](https://github.com/AcalaNetwork/subway/actions/runs/26141877372) and AcalaNetwork/subway#204 fixed the release workflow). The next commit drops the Docker-extract workaround in favour of the attached `.tar.gz` asset; bumping the tag separately keeps that diff easy to review.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What happened
The release for
v0.1.1was tagged withCargo.tomlbumped to0.1.1but withCargo.lockstill listing0.1.0.cargo build --release --lockedfailed against the mismatch,Publish GitHub Releasewas skipped, andv0.1.1was created with no assets.Why this is needed
scripts/release.shregeneratesCargo.lock(cargo check) before the tag is pushed, so the scripted path is already safe. The fix adds the same guarantee for any tag that bypasses the script (manualCargo.tomledit + tag push, or any other lockfile drift): acargo update --workspacestep before the build keepsCargo.lockin sync with the workspaceCargo.toml, and--lockedstill enforces no drift in transitive deps.Without it, a mistake at tag time silently produces an empty release.