Skip to content

Commit ceb7156

Browse files
authored
ci(release): Add npm pack step for Craft npm publishing (#1250)
## Problem The release failed with: ``` Error: Cannot release to NPM: no packages found! ``` Craft's npm target looks for `.tgz` files (created by `npm pack`) in the artifacts, but the `built-packages` artifact only contained the `dist/` directory contents. ## Solution Add a `pnpm pack` step before uploading the `built-packages` artifact to create the package tarball that Craft expects for npm publishing.
1 parent 201e7cd commit ceb7156

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

.github/workflows/build.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,10 @@ jobs:
121121
curl -sf --retry 3 --retry-all-errors -o /dev/null 'http://localhost:8969/' && echo "Spotlight ran successfully"
122122
kill -2 $SPOTLIGHT_PID
123123
124+
- name: Pack npm package
125+
working-directory: packages/spotlight
126+
run: pnpm pack
127+
124128
- name: Store built packages
125129
uses: actions/upload-artifact@v5
126130
with:
@@ -130,6 +134,13 @@ jobs:
130134
path: |
131135
packages/spotlight/dist/
132136
137+
- name: Store npm package
138+
uses: actions/upload-artifact@v5
139+
with:
140+
name: npm-package
141+
if-no-files-found: error
142+
path: packages/spotlight/*.tgz
143+
133144
- name: Store standalone spotlight binaries
134145
uses: actions/upload-artifact@v5
135146
with:
@@ -416,7 +427,7 @@ jobs:
416427
- name: Download release artifacts
417428
uses: actions/download-artifact@v5
418429
with:
419-
pattern: '{built-packages,spotlight-binaries,electron-binaries}'
430+
pattern: '{npm-package,spotlight-binaries,electron-binaries}'
420431
path: artifacts/
421432
merge-multiple: true
422433

0 commit comments

Comments
 (0)