26
26
CARGO_TERM_COLOR : always
27
27
CARGO_INCREMENTAL : ' 0'
28
28
CARGO_PROFILE_DEV_DEBUG : ' 0'
29
- RUST_TOOLCHAIN_VERSION : " 1.84.1"
29
+ RUST_TOOLCHAIN_VERSION : " 1.85.0"
30
+ RUST_NIGHTLY_TOOLCHAIN_VERSION : " nightly-2025-01-15"
30
31
PYTHON_VERSION : " 3.12"
31
32
RUSTFLAGS : " -D warnings"
32
33
RUSTDOCFLAGS : " -D warnings"
33
34
RUST_LOG : " info"
34
- DEV_REPO_HELM_URL : https://repo.stackable.tech/repository/helm-dev
35
- TEST_REPO_HELM_URL : https://repo.stackable.tech/repository/helm-test
36
- STABLE_REPO_HELM_URL : https://repo.stackable.tech/repository/helm-stable
37
35
38
36
jobs :
39
37
# Identify unused dependencies
@@ -62,47 +60,41 @@ jobs:
62
60
- uses : stackabletech/cargo-install-action@cargo-udeps
63
61
- run : cargo udeps --workspace --all-targets
64
62
65
- # This job evaluates the github environment to determine why this action is running and selects the appropriate
66
- # target repository for published Helm charts based on this.
63
+ # This job evaluates the github environment to determine why this action is running and decides if
64
+ # Helm charts are published based on this.
67
65
#
68
66
# The following scenarios are identified:
69
- # - all pull requests land in the test repository :
67
+ # - all pull requests land are published :
70
68
# condition: github.event_name == "pull_request"
71
- # repository: test
72
69
#
73
- # - all tagged releases land in stable :
70
+ # - all tagged releases are published :
74
71
# condition: github.event_name == 'push' & github.ref.startswith('refs/tags/')
75
- # repository: stable
76
72
#
77
- # - all pushes to main (i.e. PR-merges) and all scheduled/manual workflow runs on main land in dev :
73
+ # - all pushes to main (i.e. PR-merges) and all scheduled/manual workflow runs on main land are published :
78
74
# condition: ( github.event_name == 'push' | github.event_name == 'schedule' | github.event_name == 'workflow_dispatch' ) & github.ref == 'refs/heads/main'
79
- # repository: dev
80
75
#
81
76
# Any other scenarios (e.g. when a branch is created/pushed) will cause the publish step to be skipped, most commonly this is expected to happen for the
82
77
# branches that the GitHub merge queue feature uses internally for which the checks need to run, but we do not want artifacts to be published.
83
- select_helm_repo :
84
- name : Select target helm repository based on action trigger
78
+ check_helm_publish :
79
+ name : Decide if Helm charts are pushed to the helm repository based on action trigger
85
80
runs-on : ubuntu-latest
86
81
outputs :
87
- helm_repository : ${{ steps.selecthelmrepo .outputs.helm_repo }}
82
+ skip_helm : ${{ steps.checkhelmpublish .outputs.skip_helm }}
88
83
steps :
89
- - id : selecthelmrepo
84
+ - id : checkhelmpublish
90
85
env :
91
86
TRIGGER : ${{ github.event_name }}
92
87
GITHUB_REF : ${{ github.ref }}
93
88
run : |
94
89
if [[ "$TRIGGER" == "pull_request" ]]; then
95
- echo "exporting test as target helm repo: ${{ env.TEST_REPO_HELM_URL }}"
96
- echo "helm_repo=${{ env.TEST_REPO_HELM_URL }}" >> "$GITHUB_OUTPUT"
90
+ echo "skip_helm=false" >> "$GITHUB_OUTPUT"
97
91
elif [[ ( "$TRIGGER" == "push" || "$TRIGGER" == "schedule" || "$TRIGGER" == "workflow_dispatch" ) && "$GITHUB_REF" == "refs/heads/main" ]]; then
98
- echo "exporting dev as target helm repo: ${{ env.DEV_REPO_HELM_URL }}"
99
- echo "helm_repo=${{ env.DEV_REPO_HELM_URL }}" >> "$GITHUB_OUTPUT"
92
+ echo "skip_helm=false" >> "$GITHUB_OUTPUT"
100
93
elif [[ "$TRIGGER" == "push" && $GITHUB_REF == refs/tags/* ]]; then
101
- echo "exporting stable as target helm repo: ${{ env.STABLE_REPO_HELM_URL }}"
102
- echo "helm_repo=${{ env.STABLE_REPO_HELM_URL }}" >> "$GITHUB_OUTPUT"
94
+ echo "skip_helm=false" >> "$GITHUB_OUTPUT"
103
95
else
104
96
echo "Unknown trigger and ref combination encountered, skipping publish step: $TRIGGER $GITHUB_REF"
105
- echo "helm_repo=skip " >> "$GITHUB_OUTPUT"
97
+ echo "skip_helm=true " >> "$GITHUB_OUTPUT"
106
98
fi
107
99
108
100
run_cargodeny :
@@ -136,9 +128,11 @@ jobs:
136
128
submodules : recursive
137
129
- uses : dtolnay/rust-toolchain@c5a29ddb4d9d194e7c84ec8c3fba61b1c31fee8c
138
130
with :
139
- toolchain : ${{ env.RUST_TOOLCHAIN_VERSION }}
131
+ toolchain : ${{ env.RUST_NIGHTLY_TOOLCHAIN_VERSION }}
140
132
components : rustfmt
141
- - run : cargo fmt --all -- --check
133
+ - env :
134
+ RUST_TOOLCHAIN_VERSION : ${{ env.RUST_NIGHTLY_TOOLCHAIN_VERSION }}
135
+ run : cargo "+$RUST_TOOLCHAIN_VERSION" fmt --all -- --check
142
136
143
137
run_clippy :
144
138
name : Run Clippy
@@ -314,7 +308,7 @@ jobs:
314
308
name : Package Charts, Build Docker Image and publish them - ${{ matrix.runner }}
315
309
needs :
316
310
- tests_passed
317
- - select_helm_repo
311
+ - check_helm_publish
318
312
strategy :
319
313
matrix :
320
314
runner : ["ubuntu-latest", "ubicloud-standard-8-arm"]
@@ -323,13 +317,11 @@ jobs:
323
317
permissions :
324
318
id-token : write
325
319
env :
326
- NEXUS_PASSWORD : ${{ secrets.NEXUS_PASSWORD }}
327
- HELM_REPO : ${{ needs.select_helm_repo.outputs.helm_repository }}
328
320
OCI_REGISTRY_SDP_PASSWORD : ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }}
329
321
OCI_REGISTRY_SDP_USERNAME : " robot$sdp+github-action-build"
330
322
OCI_REGISTRY_SDP_CHARTS_PASSWORD : ${{ secrets.HARBOR_ROBOT_SDP_CHARTS_GITHUB_ACTION_BUILD_SECRET }}
331
323
OCI_REGISTRY_SDP_CHARTS_USERNAME : " robot$sdp-charts+github-action-build"
332
- if : needs.select_helm_repo .outputs.helm_repository != 'skip '
324
+ if : needs.check_helm_publish .outputs.skip_helm != 'true '
333
325
outputs :
334
326
IMAGE_TAG : ${{ steps.printtag.outputs.IMAGE_TAG }}
335
327
steps :
@@ -376,9 +368,7 @@ jobs:
376
368
PR_VERSION="${MANIFEST_VERSION}-pr${PR_NUMBER}"
377
369
sed -i "s/version = \"${MANIFEST_VERSION}\"/version = \"${PR_VERSION}\"/" Cargo.toml
378
370
379
- # Recreate charts and publish charts and docker image. The "-e" is needed as we want to override the
380
- # default value in the makefile if called from this action, but not otherwise (i.e. when called locally).
381
- # This is needed for the HELM_REPO variable.
371
+ # Recreate charts and publish charts and docker image.
382
372
- name : Install cosign
383
373
uses : sigstore/cosign-installer@d7d6bc7722e3daa8354c50bcb52f4837da5e9b6a # v3.8.1
384
374
- name : Install syft
@@ -394,21 +384,21 @@ jobs:
394
384
sudo wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_arm64 -O /usr/bin/yq && sudo chmod +x /usr/bin/yq
395
385
fi
396
386
397
- make -e build
387
+ make build
398
388
- name : Publish Docker image and Helm chart
399
389
if : ${{ !github.event.pull_request.head.repo.fork }}
400
390
run : |
401
391
# We want to publish helmcharts only once as they have a common name, while still publishing both images with architecture specific tags
402
392
if [ "$(uname -m)" = "x86_64" ]; then
403
- make -e publish
393
+ make publish
404
394
else
405
- make -e docker-publish
395
+ make docker-publish
406
396
fi
407
397
# Output the name of the published image to the Job output for later use
408
398
- id : printtag
409
399
name : Output image name and tag
410
400
if : ${{ !github.event.pull_request.head.repo.fork }}
411
- run : echo "IMAGE_TAG=$(make -e print-docker-tag)" >> "$GITHUB_OUTPUT"
401
+ run : echo "IMAGE_TAG=$(make print-docker-tag)" >> "$GITHUB_OUTPUT"
412
402
413
403
create_manifest_list :
414
404
name : Build and publish manifest list
@@ -419,7 +409,6 @@ jobs:
419
409
permissions :
420
410
id-token : write
421
411
env :
422
- NEXUS_PASSWORD : ${{ secrets.NEXUS_PASSWORD }}
423
412
OCI_REGISTRY_SDP_PASSWORD : ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }}
424
413
OCI_REGISTRY_SDP_USERNAME : " robot$sdp+github-action-build"
425
414
OCI_REGISTRY_SDP_CHARTS_PASSWORD : ${{ secrets.HARBOR_ROBOT_SDP_CHARTS_GITHUB_ACTION_BUILD_SECRET }}
0 commit comments