62
62
# we specify bash to get pipefail; it guards against the `curl` command
63
63
# failing. otherwise `sh` won't catch that `curl` returned non-0
64
64
shell : bash
65
- run : " curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.13.3 /cargo-dist-installer.sh | sh"
65
+ run : " curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.14.1 /cargo-dist-installer.sh | sh"
66
66
# sure would be cool if github gave us proper conditionals...
67
67
# so here's a doubly-nested ternary-via-truthiness to try to provide the best possible
68
68
# functionality based on whether this is a pull_request, and whether it's from a fork.
@@ -167,7 +167,7 @@ jobs:
167
167
submodules : recursive
168
168
- name : Install cargo-dist
169
169
shell : bash
170
- run : " curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.13.3 /cargo-dist-installer.sh | sh"
170
+ run : " curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.14.1 /cargo-dist-installer.sh | sh"
171
171
# Get all the local artifacts for the global tasks to use (for e.g. checksums)
172
172
- name : Fetch local artifacts
173
173
uses : actions/download-artifact@v4
@@ -212,7 +212,7 @@ jobs:
212
212
with :
213
213
submodules : recursive
214
214
- name : Install cargo-dist
215
- run : " curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.13.3 /cargo-dist-installer.sh | sh"
215
+ run : " curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.14.1 /cargo-dist-installer.sh | sh"
216
216
# Fetch artifacts from scratch-storage
217
217
- name : Fetch artifacts
218
218
uses : actions/download-artifact@v4
@@ -252,7 +252,7 @@ jobs:
252
252
repository : " aiken-lang/homebrew-tap"
253
253
token : ${{ secrets.HOMEBREW_TAP_TOKEN }}
254
254
# So we have access to the formula
255
- - name : Fetch local artifacts
255
+ - name : Fetch homebrew formulae
256
256
uses : actions/download-artifact@v4
257
257
with :
258
258
pattern : artifacts-*
@@ -275,16 +275,45 @@ jobs:
275
275
done
276
276
git push
277
277
278
+ publish-npm :
279
+ needs :
280
+ - plan
281
+ - host
282
+ runs-on : " ubuntu-20.04"
283
+ env :
284
+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
285
+ PLAN : ${{ needs.plan.outputs.val }}
286
+ if : ${{ !fromJson(needs.plan.outputs.val).announcement_is_prerelease || fromJson(needs.plan.outputs.val).publish_prereleases }}
287
+ steps :
288
+ - name : Fetch npm packages
289
+ uses : actions/download-artifact@v4
290
+ with :
291
+ pattern : artifacts-*
292
+ path : npm/
293
+ merge-multiple : true
294
+ - uses : actions/setup-node@v4
295
+ with :
296
+ node-version : ' 20.x'
297
+ registry-url : ' https://registry.npmjs.org'
298
+ - run : |
299
+ for release in $(echo "$PLAN" | jq --compact-output '.releases[] | select([.artifacts[] | endswith("-npm-package.tar.gz")] | any)'); do
300
+ pkg=$(echo "$release" | jq '.artifacts[] | select(endswith("-npm-package.tar.gz"))' --raw-output)
301
+ npm publish --access public "./npm/${pkg}"
302
+ done
303
+ env:
304
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
305
+
278
306
# Create a GitHub Release while uploading all files to it
279
307
announce :
280
308
needs :
281
309
- plan
282
310
- host
283
311
- publish-homebrew-formula
312
+ - publish-npm
284
313
# use "always() && ..." to allow us to wait for all publish jobs while
285
314
# still allowing individual publish jobs to skip themselves (for prereleases).
286
315
# "host" however must run to completion, no skipping allowed!
287
- if : ${{ always() && needs.host.result == 'success' && (needs.publish-homebrew-formula.result == 'skipped' || needs.publish-homebrew-formula.result == 'success') }}
316
+ if : ${{ always() && needs.host.result == 'success' && (needs.publish-homebrew-formula.result == 'skipped' || needs.publish-homebrew-formula.result == 'success') && (needs.publish-npm.result == 'skipped' || needs.publish-npm.result == 'success') }}
288
317
runs-on : " ubuntu-20.04"
289
318
env :
290
319
GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments