Skip to content

Commit 80c2d03

Browse files
committed
ci(release): fix release workflow for NAPI packages (#13979)
Fix (hopefully) the release workflow for NAPI packages, after it was broken by #13899.
1 parent 48062d0 commit 80c2d03

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

.github/workflows/reusable_release_napi.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,10 @@ jobs:
134134
with:
135135
if-no-files-found: error
136136
name: bindings-${{ matrix.target }}
137+
# `**/*.node` because in `napi/parser`, binaries are in `src-js` subdirectory
137138
path: |
138-
napi/${{ inputs.name }}/*.node
139-
napi/${{ inputs.name }}/*.wasm
139+
napi/${{ inputs.name }}/**/*.node
140+
napi/${{ inputs.name }}/**/*.wasm
140141
141142
build-freebsd:
142143
needs: check
@@ -183,7 +184,8 @@ jobs:
183184
with:
184185
if-no-files-found: error
185186
name: bindings-freebsd
186-
path: napi/${{ inputs.name }}/*.node
187+
# `**/*.node` because in `napi/parser`, binary is in `src-js` subdirectory
188+
path: napi/${{ inputs.name }}/**/*.node
187189

188190
publish:
189191
name: Publish NAPI
@@ -207,11 +209,15 @@ jobs:
207209
with:
208210
path: artifacts
209211

210-
- run: mkdir -p release-dir
212+
- run: mkdir -p ${npm_dir}
211213

212214
- run: pnpm napi create-npm-dirs --package-json-path ${package_path}/package.json --npm-dir ${npm_dir}
213215

216+
- run: pnpm napi artifacts --package-json-path ${package_path}/package.json --build-output-dir ${package_path}/src-js --npm-dir ${npm_dir}
217+
if: ${{ inputs.name == 'parser' }}
218+
214219
- run: pnpm napi artifacts --package-json-path ${package_path}/package.json --build-output-dir ${package_path} --npm-dir ${npm_dir}
220+
if: ${{ inputs.name != 'parser' }}
215221

216222
- run: pnpm -C ${package_path} build-browser-bundle --npmDir ../../${npm_dir}
217223
if: ${{ inputs.name == 'parser' }}

napi/parser/scripts/build-browser-bundle.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ async function main() {
5454
pkg.files.push('browser-bundle.mjs');
5555
fs.writeFileSync(pkgFile, JSON.stringify(pkg, null, 2));
5656

57-
// copy `browser-bundle.mjs` to `npm-dir/wasm32-wasi`
57+
// copy `browser-bundle.mjs` to `<npmDir>/wasm32-wasi`
5858
fs.cpSync('browser-bundle.mjs', path.join(pkgDir, 'browser-bundle.mjs'));
5959
}
6060
}

0 commit comments

Comments
 (0)