@@ -122,12 +122,17 @@ jobs:
122122 exit 1;
123123 esac
124124
125- echo -e "project-dir=$PROJECT_DIR" >> $GITHUB_OUTPUT
126- echo -e "is-rust-project=$IS_RUST_PROJECT" >> $GITHUB_OUTPUT
127- echo -e "is-js-project=$IS_JS_PROJECT" >> $GITHUB_OUTPUT
128- echo -e "artifacts-glob=$ARTIFACTS_GLOB" >> $GITHUB_OUTPUT
129- echo -e "artifact-name=$ARTIFACT_NAME" >> $GITHUB_OUTPUT
130- echo -e "next-release-tag=${PROJECT}-v${NEXT_VERSION}" >> $GITHUB_OUTPUT
125+ export IS_PRERELEASE=$(node scripts/semver-is-prerelease.mjs $NEXT_VERSION);
126+ echo -e "is-prerelease=$IS_PRERELEASE" >> $GITHUB_OUTPUT;
127+ export PRERELEASE_TAG=$(node scripts/semver-get-prerelease.mjs $NEXT_VERSION);
128+ echo -e "prerelease-tag=$PRERELEASE_TAG" >> $GITHUB_OUTPUT;
129+
130+ echo -e "project-dir=$PROJECT_DIR" >> $GITHUB_OUTPUT;
131+ echo -e "is-rust-project=$IS_RUST_PROJECT" >> $GITHUB_OUTPUT;
132+ echo -e "is-js-project=$IS_JS_PROJECT" >> $GITHUB_OUTPUT;
133+ echo -e "artifacts-glob=$ARTIFACTS_GLOB" >> $GITHUB_OUTPUT;
134+ echo -e "artifact-name=$ARTIFACT_NAME" >> $GITHUB_OUTPUT;
135+ echo -e "next-release-tag=${PROJECT}-v${NEXT_VERSION}" >> $GITHUB_OUTPUT;
131136
132137 pack-crate-release :
133138 if : ${{ needs.meta.outputs.is-rust-project == 'true' }}
@@ -294,6 +299,11 @@ jobs:
294299 - meta
295300 - test-npm-release
296301 steps :
302+ # NOTE: we need to checkout to pull npmrc
303+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
304+ with :
305+ sparse-checkout : |
306+ .npmrc
297307 - uses : actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
298308 with :
299309 path : artifacts
@@ -304,12 +314,18 @@ jobs:
304314 shell : bash
305315 run : |
306316 export PACKAGE_DIR=${{ github.workspace }}/artifacts/${{ needs.meta.outputs.project }}/${{ needs.meta.outputs.artifact-name }}
317+
307318 export OPT_DRY_RUN="--dry-run"
308319 if [ "tag" == "${{ github.ref_type }}" ]; then
309320 export OPT_DRY_RUN="";
310321 fi
311322
312- npm publish $OPT_DRY_RUN $PACKAGE_DIR
323+ export OPT_RELEASE_TAG=""
324+ if [ "true" == "${{ needs.project-meta.outputs.is-prerelease }}" ]; then
325+ export OPT_RELEASE_TAG="--tag ${{ needs.project-meta.outputs.prerelease-tag }}";
326+ fi
327+
328+ npm publish $OPT_DRY_RUN $OPT_RELEASE_TAG $PACKAGE_DIR
313329
314330 create-gh-release :
315331 runs-on : ubuntu-24.04
@@ -341,7 +357,8 @@ jobs:
341357 run : |
342358 git cliff \
343359 --repository=${{ github.workspace }}/.git \
344- --tag=${{ needs.meta.outputs.next-release-tag }} > CHANGELOG.current
360+ --latest \
361+ --tag ${{ needs.meta.outputs.next-release-tag }} > CHANGELOG.current
345362
346363 - uses : actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
347364 with :
0 commit comments