@@ -17,10 +17,15 @@ jobs:
1717 name : Build Release
1818 runs-on : oracle-16cpu-64gb-x86-64
1919 needs : get-dev-image
20+ permissions :
21+ contents : read
22+ packages : write
2023 container :
2124 image : ${{ needs.get-dev-image.outputs.image-with-tag }}
2225 env :
2326 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' }}
2429 steps :
2530 - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2631 with :
@@ -42,43 +47,48 @@ jobs:
4247 BUILDBOT_GPG_KEY_B64 : ${{ secrets.BUILDBOT_GPG_KEY_B64 }}
4348 run : |
4449 echo "${BUILDBOT_GPG_KEY_B64}" | base64 --decode | gpg --no-tty --batch --import
45- - id : gcloud-creds
46- uses : ./.github/actions/gcloud_creds
50+ - name : Login to GHCR
51+ uses : docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0
4752 with :
48- SERVICE_ACCOUNT_KEY : ${{ secrets.GH_RELEASE_SA_PEM_B64 }}
53+ registry : ghcr.io
54+ username : ${{ github.actor }}
55+ password : ${{ github.token }}
4956 - name : Build & Push Artifacts
5057 env :
5158 REF : ${{ github.event.ref }}
5259 BUILDBOT_GPG_KEY_ID : ${{ secrets.BUILDBOT_GPG_KEY_ID }}
5360 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
5461 BUILD_NUMBER : ${{ github.run_attempt }}
5562 JOB_NAME : ${{ github.job }}
56- GOOGLE_APPLICATION_CREDENTIALS : ${{ steps.gcloud-creds.outputs.gcloud-creds }}
63+ GH_REPO : ${{ github.repository }}
64+ IMAGE_REPO : ${{ vars.IMAGE_REPO || 'ghcr.io/pixie-io' }}
5765 shell : bash
5866 run : |
5967 export TAG_NAME="${REF#*/tags/}"
6068 mkdir -p "artifacts/"
6169 export ARTIFACTS_DIR="$(realpath artifacts/)"
6270 ./ci/save_version_info.sh
6371 ./ci/cli_build_release.sh
72+ # Despite the name, linux-artifacts also contains the unsigned darwin
73+ # binaries (cli_darwin_{amd64,arm64}_unsigned). sign-release downloads
74+ # this artifact to feed cli_merge_sign.sh.
6475 - name : Upload Github Artifacts
6576 uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
6677 with :
6778 name : linux-artifacts
6879 path : artifacts/
69- - name : Update GCS Manifest
70- env :
71- ARTIFACT_MANIFEST_BUCKET : " pixie-dev-public"
72- # Use the old style versions file instead of the new updates for the gcs manifest.
73- MANIFEST_UPDATES : " "
74- GOOGLE_APPLICATION_CREDENTIALS : ${{ steps.gcloud-creds.outputs.gcloud-creds }}
75- run : ./ci/update_artifact_manifest.sh
7680 - uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
7781 with :
7882 name : artifact-upload-log
7983 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
8089 sign-release :
8190 name : Sign Release for MacOS
91+ if : vars.ENABLE_MACOS_SIGNING == 'true'
8292 runs-on : macos-latest
8393 needs : build-release
8494 steps :
8797 fetch-depth : 0
8898 - name : Add pwd to git safe dir
8999 run : git config --global --add safe.directory `pwd`
100+ - uses : actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
101+ with :
102+ name : linux-artifacts
103+ path : artifacts/
90104 - name : Install gon
91105 run : brew install Bearer/tap/gon
92106 - name : Sign CLI release
@@ -101,7 +115,6 @@ jobs:
101115 export CERT_PATH="pixie.cert"
102116 echo -n "$CERT_BASE64" | base64 --decode -o "$CERT_PATH"
103117 export TAG_NAME="${REF#*/tags/}"
104- mkdir -p "artifacts/"
105118 export ARTIFACTS_DIR="$(pwd)/artifacts"
106119 ./ci/cli_merge_sign.sh
107120 - uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
@@ -110,6 +123,7 @@ jobs:
110123 path : artifacts/
111124 push-signed-artifacts :
112125 name : Push Signed Artifacts for MacOS
126+ if : vars.ENABLE_MACOS_SIGNING == 'true'
113127 runs-on : ubuntu-latest
114128 needs : [get-dev-image, sign-release]
115129 container :
@@ -131,19 +145,15 @@ jobs:
131145 BUILDBOT_GPG_KEY_B64 : ${{ secrets.BUILDBOT_GPG_KEY_B64 }}
132146 run : |
133147 echo "${BUILDBOT_GPG_KEY_B64}" | base64 --decode | gpg --no-tty --batch --import
134- - id : gcloud-creds
135- uses : ./.github/actions/gcloud_creds
136- with :
137- SERVICE_ACCOUNT_KEY : ${{ secrets.GH_RELEASE_SA_PEM_B64 }}
138148 - name : Add pwd to git safe dir
139149 run : |
140150 git config --global --add safe.directory `pwd`
141151 - name : Upload signed CLI
142152 env :
143153 REF : ${{ github.event.ref }}
144154 BUILDBOT_GPG_KEY_ID : ${{ secrets.BUILDBOT_GPG_KEY_ID }}
145- GOOGLE_APPLICATION_CREDENTIALS : ${{ steps.gcloud-creds.outputs.gcloud-creds }}
146155 ARTIFACT_UPLOAD_LOG : " artifact_uploads.json"
156+ GH_REPO : ${{ github.repository }}
147157 shell : bash
148158 run : |
149159 export TAG_NAME="${REF#*/tags/}"
@@ -161,7 +171,11 @@ jobs:
161171 create-github-release :
162172 name : Create Release on Github
163173 runs-on : ubuntu-latest
164- 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')
165179 permissions :
166180 contents : write
167181 steps :
@@ -186,8 +200,15 @@ jobs:
186200 gh release create "${TAG_NAME}" "${prerelease[@]}" \
187201 --title "CLI ${TAG_NAME#release/cli/}" \
188202 --notes $'Pixie CLI Release:\n'"${changelog}"
189- 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[@]}"
190209 update-gh-artifacts-manifest :
210+ if : |
211+ always() && needs.create-github-release.result == 'success'
191212 runs-on : oracle-8cpu-32gb-x86-64
192213 needs : [get-dev-image, create-github-release]
193214 container :
@@ -217,8 +238,8 @@ jobs:
217238 env :
218239 BUILDBOT_GPG_KEY_ID : ${{ secrets.BUILDBOT_GPG_KEY_ID }}
219240 run : |
220- git config --global user.name 'pixie-io-buildbot'
221- git config --global user.email 'build@pixielabs.ai'
241+ git config --global user.name "${{ vars.BUILDBOT_NAME || 'pixie-io-buildbot' }}"
242+ git config --global user.email "${{ vars.BUILDBOT_EMAIL || 'build@pixielabs.ai' }}"
222243 git config --global user.signingkey "${BUILDBOT_GPG_KEY_ID}"
223244 git config --global commit.gpgsign true
224245 - uses : actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
0 commit comments