Skip to content

feat: publish pre-packaged NPM package#12

Merged
cdunster merged 2 commits into
mainfrom
fix-nodejs-publish-repacks
Jun 8, 2026
Merged

feat: publish pre-packaged NPM package#12
cdunster merged 2 commits into
mainfrom
fix-nodejs-publish-repacks

Conversation

@cdunster

@cdunster cdunster commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Previously, all the checks passed then the release notes were extracted from the changelog and saved to a temporary file, then the NPM package was packaged which included the temporary release notes file. Then the publish command was performing the checks again as the pre-publish steps which now included the release notes which had blank lines at the beginning and end of the file.

This had a few problems:

  1. The extra blank lines in the release notes should be removed.
  2. The temporary release-notes file should not be packaged as it is not tracked in git.
  3. The published package is potentially different to the package uploaded to the GitHub release.

This PR addresses points 2. and 3. but the blank newlines (1.) are ignored because GitHub doesn't render them in the release notes section anyway and I don't want to over-complicate the awk command.

@cdunster cdunster self-assigned this Jun 8, 2026
@cdunster cdunster requested a review from a team June 8, 2026 10:11
@coderabbitai

coderabbitai Bot commented Jun 8, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@cdunster, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 44 minutes and 38 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 66ec5bff-4937-4d87-82fd-51b173cf8471

📥 Commits

Reviewing files that changed from the base of the PR and between ce4cd65 and 91415b0.

📒 Files selected for processing (1)
  • .github/workflows/nodejs-publish-release.yml

Walkthrough

This PR restructures the npm release workflow in a GitHub Actions job. The npm pack step is moved earlier to execute immediately after the version tag is created and pushed, and its later duplicate placement is removed. The npm publish command is updated to explicitly publish the generated ./*.tgz tarball in both prerelease and non-prerelease branches, with prerelease versions tagged as next, while both retain --access public and --provenance flags.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: moving npm package creation before release notes generation to ensure the published package doesn't include untracked files.
Description check ✅ Passed The description is directly related to the changeset, explaining the problems with the previous workflow and how this PR addresses them.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-nodejs-publish-repacks

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

ThetaSinner
ThetaSinner previously approved these changes Jun 8, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/nodejs-publish-release.yml:
- Around line 113-115: The workflow currently runs npm pack in the "Pack npm
artifact" step but does not capture the produced filename, then later uses
./*.tgz in the gh release create and npm publish steps which can pick up the
wrong tarball; update the "Pack npm artifact" step so it captures the exact
filename returned by npm pack (e.g., run npm pack and capture its stdout into a
variable) and export that filename (via step output or GITHUB_OUTPUT), then
replace all occurrences of the root glob ./*.tgz in the gh release create and
npm publish steps with the captured filename reference (the step output/env var)
so the workflow always attaches/publishes the exact tarball produced by npm
pack.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 701bc8b0-1eeb-48f5-b68e-140e425be706

📥 Commits

Reviewing files that changed from the base of the PR and between 442c3e8 and ce4cd65.

📒 Files selected for processing (1)
  • .github/workflows/nodejs-publish-release.yml

Comment thread .github/workflows/nodejs-publish-release.yml
@cocogitto-bot

cocogitto-bot Bot commented Jun 8, 2026

Copy link
Copy Markdown

✔️ 05673e5...91415b0 - Conventional commits check succeeded.

@cdunster cdunster enabled auto-merge (rebase) June 8, 2026 10:27
@cdunster cdunster requested a review from ThetaSinner June 8, 2026 10:27
@cdunster cdunster merged commit 72db114 into main Jun 8, 2026
4 checks passed
@cdunster cdunster deleted the fix-nodejs-publish-repacks branch June 8, 2026 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants