Skip to content

Commit 52f1678

Browse files
committed
ditto for manifest step
1 parent 26d0e98 commit 52f1678

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,13 +427,15 @@ jobs:
427427
run: cargo set-version --offline --workspace 0.0.0-pr${{ github.event.pull_request.number }}
428428
- name: Update version if PR against non-main branch
429429
# For PRs to be merged against a release branch, use the version that has already been set in the calling script.
430+
# We can't rely on cargo set-version here as we will break semver rules when changing the version to make it
431+
# specific to this PR e.g. 1.2.0 --> 1.2.0-pr678, so set it manually.
430432
if: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/main' }}
431433
env:
432434
PR_NUMBER: ${{ github.event.pull_request.number }}
433435
run: |
434436
MANIFEST_VERSION=$(cargo metadata --format-version 1 --no-deps | jq -r '.packages[0].version')
435437
PR_VERSION="${MANIFEST_VERSION}-pr${PR_NUMBER}"
436-
cargo set-version --offline --workspace "$PR_VERSION"
438+
sed -i "s/version = \"${MANIFEST_VERSION}\"/version = \"${PR_VERSION}\"/" Cargo.toml
437439
- name: Build manifest list
438440
run: |
439441
# Creating manifest list

0 commit comments

Comments
 (0)