|
14 | 14 | - "renovate/**" |
15 | 15 | tags: |
16 | 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: |
|
25 | 26 | CARGO_TERM_COLOR: always |
26 | 27 | CARGO_INCREMENTAL: '0' |
27 | 28 | CARGO_PROFILE_DEV_DEBUG: '0' |
28 | | - RUST_TOOLCHAIN_VERSION: "1.81.0" |
| 29 | + RUST_TOOLCHAIN_VERSION: "1.82.0" |
29 | 30 | RUSTFLAGS: "-D warnings" |
30 | 31 | RUSTDOCFLAGS: "-D warnings" |
31 | 32 | RUST_LOG: "info" |
@@ -344,9 +345,22 @@ jobs: |
344 | 345 | with: |
345 | 346 | crate: cargo-edit |
346 | 347 | bin: cargo-set-version |
347 | | - - name: Update version if PR |
348 | | - if: ${{ github.event_name == 'pull_request' }} |
349 | | - run: cargo set-version --offline --workspace 0.0.0-pr${{ github.event.pull_request.number }} |
| 348 | + - name: Update version if PR against main branch |
| 349 | + if: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.ref == 'main' }} |
| 350 | + env: |
| 351 | + PR_NUMBER: ${{ github.event.pull_request.number }} |
| 352 | + run: | |
| 353 | + PR_VERSION="0.0.0-pr${PR_NUMBER}" |
| 354 | + cargo set-version --offline --workspace "$PR_VERSION" |
| 355 | + - name: Update version if PR against non-main branch |
| 356 | + # For PRs to be merged against a release branch, use the version that has already been set in the calling script. |
| 357 | + if: ${{ github.event_name == 'pull_request' && startsWith(github.event.pull_request.base.ref, 'release-') }} |
| 358 | + env: |
| 359 | + PR_NUMBER: ${{ github.event.pull_request.number }} |
| 360 | + run: | |
| 361 | + MANIFEST_VERSION=$(cargo metadata --format-version 1 --no-deps | jq -r '.packages[0].version') |
| 362 | + PR_VERSION="${MANIFEST_VERSION}-pr${PR_NUMBER}" |
| 363 | + cargo set-version --offline --workspace "$PR_VERSION" |
350 | 364 |
|
351 | 365 | # Recreate charts and publish charts and docker image. The "-e" is needed as we want to override the |
352 | 366 | # default value in the makefile if called from this action, but not otherwise (i.e. when called locally). |
@@ -410,9 +424,22 @@ jobs: |
410 | 424 | with: |
411 | 425 | crate: cargo-edit |
412 | 426 | bin: cargo-set-version |
413 | | - - name: Update version if PR |
414 | | - if: ${{ github.event_name == 'pull_request' }} |
415 | | - run: cargo set-version --offline --workspace 0.0.0-pr${{ github.event.pull_request.number }} |
| 427 | + - name: Update version if PR against main branch |
| 428 | + if: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.ref == 'main' }} |
| 429 | + env: |
| 430 | + PR_NUMBER: ${{ github.event.pull_request.number }} |
| 431 | + run: | |
| 432 | + PR_VERSION="0.0.0-pr${PR_NUMBER}" |
| 433 | + cargo set-version --offline --workspace "$PR_VERSION" |
| 434 | + - name: Update version if PR against non-main branch |
| 435 | + # For PRs to be merged against a release branch, use the version that has already been set in the calling script. |
| 436 | + if: ${{ github.event_name == 'pull_request' && startsWith(github.event.pull_request.base.ref, 'release-') }} |
| 437 | + env: |
| 438 | + PR_NUMBER: ${{ github.event.pull_request.number }} |
| 439 | + run: | |
| 440 | + MANIFEST_VERSION=$(cargo metadata --format-version 1 --no-deps | jq -r '.packages[0].version') |
| 441 | + PR_VERSION="${MANIFEST_VERSION}-pr${PR_NUMBER}" |
| 442 | + cargo set-version --offline --workspace "$PR_VERSION" |
416 | 443 | - name: Build manifest list |
417 | 444 | run: | |
418 | 445 | # Creating manifest list |
|
0 commit comments