|
13 | 13 | - trying
|
14 | 14 | - "renovate/**"
|
15 | 15 | 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]+' |
17 | 18 | pull_request:
|
18 | 19 | merge_group:
|
19 | 20 | schedule:
|
@@ -344,10 +345,18 @@ jobs:
|
344 | 345 | with:
|
345 | 346 | crate: cargo-edit
|
346 | 347 | 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 |
349 | 349 | if: ${{ github.event_name == 'pull_request' && github.ref == 'refs/heads/main' }}
|
350 | 350 | 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" |
351 | 360 |
|
352 | 361 | # Recreate charts and publish charts and docker image. The "-e" is needed as we want to override the
|
353 | 362 | # default value in the makefile if called from this action, but not otherwise (i.e. when called locally).
|
@@ -411,10 +420,18 @@ jobs:
|
411 | 420 | with:
|
412 | 421 | crate: cargo-edit
|
413 | 422 | 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 |
416 | 424 | if: ${{ github.event_name == 'pull_request' && github.ref == 'refs/heads/main' }}
|
417 | 425 | 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" |
418 | 435 | - name: Build manifest list
|
419 | 436 | run: |
|
420 | 437 | # Creating manifest list
|
|
0 commit comments