File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -427,13 +427,15 @@ jobs:
427
427
run : cargo set-version --offline --workspace 0.0.0-pr${{ github.event.pull_request.number }}
428
428
- name : Update version if PR against non-main branch
429
429
# 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.
430
432
if : ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/main' }}
431
433
env :
432
434
PR_NUMBER : ${{ github.event.pull_request.number }}
433
435
run : |
434
436
MANIFEST_VERSION=$(cargo metadata --format-version 1 --no-deps | jq -r '.packages[0].version')
435
437
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
437
439
- name : Build manifest list
438
440
run : |
439
441
# Creating manifest list
You can’t perform that action at this time.
0 commit comments