Skip to content

Commit b30886a

Browse files
committed
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 90167f3 commit b30886a

File tree

8 files changed

+273
-358
lines changed

8 files changed

+273
-358
lines changed

.github/workflows/build.yaml

Lines changed: 261 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,261 @@
1+
# =============
2+
# This file is automatically generated from the templates in stackabletech/operator-templating
3+
# DON'T MANUALLY EDIT THIS FILE
4+
# =============
5+
---
6+
name: Build hbase-operator Artifacts
7+
8+
permissions: {}
9+
10+
on:
11+
push:
12+
branches:
13+
- main
14+
tags:
15+
- '[0-9][0-9].[0-9]+.[0-9]+-rc[0-9]+'
16+
- '[0-9][0-9].[0-9]+.[0-9]+'
17+
schedule:
18+
# Run every Saturday morning: https://crontab.guru/#15_3_*_*_6
19+
- cron: '15 3 * * 6'
20+
pull_request:
21+
paths:
22+
- '.github/workflows/build.yaml'
23+
- 'rust-toolchain.toml'
24+
- '.dockerignore'
25+
- 'deploy/**'
26+
- '.cargo/**'
27+
- 'docker/**'
28+
- 'Cargo.*'
29+
- '*.rs'
30+
31+
env:
32+
OPERATOR_NAME: "hbase-operator"
33+
RUST_NIGHTLY_TOOLCHAIN_VERSION: "nightly-2025-10-23"
34+
NIX_PKG_MANAGER_VERSION: "2.30.0"
35+
RUST_TOOLCHAIN_VERSION: "1.89.0"
36+
HADOLINT_VERSION: "v2.14.0"
37+
PYTHON_VERSION: "3.14"
38+
CARGO_TERM_COLOR: always
39+
40+
jobs:
41+
cargo-udeps:
42+
name: Run cargo-udeps
43+
runs-on: ubuntu-latest
44+
env:
45+
RUSTC_BOOTSTRAP: 1
46+
steps:
47+
- name: Install host dependencies
48+
uses: awalsh128/cache-apt-pkgs-action@2c09a5e66da6c8016428a2172bd76e5e4f14bb17 # v1.5.3
49+
with:
50+
packages: protobuf-compiler krb5-user libkrb5-dev libclang-dev liblzma-dev libssl-dev pkg-config apt-transport-https
51+
version: ubuntu-latest
52+
53+
- name: Checkout Repository
54+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
55+
with:
56+
persist-credentials: false
57+
submodules: recursive
58+
59+
- name: Install Rust ${{ env.RUST_TOOLCHAIN_VERSION }} toolchain
60+
uses: dtolnay/rust-toolchain@b3b07ba8b418998c39fb20f53e8b695cdcc8de1b
61+
with:
62+
toolchain: ${{ env.RUST_TOOLCHAIN_VERSION }}
63+
64+
- name: Setup Rust Cache
65+
uses: Swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 # v2.8.0
66+
with:
67+
cache-all-crates: "true"
68+
key: udeps
69+
70+
- name: Install cargo-udeps
71+
uses: stackabletech/cargo-install-action@8f7dbbcd2ebe22717efc132d0dd61e80841994b9 # cargo-udeps
72+
73+
- name: Run cargo-udeps
74+
run: cargo udeps --workspace --all-targets
75+
76+
build-container-image:
77+
name: Build/Publish ${{ matrix.runner.arch }} Image
78+
permissions:
79+
id-token: write
80+
strategy:
81+
fail-fast: false
82+
matrix:
83+
runner:
84+
- { name: "ubuntu-latest", arch: "amd64" }
85+
- { name: "ubicloud-standard-8-arm", arch: "arm64" }
86+
runs-on: ${{ matrix.runner.name }}
87+
outputs:
88+
operator-version: ${{ steps.version.outputs.OPERATOR_VERSION }}
89+
steps:
90+
- name: Install host dependencies
91+
uses: awalsh128/cache-apt-pkgs-action@2c09a5e66da6c8016428a2172bd76e5e4f14bb17 # v1.5.3
92+
with:
93+
packages: protobuf-compiler krb5-user libkrb5-dev libclang-dev liblzma-dev libssl-dev pkg-config apt-transport-https
94+
version: ${{ matrix.runner.name }}
95+
96+
- name: Checkout Repository
97+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
98+
with:
99+
persist-credentials: false
100+
submodules: recursive
101+
102+
- name: Update/Extract Operator Version
103+
id: version
104+
env:
105+
PR_BASE_REF: ${{ github.event.pull_request.base.ref }}
106+
PR_NUMBER: ${{ github.event.pull_request.number }}
107+
GITHUB_EVENT_NAME: ${{ github.event_name }}
108+
GITHUB_DEBUG: ${{ runner.debug }}
109+
shell: bash
110+
run: |
111+
set -euo pipefail
112+
[ -n "$GITHUB_DEBUG" ] && set -x
113+
114+
CURRENT_VERSION=$(cargo metadata --format-version 1 --no-deps | jq -r '.packages[0].version')
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
123+
else
124+
# Just use the current version if this workflow is run on push, schedule, etc...
125+
NEW_VERSION="$CURRENT_VERSION"
126+
fi
127+
128+
sed -i "s/version = \"${CURRENT_VERSION}\"/version = \"${NEW_VERSION}\"/" Cargo.toml
129+
echo "OPERATOR_VERSION=$NEW_VERSION" | tee -a "$GITHUB_OUTPUT"
130+
131+
- name: Install Nix
132+
uses: cachix/install-nix-action@fc6e360bedc9ee72d75e701397f0bb30dce77568 # v31.5.2
133+
134+
- name: Install Rust ${{ env.RUST_TOOLCHAIN_VERSION }} Toolchain
135+
uses: dtolnay/rust-toolchain@b3b07ba8b418998c39fb20f53e8b695cdcc8de1b
136+
with:
137+
toolchain: ${{ env.RUST_TOOLCHAIN_VERSION }}
138+
139+
- name: Build Container Image
140+
id: build
141+
uses: stackabletech/actions/build-container-image@29bea1b451c0c2e994bd495969286f95bf49ed6a # v0.11.0
142+
with:
143+
image-name: ${{ env.OPERATOR_NAME }}
144+
image-index-manifest-tag: ${{ steps.version.outputs.OPERATOR_VERSION }}
145+
build-arguments: VERSION=${{ steps.version.outputs.OPERATOR_VERSION }}
146+
container-file: docker/Dockerfile
147+
148+
- name: Publish Container Image
149+
uses: stackabletech/actions/publish-image@29bea1b451c0c2e994bd495969286f95bf49ed6a # v0.11.0
150+
with:
151+
image-registry-uri: oci.stackable.tech
152+
image-registry-username: robot$sdp+github-action-build
153+
image-registry-password: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }}
154+
image-repository: sdp/${{ env.OPERATOR_NAME }}
155+
image-manifest-tag: ${{ steps.build.outputs.image-manifest-tag }}
156+
source-image-uri: ${{ steps.build.outputs.image-manifest-uri }}
157+
158+
publish-index-manifest:
159+
name: Publish/Sign ${{ needs.build-container-image.outputs.operator-version }} Index
160+
needs:
161+
- build-container-image
162+
permissions:
163+
id-token: write
164+
runs-on: ubuntu-latest
165+
steps:
166+
- name: Checkout Repository
167+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
168+
with:
169+
persist-credentials: false
170+
171+
- name: Publish and Sign Image Index
172+
uses: stackabletech/actions/publish-image-index-manifest@29bea1b451c0c2e994bd495969286f95bf49ed6a # v0.11.0
173+
with:
174+
image-registry-uri: oci.stackable.tech
175+
image-registry-username: robot$sdp+github-action-build
176+
image-registry-password: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }}
177+
image-repository: sdp/${{ env.OPERATOR_NAME }}
178+
image-index-manifest-tag: ${{ needs.build-container-image.outputs.operator-version }}
179+
180+
publish-helm-chart:
181+
name: Package/Publish ${{ needs.build-container-image.outputs.operator-version }} Helm Chart
182+
needs:
183+
- build-container-image
184+
permissions:
185+
id-token: write
186+
runs-on: ubuntu-latest
187+
steps:
188+
- name: Checkout Repository
189+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
190+
with:
191+
persist-credentials: false
192+
submodules: recursive
193+
194+
- name: Package, Publish, and Sign Helm Chart
195+
uses: stackabletech/actions/publish-helm-chart@29bea1b451c0c2e994bd495969286f95bf49ed6a # v0.11.0
196+
with:
197+
chart-registry-uri: oci.stackable.tech
198+
chart-registry-username: robot$sdp-charts+github-action-build
199+
chart-registry-password: ${{ secrets.HARBOR_ROBOT_SDP_CHARTS_GITHUB_ACTION_BUILD_SECRET }}
200+
chart-repository: sdp-charts
201+
chart-directory: deploy/helm/${{ env.OPERATOR_NAME }}
202+
chart-version: ${{ needs.build-container-image.outputs.operator-version }}
203+
app-version: ${{ needs.build-container-image.outputs.operator-version }}
204+
205+
openshift-preflight-check:
206+
name: Run OpenShift Preflight Check for ${{ needs.build-container-image.outputs.operator-version }}-${{ matrix.arch }}
207+
needs:
208+
- build-container-image
209+
- publish-index-manifest
210+
strategy:
211+
fail-fast: false
212+
matrix:
213+
arch:
214+
- amd64
215+
- arm64
216+
runs-on: ubuntu-latest
217+
steps:
218+
- name: Run OpenShift Preflight Check
219+
uses: stackabletech/actions/run-openshift-preflight@29bea1b451c0c2e994bd495969286f95bf49ed6a # v0.11.0
220+
with:
221+
image-index-uri: oci.stackable.tech/sdp/${{ env.OPERATOR_NAME }}:${{ needs.build-container-image.outputs.operator-version }}
222+
image-architecture: ${{ matrix.arch }}
223+
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+
239+
notify:
240+
name: Failure Notification
241+
needs:
242+
- build-container-image
243+
- publish-index-manifest
244+
- publish-helm-chart
245+
runs-on: ubuntu-latest
246+
if: failure() || github.run_attempt > 1
247+
steps:
248+
- name: Checkout Repository
249+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
250+
with:
251+
persist-credentials: false
252+
253+
- name: Send Notification
254+
uses: stackabletech/actions/send-slack-notification@29bea1b451c0c2e994bd495969286f95bf49ed6a # v0.11.0
255+
with:
256+
publish-helm-chart-result: ${{ needs.publish-helm-chart.result }}
257+
publish-manifests-result: ${{ needs.publish-index-manifest.result }}
258+
build-result: ${{ needs.build-container-image.result }}
259+
slack-token: ${{ secrets.SLACK_CONTAINER_IMAGE_TOKEN }}
260+
channel-id: C07UG6JH44F # notifications-container-images
261+
type: container-image-build

0 commit comments

Comments
 (0)