Skip to content

Commit 1d7f46b

Browse files
committed
chore: update cargo dist
1 parent 87081e9 commit 1d7f46b

File tree

3 files changed

+39
-11
lines changed

3 files changed

+39
-11
lines changed

Diff for: .github/workflows/release.yml

+34-5
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
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 }}

Diff for: Cargo.toml

+5-4
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ lto = "thin"
4141
# Config for 'cargo dist'
4242
[workspace.metadata.dist]
4343
# The preferred cargo-dist version to use in CI (Cargo.toml SemVer syntax)
44-
cargo-dist-version = "0.13.3"
44+
cargo-dist-version = "0.14.1"
4545
# CI backends to support
46-
ci = ["github"]
46+
ci = "github"
4747
# The installers to generate for each app
4848
installers = ["shell", "powershell", "npm", "homebrew", "msi"]
4949
# A GitHub repo to push Homebrew formulas to
@@ -62,9 +62,10 @@ unix-archive = ".tar.gz"
6262
# A namespace to use when publishing this package to the npm registry
6363
npm-scope = "@aiken-lang"
6464
# Publish jobs to run in CI
65-
publish-jobs = ["homebrew"]
65+
publish-jobs = ["homebrew", "npm"]
6666
# Publish jobs to run in CI
6767
pr-run-mode = "plan"
6868
# Whether to install an updater program
6969
install-updater = false
70-
install-path = "~/.aiken/bin/"
70+
# Path that installers should place binaries in
71+
install-path = "~/.aiken/bin"

Diff for: scripts/npm-release.sh

-2
This file was deleted.

0 commit comments

Comments
 (0)