Skip to content

Commit b68c463

Browse files
authored
Merge branch 'main' into docs/update-stackable-overview
2 parents a724f78 + fe9f74a commit b68c463

File tree

1 file changed

+22
-5
lines changed

1 file changed

+22
-5
lines changed

template/.github/workflows/build.yml.j2

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ on:
1313
- trying
1414
- "renovate/**"
1515
tags:
16-
- '[0-9][0-9].[0-9]+.[0-9]+(-rc[0-9]+)?'
16+
- '[0-9][0-9].[0-9]+.[0-9]+'
17+
- '[0-9][0-9].[0-9]+.[0-9]+-rc[0-9]+'
1718
pull_request:
1819
merge_group:
1920
schedule:
@@ -344,10 +345,18 @@ jobs:
344345
with:
345346
crate: cargo-edit
346347
bin: cargo-set-version
347-
- name: Update version if PR
348-
# For PRs to be merged against a release branch, the version has already been set, in which case ignore this step.
348+
- name: Update version if PR against main branch
349349
if: ${{ github.event_name == 'pull_request' && github.ref == 'refs/heads/main' }}
350350
run: cargo set-version --offline --workspace 0.0.0-pr${{ github.event.pull_request.number }}
351+
- name: Update version if PR against non-main branch
352+
# For PRs to be merged against a release branch, use the version that has already been set in the calling script.
353+
if: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/main' }}
354+
env:
355+
PR_NUMBER: ${{ github.event.pull_request.number }}
356+
run: |
357+
MANIFEST_VERSION=$(cargo metadata --format-version 1 --no-deps | jq -r '.packages[0].version')
358+
PR_VERSION="${MANIFEST_VERSION}-pr${PR_NUMBER}"
359+
cargo set-version --offline --workspace "$PR_VERSION"
351360

352361
# Recreate charts and publish charts and docker image. The "-e" is needed as we want to override the
353362
# default value in the makefile if called from this action, but not otherwise (i.e. when called locally).
@@ -411,10 +420,18 @@ jobs:
411420
with:
412421
crate: cargo-edit
413422
bin: cargo-set-version
414-
- name: Update version if PR
415-
# For PRs to be merged against a release branch, the version has already been set, in which case ignore this step.
423+
- name: Update version if PR against main branch
416424
if: ${{ github.event_name == 'pull_request' && github.ref == 'refs/heads/main' }}
417425
run: cargo set-version --offline --workspace 0.0.0-pr${{ github.event.pull_request.number }}
426+
- name: Update version if PR against non-main branch
427+
# For PRs to be merged against a release branch, use the version that has already been set in the calling script.
428+
if: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/main' }}
429+
env:
430+
PR_NUMBER: ${{ github.event.pull_request.number }}
431+
run: |
432+
MANIFEST_VERSION=$(cargo metadata --format-version 1 --no-deps | jq -r '.packages[0].version')
433+
PR_VERSION="${MANIFEST_VERSION}-pr${PR_NUMBER}"
434+
cargo set-version --offline --workspace "$PR_VERSION"
418435
- name: Build manifest list
419436
run: |
420437
# Creating manifest list

0 commit comments

Comments
 (0)