Skip to content

Commit c2ae1f4

Browse files
chore: Update templated files (863160b) (#83)
chore: Generated commit to update templated files since the last template run up to stackabletech/operator-templating@863160b Reference-to: stackabletech/operator-templating@863160b (Add final job for GitHub checks)
1 parent 111b776 commit c2ae1f4

File tree

2 files changed

+30
-7
lines changed

2 files changed

+30
-7
lines changed

.github/workflows/build.yaml

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,6 @@ jobs:
7575

7676
build-container-image:
7777
name: Build/Publish ${{ matrix.runner.arch }} Image
78-
needs:
79-
- cargo-udeps
8078
permissions:
8179
id-token: write
8280
strategy:
@@ -103,23 +101,33 @@ jobs:
103101

104102
- name: Update/Extract Operator Version
105103
id: version
106-
if: github.event_name == 'pull_request'
107104
env:
108105
PR_BASE_REF: ${{ github.event.pull_request.base.ref }}
109106
PR_NUMBER: ${{ github.event.pull_request.number }}
107+
GITHUB_EVENT_NAME: ${{ github.event_name }}
110108
GITHUB_DEBUG: ${{ runner.debug }}
111109
shell: bash
112110
run: |
113111
set -euo pipefail
114112
[ -n "$GITHUB_DEBUG" ] && set -x
113+
115114
CURRENT_VERSION=$(cargo metadata --format-version 1 --no-deps | jq -r '.packages[0].version')
116-
if [ "$PR_BASE_REF" == 'main' ]; then
117-
NEW_VERSION="0.0.0-pr$PR_NUMBER"
115+
116+
if [ "$GITHUB_EVENT_NAME" == 'pull_request' ]; then
117+
# Include a PR suffix if this workflow is triggered by a PR
118+
if [ "$PR_BASE_REF" == 'main' ]; then
119+
NEW_VERSION="0.0.0-pr$PR_NUMBER"
120+
else
121+
NEW_VERSION="$CURRENT_VERSION-pr$PR_NUMBER"
122+
fi
118123
else
119-
NEW_VERSION="$CURRENT_VERSION-pr$PR_NUMBER"
124+
# Just use the current version if this workflow is run on push, schedule, etc...
125+
NEW_VERSION="$CURRENT_VERSION"
120126
fi
127+
121128
sed -i "s/version = \"${CURRENT_VERSION}\"/version = \"${NEW_VERSION}\"/" Cargo.toml
122129
echo "OPERATOR_VERSION=$NEW_VERSION" | tee -a "$GITHUB_OUTPUT"
130+
123131
- name: Install Nix
124132
uses: cachix/install-nix-action@fc6e360bedc9ee72d75e701397f0bb30dce77568 # v31.5.2
125133

@@ -213,6 +221,21 @@ jobs:
213221
image-index-uri: oci.stackable.tech/sdp/${{ env.OPERATOR_NAME }}:${{ needs.build-container-image.outputs.operator-version }}
214222
image-architecture: ${{ matrix.arch }}
215223

224+
# This job is a required check in GitHub Settings for this repository.
225+
# It saves us having to list many required jobs, or work around dynamically
226+
# named jobs (since there is no concept of required settings).
227+
finished:
228+
# WARNING: Do not change the name unless you will also be changing the
229+
# Required Checks (in branch protections) in GitHub settings.
230+
name: Finished Build and Publish
231+
needs:
232+
- cargo-udeps
233+
- openshift-preflight-check
234+
- publish-helm-chart
235+
runs-on: ubuntu-latest
236+
steps:
237+
- run: echo "We are done here"
238+
216239
notify:
217240
name: Failure Notification
218241
needs:

renovate.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
"extends": [
44
"local>stackabletech/.github:renovate-config"
55
],
6-
"ignorePaths": [".github/workflows/build.yaml", ".github/workflows/build.yml", ".github/workflows/general_daily_security.yml", ".github/workflows/integration-test.yml", ".github/workflows/pr_pre-commit.yaml"]
6+
"ignorePaths": [".github/workflows/build.yaml", ".github/workflows/general_daily_security.yml", ".github/workflows/integration-test.yml", ".github/workflows/pr_pre-commit.yaml"]
77
}

0 commit comments

Comments
 (0)