Skip to content

Commit 9aba7f3

Browse files
committed
Gate CLI macOS signing on vars.ENABLE_MACOS_SIGNING
Signed-off-by: Dom Del Nano <ddelnano@gmail.com>
1 parent 04d5def commit 9aba7f3

2 files changed

Lines changed: 27 additions & 2 deletions

File tree

.github/workflows/cli_release.yaml

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ jobs:
2424
image: ${{ needs.get-dev-image.outputs.image-with-tag }}
2525
env:
2626
ARTIFACT_UPLOAD_LOG: "artifact_uploads.json"
27+
# When macOS signing is enabled, push-signed-artifacts owns the manifest update.
28+
MANIFEST_UPDATES: ${{ vars.ENABLE_MACOS_SIGNING == 'true' && '' || 'manifest_updates.json' }}
2729
steps:
2830
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2931
with:
@@ -79,8 +81,14 @@ jobs:
7981
with:
8082
name: artifact-upload-log
8183
path: ${{ env.ARTIFACT_UPLOAD_LOG }}
84+
- if: vars.ENABLE_MACOS_SIGNING != 'true'
85+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
86+
with:
87+
name: manifest-updates
88+
path: manifest_updates.json
8289
sign-release:
8390
name: Sign Release for MacOS
91+
if: vars.ENABLE_MACOS_SIGNING == 'true'
8492
runs-on: macos-latest
8593
needs: build-release
8694
steps:
@@ -115,6 +123,7 @@ jobs:
115123
path: artifacts/
116124
push-signed-artifacts:
117125
name: Push Signed Artifacts for MacOS
126+
if: vars.ENABLE_MACOS_SIGNING == 'true'
118127
runs-on: ubuntu-latest
119128
needs: [get-dev-image, sign-release]
120129
container:
@@ -162,7 +171,11 @@ jobs:
162171
create-github-release:
163172
name: Create Release on Github
164173
runs-on: ubuntu-latest
165-
needs: push-signed-artifacts
174+
needs: [build-release, push-signed-artifacts]
175+
if: |
176+
always() &&
177+
needs.build-release.result == 'success' &&
178+
(needs.push-signed-artifacts.result == 'success' || needs.push-signed-artifacts.result == 'skipped')
166179
permissions:
167180
contents: write
168181
steps:
@@ -187,8 +200,15 @@ jobs:
187200
gh release create "${TAG_NAME}" "${prerelease[@]}" \
188201
--title "CLI ${TAG_NAME#release/cli/}" \
189202
--notes $'Pixie CLI Release:\n'"${changelog}"
190-
gh release upload "${TAG_NAME}" linux-artifacts/* macos-artifacts/*
203+
shopt -s nullglob
204+
upload_paths=(linux-artifacts/*)
205+
if [[ -d macos-artifacts ]]; then
206+
upload_paths+=(macos-artifacts/*)
207+
fi
208+
gh release upload "${TAG_NAME}" "${upload_paths[@]}"
191209
update-gh-artifacts-manifest:
210+
if: |
211+
always() && needs.create-github-release.result == 'success'
192212
runs-on: oracle-8cpu-32gb-x86-64
193213
needs: [get-dev-image, create-github-release]
194214
container:

ci/cli_build_release.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,3 +95,8 @@ upload_artifacts "${release_tag}"
9595
if [[ ! $release_tag == *"-"* ]]; then
9696
upload_artifacts "latest"
9797
fi
98+
99+
# Create manifest update for downstream jobs.
100+
if [[ -n "${MANIFEST_UPDATES:-}" ]]; then
101+
create_manifest_update "cli" "${release_tag}" > "${MANIFEST_UPDATES}"
102+
fi

0 commit comments

Comments
 (0)