6262 # we specify bash to get pipefail; it guards against the `curl` command
6363 # failing. otherwise `sh` won't catch that `curl` returned non-0
6464 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"
6666 # sure would be cool if github gave us proper conditionals...
6767 # so here's a doubly-nested ternary-via-truthiness to try to provide the best possible
6868 # functionality based on whether this is a pull_request, and whether it's from a fork.
@@ -167,7 +167,7 @@ jobs:
167167 submodules : recursive
168168 - name : Install cargo-dist
169169 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"
171171 # Get all the local artifacts for the global tasks to use (for e.g. checksums)
172172 - name : Fetch local artifacts
173173 uses : actions/download-artifact@v4
@@ -212,7 +212,7 @@ jobs:
212212 with :
213213 submodules : recursive
214214 - 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"
216216 # Fetch artifacts from scratch-storage
217217 - name : Fetch artifacts
218218 uses : actions/download-artifact@v4
@@ -252,7 +252,7 @@ jobs:
252252 repository : " aiken-lang/homebrew-tap"
253253 token : ${{ secrets.HOMEBREW_TAP_TOKEN }}
254254 # So we have access to the formula
255- - name : Fetch local artifacts
255+ - name : Fetch homebrew formulae
256256 uses : actions/download-artifact@v4
257257 with :
258258 pattern : artifacts-*
@@ -275,16 +275,45 @@ jobs:
275275 done
276276 git push
277277
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+
278306 # Create a GitHub Release while uploading all files to it
279307 announce :
280308 needs :
281309 - plan
282310 - host
283311 - publish-homebrew-formula
312+ - publish-npm
284313 # use "always() && ..." to allow us to wait for all publish jobs while
285314 # still allowing individual publish jobs to skip themselves (for prereleases).
286315 # "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') }}
288317 runs-on : " ubuntu-20.04"
289318 env :
290319 GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments