File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -341,14 +341,20 @@ jobs:
341341 npm config set provenance true
342342 echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
343343 TAG_NAME="${{ github.event.release.tag_name }}"
344- # Determine npm tag: prerelease versions get "next", stable gets "latest"
345344 if echo "$TAG_NAME" | grep -qE "^v?[0-9]+\.[0-9]+\.[0-9]+$"; then
346- echo "Publishing stable release: $TAG_NAME"
347- npm publish --access public --provenance
345+ NPM_TAG="latest"
348346 else
349- echo "Publishing prerelease: $TAG_NAME"
350- npm publish --tag next --access public --provenance
347+ NPM_TAG="next"
351348 fi
349+ # Publish platform-specific sub-packages first
350+ for dir in npm/*/; do
351+ if [ -f "$dir/package.json" ]; then
352+ echo "Publishing $dir..."
353+ npm publish "$dir" --access public --provenance --tag $NPM_TAG || true
354+ fi
355+ done
356+ # Publish root package
357+ npm publish --access public --provenance --tag $NPM_TAG
352358 env :
353359 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
354360 NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
Original file line number Diff line number Diff line change 6060 "build" : " napi build --platform --release --package domparser_napi --js index.js" ,
6161 "postbuild" : " node scripts/postbuild.js" ,
6262 "build:debug" : " napi build --platform --package domparser_napi --js index.js && node scripts/postbuild.js" ,
63- "prepublishOnly" : " napi prepublish -t npm" ,
63+ "prepublishOnly" : " napi prepublish -t npm --skip-optional-publish " ,
6464 "test" : " node --test" ,
6565 "benchmark" : " node ./benchmark/benchmark.mjs" ,
6666 "prepare" : " husky install"
You can’t perform that action at this time.
0 commit comments