Skip to content

Commit 2cf167f

Browse files
committed
re-generate release.yml
1 parent 34515b2 commit 2cf167f

File tree

2 files changed

+31
-1
lines changed

2 files changed

+31
-1
lines changed

.github/workflows/release.yml

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,14 +266,43 @@ jobs:
266266
267267
gh release create "${{ needs.plan.outputs.tag }}" --target "$RELEASE_COMMIT" $PRERELEASE_FLAG --title "$ANNOUNCEMENT_TITLE" --notes-file "$RUNNER_TEMP/notes.txt" artifacts/*
268268
269+
publish-npm:
270+
needs:
271+
- plan
272+
- host
273+
runs-on: "ubuntu-20.04"
274+
env:
275+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
276+
PLAN: ${{ needs.plan.outputs.val }}
277+
if: ${{ !fromJson(needs.plan.outputs.val).announcement_is_prerelease || fromJson(needs.plan.outputs.val).publish_prereleases }}
278+
steps:
279+
- name: Fetch npm packages
280+
uses: actions/download-artifact@v4
281+
with:
282+
pattern: artifacts-*
283+
path: npm/
284+
merge-multiple: true
285+
- uses: actions/setup-node@v4
286+
with:
287+
node-version: '20.x'
288+
registry-url: 'https://registry.npmjs.org'
289+
- run: |
290+
for release in $(echo "$PLAN" | jq --compact-output '.releases[] | select([.artifacts[] | endswith("-npm-package.tar.gz")] | any)'); do
291+
pkg=$(echo "$release" | jq '.artifacts[] | select(endswith("-npm-package.tar.gz"))' --raw-output)
292+
npm publish --access public "./npm/${pkg}"
293+
done
294+
env:
295+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
296+
269297
announce:
270298
needs:
271299
- plan
272300
- host
301+
- publish-npm
273302
# use "always() && ..." to allow us to wait for all publish jobs while
274303
# still allowing individual publish jobs to skip themselves (for prereleases).
275304
# "host" however must run to completion, no skipping allowed!
276-
if: ${{ always() && needs.host.result == 'success' }}
305+
if: ${{ always() && needs.host.result == 'success' && (needs.publish-npm.result == 'skipped' || needs.publish-npm.result == 'success') }}
277306
runs-on: "ubuntu-20.04"
278307
env:
279308
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

dist-workspace.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ ci = "github"
1111
installers = ["shell", "npm"]
1212
# Target platforms to build apps for (Rust target-triple syntax)
1313
targets = ["aarch64-apple-darwin", "x86_64-apple-darwin", "x86_64-unknown-linux-gnu", "x86_64-pc-windows-msvc"]
14+
# Publish jobs to run in CI
1415
publish-jobs = ["npm"]
1516
# A namespace to use when publishing this package to the npm registry
1617
npm-scope = "@untitaker"

0 commit comments

Comments
 (0)