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.79 .0"
29
+ RUST_TOOLCHAIN_VERSION : " 1.82 .0"
29
30
RUSTFLAGS : " -D warnings"
30
31
RUSTDOCFLAGS : " -D warnings"
31
32
RUST_LOG : " info"
49
50
- uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
50
51
with :
51
52
submodules : recursive
52
- - uses : dtolnay/rust-toolchain@d8352f6b1d2e870bc5716e7a6d9b65c4cc244a1a
53
+ - uses : dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a
53
54
with :
54
55
toolchain : ${{ env.RUST_TOOLCHAIN_VERSION }}
55
56
- uses : Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3
@@ -88,18 +89,18 @@ jobs:
88
89
TRIGGER : ${{ github.event_name }}
89
90
GITHUB_REF : ${{ github.ref }}
90
91
run : |
91
- if [[ $TRIGGER == "pull_request" ]]; then
92
+ if [[ " $TRIGGER" == "pull_request" ]]; then
92
93
echo "exporting test as target helm repo: ${{ env.TEST_REPO_HELM_URL }}"
93
- echo "helm_repo=${{ env.TEST_REPO_HELM_URL }}" >> $GITHUB_OUTPUT
94
- elif [[ ( $TRIGGER == "push" || $TRIGGER == "schedule" || $TRIGGER == "workflow_dispatch" ) && $GITHUB_REF == "refs/heads/main" ]]; then
94
+ echo "helm_repo=${{ env.TEST_REPO_HELM_URL }}" >> " $GITHUB_OUTPUT"
95
+ elif [[ ( " $TRIGGER" == "push" || " $TRIGGER" == "schedule" || " $TRIGGER" == "workflow_dispatch" ) && " $GITHUB_REF" == "refs/heads/main" ]]; then
95
96
echo "exporting dev as target helm repo: ${{ env.DEV_REPO_HELM_URL }}"
96
- echo "helm_repo=${{ env.DEV_REPO_HELM_URL }}" >> $GITHUB_OUTPUT
97
- elif [[ $TRIGGER == "push" && $GITHUB_REF == refs/tags/* ]]; then
97
+ echo "helm_repo=${{ env.DEV_REPO_HELM_URL }}" >> " $GITHUB_OUTPUT"
98
+ elif [[ " $TRIGGER" == "push" && $GITHUB_REF == refs/tags/* ]]; then
98
99
echo "exporting stable as target helm repo: ${{ env.STABLE_REPO_HELM_URL }}"
99
- echo "helm_repo=${{ env.STABLE_REPO_HELM_URL }}" >> $GITHUB_OUTPUT
100
+ echo "helm_repo=${{ env.STABLE_REPO_HELM_URL }}" >> " $GITHUB_OUTPUT"
100
101
else
101
102
echo "Unknown trigger and ref combination encountered, skipping publish step: $TRIGGER $GITHUB_REF"
102
- echo "helm_repo=skip" >> $GITHUB_OUTPUT
103
+ echo "helm_repo=skip" >> " $GITHUB_OUTPUT"
103
104
fi
104
105
105
106
run_cargodeny :
@@ -118,7 +119,7 @@ jobs:
118
119
- uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
119
120
with :
120
121
submodules : recursive
121
- - uses : EmbarkStudios/cargo-deny-action@3f4a782664881cf5725d0ffd23969fcce89fd868 # v1.6.3
122
+ - uses : EmbarkStudios/cargo-deny-action@8371184bd11e21dcf8ac82ebf8c9c9f74ebf7268 # v2.0.1
122
123
with :
123
124
command : check ${{ matrix.checks }}
124
125
@@ -129,7 +130,7 @@ jobs:
129
130
- uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
130
131
with :
131
132
submodules : recursive
132
- - uses : dtolnay/rust-toolchain@d8352f6b1d2e870bc5716e7a6d9b65c4cc244a1a
133
+ - uses : dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a
133
134
with :
134
135
toolchain : ${{ env.RUST_TOOLCHAIN_VERSION }}
135
136
components : rustfmt
@@ -147,7 +148,7 @@ jobs:
147
148
- uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
148
149
with :
149
150
submodules : recursive
150
- - uses : dtolnay/rust-toolchain@d8352f6b1d2e870bc5716e7a6d9b65c4cc244a1a
151
+ - uses : dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a
151
152
with :
152
153
toolchain : ${{ env.RUST_TOOLCHAIN_VERSION }}
153
154
components : clippy
@@ -182,7 +183,7 @@ jobs:
182
183
- uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
183
184
with :
184
185
submodules : recursive
185
- - uses : dtolnay/rust-toolchain@d8352f6b1d2e870bc5716e7a6d9b65c4cc244a1a
186
+ - uses : dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a
186
187
with :
187
188
toolchain : ${{ env.RUST_TOOLCHAIN_VERSION }}
188
189
components : rustfmt
@@ -204,7 +205,7 @@ jobs:
204
205
- uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
205
206
with :
206
207
submodules : recursive
207
- - uses : dtolnay/rust-toolchain@d8352f6b1d2e870bc5716e7a6d9b65c4cc244a1a
208
+ - uses : dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a
208
209
with :
209
210
toolchain : ${{ env.RUST_TOOLCHAIN_VERSION }}
210
211
- uses : Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3
@@ -224,7 +225,7 @@ jobs:
224
225
- uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
225
226
with :
226
227
submodules : recursive
227
- - uses : actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1 .0
228
+ - uses : actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2 .0
228
229
with :
229
230
python-version : ' 3.12'
230
231
- name : Install jinja2-cli
@@ -265,9 +266,9 @@ jobs:
265
266
- name : Set up Helm
266
267
uses : azure/setup-helm@fe7b79cd5ee1e45176fcad797de68ecaf3ca4814 # v4.2.0
267
268
with :
268
- version : v3.13.3
269
+ version : v3.16.1
269
270
- name : Set up cargo
270
- uses : dtolnay/rust-toolchain@d8352f6b1d2e870bc5716e7a6d9b65c4cc244a1a
271
+ uses : dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a
271
272
with :
272
273
toolchain : ${{ env.RUST_TOOLCHAIN_VERSION }}
273
274
- uses : Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3
@@ -310,6 +311,7 @@ jobs:
310
311
matrix :
311
312
runner : ["ubuntu-latest", "ubicloud-standard-8-arm"]
312
313
runs-on : ${{ matrix.runner }}
314
+ timeout-minutes : 120
313
315
permissions :
314
316
id-token : write
315
317
env :
@@ -331,8 +333,8 @@ jobs:
331
333
- uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
332
334
with :
333
335
submodules : recursive
334
- - uses : cachix/install-nix-action@8887e596b4ee1134dae06b98d573bd674693f47c # v26
335
- - uses : dtolnay/rust-toolchain@d8352f6b1d2e870bc5716e7a6d9b65c4cc244a1a
336
+ - uses : cachix/install-nix-action@ba0dd844c9180cbf77aa72a116d6fbc515d0e87b # v27
337
+ - uses : dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a
336
338
with :
337
339
toolchain : ${{ env.RUST_TOOLCHAIN_VERSION }}
338
340
components : rustfmt
@@ -343,17 +345,30 @@ jobs:
343
345
with :
344
346
crate : cargo-edit
345
347
bin : cargo-set-version
346
- - name : Update version if PR
347
- if : ${{ github.event_name == 'pull_request' }}
348
- 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"
349
364
350
365
# Recreate charts and publish charts and docker image. The "-e" is needed as we want to override the
351
366
# default value in the makefile if called from this action, but not otherwise (i.e. when called locally).
352
367
# This is needed for the HELM_REPO variable.
353
368
- name : Install cosign
354
- uses : sigstore/cosign-installer@59acb6260d9c0ba8f4a2f9d9b48431a222b68e20 # v3.5 .0
369
+ uses : sigstore/cosign-installer@4959ce089c160fddf62f7b42464195ba1a56d382 # v3.6 .0
355
370
- name : Install syft
356
- uses : anchore/sbom-action/download-syft@e8d2a6937ecead383dfe75190d104edd1f9c5751 # v0.16.0
371
+ uses : anchore/sbom-action/download-syft@61119d458adab75f756bc0b9e4bde25725f86a7a # v0.17.2
357
372
- name : Build Docker image and Helm chart
358
373
run : |
359
374
# Installing helm and yq on ubicloud-standard-8-arm only
@@ -379,10 +394,11 @@ jobs:
379
394
- id : printtag
380
395
name : Output image name and tag
381
396
if : ${{ !github.event.pull_request.head.repo.fork }}
382
- run : echo "IMAGE_TAG=$(make -e print-docker-tag)" >> $GITHUB_OUTPUT
397
+ run : echo "IMAGE_TAG=$(make -e print-docker-tag)" >> " $GITHUB_OUTPUT"
383
398
384
399
create_manifest_list :
385
400
name : Build and publish manifest list
401
+ if : ${{ !github.event.pull_request.head.repo.fork }}
386
402
needs :
387
403
- package_and_publish
388
404
runs-on : ubuntu-latest
@@ -396,7 +412,7 @@ jobs:
396
412
OCI_REGISTRY_SDP_CHARTS_USERNAME : " robot$sdp-charts+github-action-build"
397
413
steps :
398
414
- name : Install cosign
399
- uses : sigstore/cosign-installer@59acb6260d9c0ba8f4a2f9d9b48431a222b68e20 # v3.5 .0
415
+ uses : sigstore/cosign-installer@4959ce089c160fddf62f7b42464195ba1a56d382 # v3.6 .0
400
416
- name : Checkout
401
417
uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
402
418
with :
@@ -408,9 +424,22 @@ jobs:
408
424
with :
409
425
crate : cargo-edit
410
426
bin : cargo-set-version
411
- - name : Update version if PR
412
- if : ${{ github.event_name == 'pull_request' }}
413
- 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"
414
443
- name : Build manifest list
415
444
run : |
416
445
# Creating manifest list
@@ -430,11 +459,11 @@ jobs:
430
459
steps :
431
460
- name : Install preflight
432
461
run : |
433
- wget https://github.com/redhat-openshift-ecosystem/openshift-preflight/releases/download/1.9.4 /preflight-linux-amd64
462
+ wget https://github.com/redhat-openshift-ecosystem/openshift-preflight/releases/download/1.10.0 /preflight-linux-amd64
434
463
chmod +x preflight-linux-amd64
435
464
- name : Check container
436
465
run : |
437
466
ARCH_FOR_PREFLIGHT="$(arch | sed -e 's#x86_64#amd64#' | sed -e 's#aarch64#arm64#')"
438
467
./preflight-linux-amd64 check container "$IMAGE_TAG" --platform "${ARCH_FOR_PREFLIGHT}" > preflight.out
439
468
- name : " Passed?"
440
- run : ' [ "$(cat preflight.out | jq -r .passed)" == true ]'
469
+ run : ' [ "$(jq -r .passed < preflight.out )" == true ]'
0 commit comments