Skip to content

Commit 653b707

Browse files
committed
chore: Generated commit to update templated files since the last template run up to stackabletech/operator-templating@e2b1da5
Reference-to: stackabletech/operator-templating@e2b1da5 (Fix operator version extraction)
1 parent 90167f3 commit 653b707

File tree

8 files changed

+260
-358
lines changed

8 files changed

+260
-358
lines changed

.github/workflows/build.yaml

Lines changed: 248 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,248 @@
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+
needs:
79+
- cargo-udeps
80+
permissions:
81+
id-token: write
82+
strategy:
83+
fail-fast: false
84+
matrix:
85+
runner:
86+
- { name: "ubuntu-latest", arch: "amd64" }
87+
- { name: "ubicloud-standard-8-arm", arch: "arm64" }
88+
runs-on: ${{ matrix.runner.name }}
89+
outputs:
90+
operator-version: ${{ steps.version.outputs.OPERATOR_VERSION }}
91+
steps:
92+
- name: Install host dependencies
93+
uses: awalsh128/cache-apt-pkgs-action@2c09a5e66da6c8016428a2172bd76e5e4f14bb17 # v1.5.3
94+
with:
95+
packages: protobuf-compiler krb5-user libkrb5-dev libclang-dev liblzma-dev libssl-dev pkg-config apt-transport-https
96+
version: ${{ matrix.runner.name }}
97+
98+
- name: Checkout Repository
99+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
100+
with:
101+
persist-credentials: false
102+
submodules: recursive
103+
104+
- name: Update/Extract Operator Version
105+
id: version
106+
env:
107+
PR_BASE_REF: ${{ github.event.pull_request.base.ref }}
108+
PR_NUMBER: ${{ github.event.pull_request.number }}
109+
GITHUB_EVENT_NAME: ${{ github.event_name }}
110+
GITHUB_DEBUG: ${{ runner.debug }}
111+
shell: bash
112+
run: |
113+
set -euo pipefail
114+
[ -n "$GITHUB_DEBUG" ] && set -x
115+
116+
CURRENT_VERSION=$(cargo metadata --format-version 1 --no-deps | jq -r '.packages[0].version')
117+
118+
if [ "$GITHUB_EVENT_NAME" == 'pull_request' ]; then
119+
# Include a PR suffix if this workflow is triggered by a PR
120+
if [ "$PR_BASE_REF" == 'main' ]; then
121+
NEW_VERSION="0.0.0-pr$PR_NUMBER"
122+
else
123+
NEW_VERSION="$CURRENT_VERSION-pr$PR_NUMBER"
124+
fi
125+
else
126+
# Just use the current version if this workflow is run on push, schedule, etc...
127+
NEW_VERSION="$CURRENT_VERSION"
128+
fi
129+
130+
sed -i "s/version = \"${CURRENT_VERSION}\"/version = \"${NEW_VERSION}\"/" Cargo.toml
131+
echo "OPERATOR_VERSION=$NEW_VERSION" | tee -a "$GITHUB_OUTPUT"
132+
133+
- name: Install Nix
134+
uses: cachix/install-nix-action@fc6e360bedc9ee72d75e701397f0bb30dce77568 # v31.5.2
135+
136+
- name: Install Rust ${{ env.RUST_TOOLCHAIN_VERSION }} Toolchain
137+
uses: dtolnay/rust-toolchain@b3b07ba8b418998c39fb20f53e8b695cdcc8de1b
138+
with:
139+
toolchain: ${{ env.RUST_TOOLCHAIN_VERSION }}
140+
141+
- name: Build Container Image
142+
id: build
143+
uses: stackabletech/actions/build-container-image@29bea1b451c0c2e994bd495969286f95bf49ed6a # v0.11.0
144+
with:
145+
image-name: ${{ env.OPERATOR_NAME }}
146+
image-index-manifest-tag: ${{ steps.version.outputs.OPERATOR_VERSION }}
147+
build-arguments: VERSION=${{ steps.version.outputs.OPERATOR_VERSION }}
148+
container-file: docker/Dockerfile
149+
150+
- name: Publish Container Image
151+
uses: stackabletech/actions/publish-image@29bea1b451c0c2e994bd495969286f95bf49ed6a # v0.11.0
152+
with:
153+
image-registry-uri: oci.stackable.tech
154+
image-registry-username: robot$sdp+github-action-build
155+
image-registry-password: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }}
156+
image-repository: sdp/${{ env.OPERATOR_NAME }}
157+
image-manifest-tag: ${{ steps.build.outputs.image-manifest-tag }}
158+
source-image-uri: ${{ steps.build.outputs.image-manifest-uri }}
159+
160+
publish-index-manifest:
161+
name: Publish/Sign ${{ needs.build-container-image.outputs.operator-version }} Index
162+
needs:
163+
- build-container-image
164+
permissions:
165+
id-token: write
166+
runs-on: ubuntu-latest
167+
steps:
168+
- name: Checkout Repository
169+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
170+
with:
171+
persist-credentials: false
172+
173+
- name: Publish and Sign Image Index
174+
uses: stackabletech/actions/publish-image-index-manifest@29bea1b451c0c2e994bd495969286f95bf49ed6a # v0.11.0
175+
with:
176+
image-registry-uri: oci.stackable.tech
177+
image-registry-username: robot$sdp+github-action-build
178+
image-registry-password: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }}
179+
image-repository: sdp/${{ env.OPERATOR_NAME }}
180+
image-index-manifest-tag: ${{ needs.build-container-image.outputs.operator-version }}
181+
182+
publish-helm-chart:
183+
name: Package/Publish ${{ needs.build-container-image.outputs.operator-version }} Helm Chart
184+
needs:
185+
- build-container-image
186+
permissions:
187+
id-token: write
188+
runs-on: ubuntu-latest
189+
steps:
190+
- name: Checkout Repository
191+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
192+
with:
193+
persist-credentials: false
194+
submodules: recursive
195+
196+
- name: Package, Publish, and Sign Helm Chart
197+
uses: stackabletech/actions/publish-helm-chart@29bea1b451c0c2e994bd495969286f95bf49ed6a # v0.11.0
198+
with:
199+
chart-registry-uri: oci.stackable.tech
200+
chart-registry-username: robot$sdp-charts+github-action-build
201+
chart-registry-password: ${{ secrets.HARBOR_ROBOT_SDP_CHARTS_GITHUB_ACTION_BUILD_SECRET }}
202+
chart-repository: sdp-charts
203+
chart-directory: deploy/helm/${{ env.OPERATOR_NAME }}
204+
chart-version: ${{ needs.build-container-image.outputs.operator-version }}
205+
app-version: ${{ needs.build-container-image.outputs.operator-version }}
206+
207+
openshift-preflight-check:
208+
name: Run OpenShift Preflight Check for ${{ needs.build-container-image.outputs.operator-version }}-${{ matrix.arch }}
209+
needs:
210+
- build-container-image
211+
- publish-index-manifest
212+
strategy:
213+
fail-fast: false
214+
matrix:
215+
arch:
216+
- amd64
217+
- arm64
218+
runs-on: ubuntu-latest
219+
steps:
220+
- name: Run OpenShift Preflight Check
221+
uses: stackabletech/actions/run-openshift-preflight@29bea1b451c0c2e994bd495969286f95bf49ed6a # v0.11.0
222+
with:
223+
image-index-uri: oci.stackable.tech/sdp/${{ env.OPERATOR_NAME }}:${{ needs.build-container-image.outputs.operator-version }}
224+
image-architecture: ${{ matrix.arch }}
225+
226+
notify:
227+
name: Failure Notification
228+
needs:
229+
- build-container-image
230+
- publish-index-manifest
231+
- publish-helm-chart
232+
runs-on: ubuntu-latest
233+
if: failure() || github.run_attempt > 1
234+
steps:
235+
- name: Checkout Repository
236+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
237+
with:
238+
persist-credentials: false
239+
240+
- name: Send Notification
241+
uses: stackabletech/actions/send-slack-notification@29bea1b451c0c2e994bd495969286f95bf49ed6a # v0.11.0
242+
with:
243+
publish-helm-chart-result: ${{ needs.publish-helm-chart.result }}
244+
publish-manifests-result: ${{ needs.publish-index-manifest.result }}
245+
build-result: ${{ needs.build-container-image.result }}
246+
slack-token: ${{ secrets.SLACK_CONTAINER_IMAGE_TOKEN }}
247+
channel-id: C07UG6JH44F # notifications-container-images
248+
type: container-image-build

0 commit comments

Comments
 (0)