2626 CARGO_TERM_COLOR : always
2727 CARGO_INCREMENTAL : ' 0'
2828 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"
3031 PYTHON_VERSION : " 3.12"
3132 RUSTFLAGS : " -D warnings"
3233 RUSTDOCFLAGS : " -D warnings"
3334 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
3735
3836jobs :
3937 # Identify unused dependencies
@@ -62,47 +60,41 @@ jobs:
6260 - uses : stackabletech/cargo-install-action@cargo-udeps
6361 - run : cargo udeps --workspace --all-targets
6462
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.
6765 #
6866 # The following scenarios are identified:
69- # - all pull requests land in the test repository :
67+ # - all pull requests land are published :
7068 # condition: github.event_name == "pull_request"
71- # repository: test
7269 #
73- # - all tagged releases land in stable :
70+ # - all tagged releases are published :
7471 # condition: github.event_name == 'push' & github.ref.startswith('refs/tags/')
75- # repository: stable
7672 #
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 :
7874 # condition: ( github.event_name == 'push' | github.event_name == 'schedule' | github.event_name == 'workflow_dispatch' ) & github.ref == 'refs/heads/main'
79- # repository: dev
8075 #
8176 # 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
8277 # 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
8580 runs-on : ubuntu-latest
8681 outputs :
87- helm_repository : ${{ steps.selecthelmrepo .outputs.helm_repo }}
82+ skip_helm : ${{ steps.checkhelmpublish .outputs.skip_helm }}
8883 steps :
89- - id : selecthelmrepo
84+ - id : checkhelmpublish
9085 env :
9186 TRIGGER : ${{ github.event_name }}
9287 GITHUB_REF : ${{ github.ref }}
9388 run : |
9489 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"
9791 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"
10093 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"
10395 else
10496 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"
10698 fi
10799
108100 run_cargodeny :
@@ -136,9 +128,11 @@ jobs:
136128 submodules : recursive
137129 - uses : dtolnay/rust-toolchain@c5a29ddb4d9d194e7c84ec8c3fba61b1c31fee8c
138130 with :
139- toolchain : ${{ env.RUST_TOOLCHAIN_VERSION }}
131+ toolchain : ${{ env.RUST_NIGHTLY_TOOLCHAIN_VERSION }}
140132 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
142136
143137 run_clippy :
144138 name : Run Clippy
@@ -314,7 +308,7 @@ jobs:
314308 name : Package Charts, Build Docker Image and publish them - ${{ matrix.runner }}
315309 needs :
316310 - tests_passed
317- - select_helm_repo
311+ - check_helm_publish
318312 strategy :
319313 matrix :
320314 runner : ["ubuntu-latest", "ubicloud-standard-8-arm"]
@@ -323,13 +317,11 @@ jobs:
323317 permissions :
324318 id-token : write
325319 env :
326- NEXUS_PASSWORD : ${{ secrets.NEXUS_PASSWORD }}
327- HELM_REPO : ${{ needs.select_helm_repo.outputs.helm_repository }}
328320 OCI_REGISTRY_SDP_PASSWORD : ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }}
329321 OCI_REGISTRY_SDP_USERNAME : " robot$sdp+github-action-build"
330322 OCI_REGISTRY_SDP_CHARTS_PASSWORD : ${{ secrets.HARBOR_ROBOT_SDP_CHARTS_GITHUB_ACTION_BUILD_SECRET }}
331323 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 '
333325 outputs :
334326 IMAGE_TAG : ${{ steps.printtag.outputs.IMAGE_TAG }}
335327 steps :
@@ -376,9 +368,7 @@ jobs:
376368 PR_VERSION="${MANIFEST_VERSION}-pr${PR_NUMBER}"
377369 sed -i "s/version = \"${MANIFEST_VERSION}\"/version = \"${PR_VERSION}\"/" Cargo.toml
378370
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.
382372 - name : Install cosign
383373 uses : sigstore/cosign-installer@d7d6bc7722e3daa8354c50bcb52f4837da5e9b6a # v3.8.1
384374 - name : Install syft
@@ -394,21 +384,21 @@ jobs:
394384 sudo wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_arm64 -O /usr/bin/yq && sudo chmod +x /usr/bin/yq
395385 fi
396386
397- make -e build
387+ make build
398388 - name : Publish Docker image and Helm chart
399389 if : ${{ !github.event.pull_request.head.repo.fork }}
400390 run : |
401391 # We want to publish helmcharts only once as they have a common name, while still publishing both images with architecture specific tags
402392 if [ "$(uname -m)" = "x86_64" ]; then
403- make -e publish
393+ make publish
404394 else
405- make -e docker-publish
395+ make docker-publish
406396 fi
407397 # Output the name of the published image to the Job output for later use
408398 - id : printtag
409399 name : Output image name and tag
410400 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"
412402
413403 create_manifest_list :
414404 name : Build and publish manifest list
@@ -419,7 +409,6 @@ jobs:
419409 permissions :
420410 id-token : write
421411 env :
422- NEXUS_PASSWORD : ${{ secrets.NEXUS_PASSWORD }}
423412 OCI_REGISTRY_SDP_PASSWORD : ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }}
424413 OCI_REGISTRY_SDP_USERNAME : " robot$sdp+github-action-build"
425414 OCI_REGISTRY_SDP_CHARTS_PASSWORD : ${{ secrets.HARBOR_ROBOT_SDP_CHARTS_GITHUB_ACTION_BUILD_SECRET }}
0 commit comments