5959 - 'deploy/**'
6060 - '.cargo/**'
6161 - 'docker/**'
62- - 'Cargo.*'
63- - '*.rs'
62+ - '**/Cargo.toml'
63+ - 'Cargo.lock'
64+ - '**/*.rs'
6465 outputs:
6566 detected: ${{ steps.check.outputs.detected }}
6667
7576 RUSTC_BOOTSTRAP: 1
7677 steps:
7778 - name: Install host dependencies
78- uses: awalsh128/cache-apt-pkgs-action@2c09a5e66da6c8016428a2172bd76e5e4f14bb17 # v1.5 .3
79+ uses: awalsh128/cache-apt-pkgs-action@553a35bb8ebd9fcabcb1c9451aa4c98e1b4ca8a9 # v1.6 .3
7980 with:
8081 packages: protobuf-compiler krb5-user libkrb5-dev libclang-dev liblzma-dev libssl-dev pkg-config apt-transport-https
8182 version: ubuntu-latest
@@ -95,17 +96,19 @@ jobs:
9596 with:
9697 cache-all-crates: "true"
9798 key: udeps
98- lookup-only: ${{ github.event_name == 'pull_request' }}
9999
100100 - name: Install cargo-udeps
101- uses: stackabletech/cargo-install-action@8f7dbbcd2ebe22717efc132d0dd61e80841994b9 # cargo-udeps
101+ uses: stackabletech/cargo-install-action@e3e2dcf8d0f0e5bdbc619bf6ee7560dd68152d3c # cargo-udeps
102102
103103 - name: Run cargo-udeps
104104 run: cargo udeps --workspace --all-targets
105105
106106 build-container-image:
107107 name: Build/Publish ${{ matrix.runner.arch }} Image
108- if: (github.event_name != 'merge_group') && needs.detect-changes.outputs.detected == 'true'
108+ if: |
109+ github.repository_owner == 'stackabletech'
110+ && (github.event_name != 'merge_group')
111+ && needs.detect-changes.outputs.detected == 'true'
109112 needs: [detect-changes]
110113 permissions:
111114 contents: read
@@ -120,23 +123,12 @@ jobs:
120123 outputs:
121124 operator-version: ${{ steps.version.outputs.OPERATOR_VERSION }}
122125 steps:
123- # Use cached apt packages on PRs.
124- # For merges to main and releases, bypass the cache and install fresh package to ensure we have the absolute latest versions.
125126 - name: Install host dependencies
126- if: github.event_name == 'pull_request'
127- uses: awalsh128/cache-apt-pkgs-action@2c09a5e66da6c8016428a2172bd76e5e4f14bb17 # v1.5.3
127+ uses: awalsh128/cache-apt-pkgs-action@553a35bb8ebd9fcabcb1c9451aa4c98e1b4ca8a9 # v1.6.3
128128 with:
129129 packages: protobuf-compiler krb5-user libkrb5-dev libclang-dev liblzma-dev libssl-dev pkg-config apt-transport-https
130130 version: ${{ matrix.runner.name }}
131131
132- - name: Install host dependencies (no cache)
133- if: github.event_name != 'pull_request'
134- run: |
135- sudo apt-get update
136- sudo apt-get install -y protobuf-compiler krb5-user libkrb5-dev \
137- libclang-dev liblzma-dev libssl-dev pkg-config apt-transport-https
138-
139-
140132 - name: Checkout Repository
141133 uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
142134 with:
@@ -173,7 +165,7 @@ jobs:
173165 echo "OPERATOR_VERSION=$NEW_VERSION" | tee -a "$GITHUB_OUTPUT"
174166
175167 - name: Install Nix
176- uses: cachix/install-nix-action@fc6e360bedc9ee72d75e701397f0bb30dce77568 # v31.5.2
168+ uses: cachix/install-nix-action@630ae543ea3a38a9a4166f03376c02c50f408342 # v31.11.0
177169
178170 - name: Install Rust ${{ env.RUST_TOOLCHAIN_VERSION }} Toolchain
179171 shell: bash
@@ -213,7 +205,8 @@ jobs:
213205 publish-index-manifest:
214206 name: Publish/Sign ${{ needs.build-container-image.outputs.operator-version }} Index
215207 if: |
216- (github.event_name != 'merge_group')
208+ github.repository_owner == 'stackabletech'
209+ && (github.event_name != 'merge_group')
217210 && needs.detect-changes.outputs.detected == 'true'
218211 && !github.event.pull_request.head.repo.fork
219212 needs:
@@ -259,7 +252,8 @@ jobs:
259252 provenance-oci:
260253 name: Generate Provenance for ${{ needs.build-container-image.outputs.operator-version }} (oci.stackable.tech)
261254 if: |
262- (github.event_name != 'merge_group')
255+ github.repository_owner == 'stackabletech'
256+ && (github.event_name != 'merge_group')
263257 && needs.detect-changes.outputs.detected == 'true'
264258 && !github.event.pull_request.head.repo.fork
265259 needs:
@@ -286,7 +280,8 @@ jobs:
286280 provenance-quay:
287281 name: Generate Provenance for ${{ needs.build-container-image.outputs.operator-version }} (quay.io)
288282 if: |
289- (github.event_name != 'merge_group')
283+ github.repository_owner == 'stackabletech'
284+ && (github.event_name != 'merge_group')
290285 && needs.detect-changes.outputs.detected == 'true'
291286 && !github.event.pull_request.head.repo.fork
292287 needs:
@@ -313,7 +308,8 @@ jobs:
313308 publish-helm-chart:
314309 name: Package/Publish ${{ needs.build-container-image.outputs.operator-version }} Helm Chart
315310 if: |
316- (github.event_name != 'merge_group')
311+ github.repository_owner == 'stackabletech'
312+ && (github.event_name != 'merge_group')
317313 && needs.detect-changes.outputs.detected == 'true'
318314 && !github.event.pull_request.head.repo.fork
319315 needs:
@@ -358,7 +354,8 @@ jobs:
358354 openshift-preflight-check:
359355 name: Run OpenShift Preflight Check for ${{ needs.build-container-image.outputs.operator-version }}-${{ matrix.arch }}
360356 if: |
361- (github.event_name != 'merge_group')
357+ github.repository_owner == 'stackabletech'
358+ && (github.event_name != 'merge_group')
362359 && needs.detect-changes.outputs.detected == 'true'
363360 && !github.event.pull_request.head.repo.fork
364361 needs:
@@ -392,28 +389,45 @@ jobs:
392389 # WARNING: Do not change the name unless you will also be changing the
393390 # Required Checks (in branch protections) in GitHub settings.
394391 name: Finished Build and Publish
392+ if: always()
395393 needs:
394+ - detect-changes
396395 - cargo-udeps
396+ - build-container-image
397+ - publish-index-manifest
397398 - openshift-preflight-check
398399 - publish-helm-chart
400+ - provenance-oci
401+ - provenance-quay
399402 runs-on: ubuntu-latest
400403 steps:
401- - run: echo "We are done here"
404+ - name: Fail if a required job failed or was cancelled
405+ if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}
406+ run: |
407+ echo "One or more required jobs failed or were cancelled."
408+ exit 1
409+
410+ - name: Finished
411+ run: echo "All required jobs succeeded or were intentionally skipped."
402412
403413 notify:
404414 name: Failure Notification
405415 if: |
406- (failure() || github.run_attempt > 1)
416+ !cancelled()
417+ && github.repository_owner == 'stackabletech'
418+ && (contains(needs.*.result, 'failure') || github.run_attempt > 1)
407419 && github.event_name != 'merge_group'
408420 && needs.detect-changes.outputs.detected == 'true'
409421 && !github.event.pull_request.head.repo.fork
410422 needs:
411423 - detect-changes
424+ - cargo-udeps
412425 - build-container-image
413426 - publish-index-manifest
414427 - provenance-oci
415428 - provenance-quay
416429 - publish-helm-chart
430+ - openshift-preflight-check
417431 - finished
418432 runs-on: ubuntu-latest
419433 steps:
0 commit comments