diff --git a/.github/workflows/release-packages.yml b/.github/workflows/release-packages.yml index c20a7062..63e59f21 100644 --- a/.github/workflows/release-packages.yml +++ b/.github/workflows/release-packages.yml @@ -62,20 +62,6 @@ jobs: pnpm --filter "./$dir" run build done - - name: Publish to npm - run: | - set -euo pipefail - IFS=',' read -ra TARGETS <<< "${{ steps.pkgs.outputs.list }}" - for dir in "${TARGETS[@]}"; do - if [ -f "$dir/package.json" ]; then - echo "Publishing $dir to npm…" - cd "$dir" - [ -d dist ] || pnpm run build - PUBLISH_OUTPUT=$(npm publish --access public 2>&1); PUBLISH_EXIT=$?; if [ $PUBLISH_EXIT -ne 0 ]; then echo "npm publish failed for $dir (exit code: $PUBLISH_EXIT)"; echo "$PUBLISH_OUTPUT"; fi - cd - >/dev/null - fi - done - - name: Sync jsr.json version from package.json run: | IFS=',' read -ra TARGETS <<< "${{ steps.pkgs.outputs.list }}" @@ -103,3 +89,25 @@ jobs: cd - >/dev/null fi done + + - name: Replace exports entry in package.json + run: | + tmp=$(mktemp) + jq '.exports["."] = "./dist/mod.mjs"' package.json > "$tmp" \ + && mv "$tmp" package.json + + - name: Publish to npm + run: | + set -euo pipefail + IFS=',' read -ra TARGETS <<< "${{ steps.pkgs.outputs.list }}" + for dir in "${TARGETS[@]}"; do + if [ -f "$dir/package.json" ]; then + echo "Publishing $dir to npm…" + cd "$dir" + [ -d dist ] || pnpm run build + npm publish --access public || echo "npm publish failed for $dir" + cd - >/dev/null + fi + done + + diff --git a/.github/workflows/release-web.yml b/.github/workflows/release-web.yml index 277f6d84..45f061f1 100644 --- a/.github/workflows/release-web.yml +++ b/.github/workflows/release-web.yml @@ -10,7 +10,7 @@ on: required: false default: "" tag_name: - description: "Tag to use for artifacts/images (defaults to adhoc-)" + description: "Tag to use for artifacts/images (defaults to )" required: false default: "" attach_to_release: