1515
1616name : Release
1717permissions :
18- " attestations " : " write"
1918 " contents " : " write"
20- " id-token " : " write"
2119
2220# This task will run whenever you push a git tag that looks like a version
2321# like "1.0.0", "v0.1.0-prerelease.1", "my-app/0.1.0", "releases/v1.0.0", etc.
@@ -58,16 +56,17 @@ jobs:
5856 env :
5957 GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
6058 steps :
61- - uses : actions/checkout@v4
59+ - uses : actions/checkout@v6
6260 with :
61+ persist-credentials : false
6362 submodules : recursive
6463 - name : Install dist
6564 # we specify bash to get pipefail; it guards against the `curl` command
6665 # failing. otherwise `sh` won't catch that `curl` returned non-0
6766 shell : bash
68- run : " curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.30.3 /cargo-dist-installer.sh | sh"
67+ run : " curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.30.4 /cargo-dist-installer.sh | sh"
6968 - name : Cache dist
70- uses : actions/upload-artifact@v4
69+ uses : actions/upload-artifact@v6
7170 with :
7271 name : cargo-dist-cache
7372 path : ~/.cargo/bin/dist
@@ -83,17 +82,40 @@ jobs:
8382 cat plan-dist-manifest.json
8483 echo "manifest=$(jq -c "." plan-dist-manifest.json)" >> "$GITHUB_OUTPUT"
8584 - name : " Upload dist-manifest.json"
86- uses : actions/upload-artifact@v4
85+ uses : actions/upload-artifact@v6
8786 with :
8887 name : artifacts-plan-dist-manifest
8988 path : plan-dist-manifest.json
9089
90+ # Build the UI once and share across all platform builds
91+ build-ui :
92+ runs-on : " ubuntu-22.04"
93+ steps :
94+ - uses : actions/checkout@v6
95+ with :
96+ persist-credentials : false
97+ - name : Set up Node.js
98+ uses : actions/setup-node@v4
99+ with :
100+ node-version : ' 20'
101+ - name : Install dependencies and build UI
102+ run : |
103+ cd ui
104+ npm install
105+ npm run build
106+ - name : Upload UI build
107+ uses : actions/upload-artifact@v6
108+ with :
109+ name : ui-dist
110+ path : ui/dist/
111+
91112 # Build and packages all the platform-specific things
92113 build-local-artifacts :
93114 name : build-local-artifacts (${{ join(matrix.targets, ', ') }})
94115 # Let the initial task tell us to not run (currently very blunt)
95116 needs :
96117 - plan
118+ - build-ui
97119 if : ${{ fromJson(needs.plan.outputs.val).ci.github.artifacts_matrix.include != null && (needs.plan.outputs.publishing == 'true' || fromJson(needs.plan.outputs.val).ci.github.pr_run_mode == 'upload') }}
98120 strategy :
99121 fail-fast : false
@@ -117,8 +139,9 @@ jobs:
117139 - name : enable windows longpaths
118140 run : |
119141 git config --global core.longpaths true
120- - uses : actions/checkout@v4
142+ - uses : actions/checkout@v6
121143 with :
144+ persist-credentials : false
122145 submodules : recursive
123146 - name : Install Rust non-interactively if not already installed
124147 if : ${{ matrix.container }}
@@ -131,35 +154,24 @@ jobs:
131154 run : ${{ matrix.install_dist.run }}
132155 # Get the dist-manifest
133156 - name : Fetch local artifacts
134- uses : actions/download-artifact@v4
157+ uses : actions/download-artifact@v7
135158 with :
136159 pattern : artifacts-*
137160 path : target/distrib/
138161 merge-multiple : true
139162 - name : Install dependencies
140163 run : |
141164 ${{ matrix.packages_install }}
142- - name : Set up Node.js
143- uses : actions/setup-node@v4
165+ - name : Download pre-built UI
166+ uses : actions/download-artifact@v7
144167 with :
145- node-version : ' 20'
146- - name : Install npm dependencies
147- run : |
148- cd ui
149- npm install
150- - name : Build npm project
151- run : |
152- cd ui
153- npm run build
168+ name : ui-dist
169+ path : ui/dist/
154170 - name : Build artifacts
155171 run : |
156172 # Actually do builds and make zips and whatnot
157173 dist build ${{ needs.plan.outputs.tag-flag }} --print=linkage --output-format=json ${{ matrix.dist_args }} > dist-manifest.json
158174 echo "dist ran successfully"
159- - name : Attest
160- uses : actions/attest-build-provenance@v2
161- with :
162- subject-path : " target/distrib/*${{ join(matrix.targets, ', ') }}*"
163175 - id : cargo-dist
164176 name : Post-build
165177 # We force bash here just because github makes it really hard to get values up
@@ -174,7 +186,7 @@ jobs:
174186
175187 cp dist-manifest.json "$BUILD_MANIFEST_NAME"
176188 - name : " Upload artifacts"
177- uses : actions/upload-artifact@v4
189+ uses : actions/upload-artifact@v6
178190 with :
179191 name : artifacts-build-local-${{ join(matrix.targets, '_') }}
180192 path : |
@@ -191,18 +203,19 @@ jobs:
191203 GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
192204 BUILD_MANIFEST_NAME : target/distrib/global-dist-manifest.json
193205 steps :
194- - uses : actions/checkout@v4
206+ - uses : actions/checkout@v6
195207 with :
208+ persist-credentials : false
196209 submodules : recursive
197210 - name : Install cached dist
198- uses : actions/download-artifact@v4
211+ uses : actions/download-artifact@v7
199212 with :
200213 name : cargo-dist-cache
201214 path : ~/.cargo/bin/
202215 - run : chmod +x ~/.cargo/bin/dist
203216 # Get all the local artifacts for the global tasks to use (for e.g. checksums)
204217 - name : Fetch local artifacts
205- uses : actions/download-artifact@v4
218+ uses : actions/download-artifact@v7
206219 with :
207220 pattern : artifacts-*
208221 path : target/distrib/
@@ -220,7 +233,7 @@ jobs:
220233
221234 cp dist-manifest.json "$BUILD_MANIFEST_NAME"
222235 - name : " Upload artifacts"
223- uses : actions/upload-artifact@v4
236+ uses : actions/upload-artifact@v6
224237 with :
225238 name : artifacts-build-global
226239 path : |
@@ -232,26 +245,27 @@ jobs:
232245 - plan
233246 - build-local-artifacts
234247 - build-global-artifacts
235- # Only run if we're "publishing", and only if local and global didn't fail (skipped is fine)
236- if : ${{ always() && needs.plan.outputs.publishing == 'true' && (needs.build-global-artifacts.result == 'skipped' || needs.build-global-artifacts.result == 'success') && (needs.build-local-artifacts.result == 'skipped' || needs.build-local-artifacts.result == 'success') }}
248+ # Only run if we're "publishing", and only if plan, local and global didn't fail (skipped is fine)
249+ if : ${{ always() && needs.plan.result == 'success' && needs.plan. outputs.publishing == 'true' && (needs.build-global-artifacts.result == 'skipped' || needs.build-global-artifacts.result == 'success') && (needs.build-local-artifacts.result == 'skipped' || needs.build-local-artifacts.result == 'success') }}
237250 env :
238251 GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
239252 runs-on : " ubuntu-22.04"
240253 outputs :
241254 val : ${{ steps.host.outputs.manifest }}
242255 steps :
243- - uses : actions/checkout@v4
256+ - uses : actions/checkout@v6
244257 with :
258+ persist-credentials : false
245259 submodules : recursive
246260 - name : Install cached dist
247- uses : actions/download-artifact@v4
261+ uses : actions/download-artifact@v7
248262 with :
249263 name : cargo-dist-cache
250264 path : ~/.cargo/bin/
251265 - run : chmod +x ~/.cargo/bin/dist
252266 # Fetch artifacts from scratch-storage
253267 - name : Fetch artifacts
254- uses : actions/download-artifact@v4
268+ uses : actions/download-artifact@v7
255269 with :
256270 pattern : artifacts-*
257271 path : target/distrib/
@@ -264,14 +278,14 @@ jobs:
264278 cat dist-manifest.json
265279 echo "manifest=$(jq -c "." dist-manifest.json)" >> "$GITHUB_OUTPUT"
266280 - name : " Upload dist-manifest.json"
267- uses : actions/upload-artifact@v4
281+ uses : actions/upload-artifact@v6
268282 with :
269283 # Overwrite the previous copy
270284 name : artifacts-dist-manifest
271285 path : dist-manifest.json
272286 # Create a GitHub Release while uploading all files to it
273287 - name : " Download GitHub Artifacts"
274- uses : actions/download-artifact@v4
288+ uses : actions/download-artifact@v7
275289 with :
276290 pattern : artifacts-*
277291 path : artifacts
@@ -291,6 +305,7 @@ jobs:
291305 echo "$ANNOUNCEMENT_BODY" > $RUNNER_TEMP/notes.txt
292306
293307 gh release create "${{ needs.plan.outputs.tag }}" --target "$RELEASE_COMMIT" $PRERELEASE_FLAG --title "$ANNOUNCEMENT_TITLE" --notes-file "$RUNNER_TEMP/notes.txt" artifacts/*
308+
294309 announce :
295310 needs :
296311 - plan
@@ -303,6 +318,7 @@ jobs:
303318 env :
304319 GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
305320 steps :
306- - uses : actions/checkout@v4
321+ - uses : actions/checkout@v6
307322 with :
323+ persist-credentials : false
308324 submodules : recursive
0 commit comments