@@ -389,7 +389,6 @@ jobs:
389389 permissions :
390390 contents : write
391391 id-token : write
392- if : contains(github.ref, 'main')
393392 needs :
394393 - test-macOS-windows-binding
395394 - test-linux-binding
@@ -416,6 +415,23 @@ jobs:
416415 path : artifacts
417416 - name : Move artifacts
418417 run : pnpm artifacts
418+ - name : Restore entrypoints
419+ run : |
420+ INDEX_JS=$(find artifacts -name "index.js" | head -n 1)
421+ INDEX_D_TS=$(find artifacts -name "index.d.ts" | head -n 1)
422+
423+ if [ -n "$INDEX_JS" ] && [ -n "$INDEX_D_TS" ]; then
424+ echo "Found index.js: $INDEX_JS"
425+ echo "Found index.d.ts: $INDEX_D_TS"
426+
427+ echo "Copying entrypoints to project root"
428+ cp "$INDEX_JS" index.js
429+ cp "$INDEX_D_TS" index.d.ts
430+ else
431+ echo "Error: entrypoints not found in artifacts" >&2
432+ exit 1
433+ fi
434+ shell : bash
419435 - name : Copy fix-python-soname files to Linux packages
420436 run : |
421437 # Find the WASM and JS files from Linux artifacts
@@ -435,14 +451,16 @@ jobs:
435451 fi
436452 done
437453 else
438- echo "Warning: fix-python-soname files not found in artifacts"
454+ echo "Error: fix-python-soname files not found in artifacts" >&2
455+ exit 1
439456 fi
440- - name : List packages
441- run : ls -R ./npm
457+ - name : List project files
458+ run : ls -R .
442459 shell : bash
443460 - name : Update npm
444461 run : npm install -g npm@latest
445462 - name : Publish
463+ if : contains(github.ref, 'main')
446464 env :
447465 GITHUB_TOKEN : ${{ github.token }}
448466 run : |
0 commit comments