Skip to content

feat: prep npm release — activate publish workflow, add registry metadata#2

Merged
a-tokyo merged 2 commits into
mainfrom
chore/npm-release-prep
Jul 22, 2026
Merged

feat: prep npm release — activate publish workflow, add registry metadata#2
a-tokyo merged 2 commits into
mainfrom
chore/npm-release-prep

Conversation

@a-tokyo

@a-tokyo a-tokyo commented Jul 15, 2026

Copy link
Copy Markdown
Member

Summary

  • Un-dormants release.yml: enables OIDC-based npm publish --provenance (no NPM_TOKEN secret), and creates the GitHub Release after publish succeeds so a failed publish can never leave a tag/release with no matching npm version.
  • Adds registry-ready package.json metadata: drops private: true, adds publishConfig.access: public, repository, homepage, bugs. Bumps version 0.1.3 -> 0.1.4.
  • Updates README: real npm i -D @zoldytech/javascript install command (replacing the GitHub-URL-pinned-tag install), adds npm version/downloads + CI badges.

Context

Prompted by creating the zoldytech npm org and auditing this repo's CI/release setup against a-tokyo/apple-signin-auth. That repo creates its GitHub Release before npm publish, and its NPM_TOKEN has been silently expired for over a month — its latest release has no matching npm version with no alerting. This PR sequences the opposite way (publish first, release second) so that failure mode can't happen here.

Prerequisite (not part of this PR)

Before the first tag push will actually publish, OIDC trusted publishing needs to be enabled on npmjs.com for this package: Settings -> Trusted Publisher -> GitHub Actions -> Zoldytech/javascript -> release.yml.

Test plan

  • npm run lint passes
  • npm test passes (22/22)
  • release.yml YAML validated
  • After merge: enable npm trusted publisher, then push tag v0.1.4 and confirm the release workflow publishes to npm and creates a GitHub Release
  • Backfill missing GitHub Releases for tags 0.1.1, 0.1.2, 0.1.3 (tracked separately, not in this PR)

…data — 0.1.4

Un-dormants release.yml now that the zoldytech npm org exists: enables
OIDC-based `npm publish --provenance`, and creates the GitHub Release only
after publish succeeds (so a failed publish can never leave a tag/release
with no matching npm version). Adds package.json registry metadata
(publishConfig, repository, homepage, bugs) and drops `private: true`.
Updates README to the real npm install command and adds npm/CI badges.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

Copilot AI 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.

Pull request overview

Prepares this package for an npm registry release by enabling an OIDC-based publish workflow, updating package.json with publish-ready metadata, and aligning the README with npm-based installation and status badges.

Changes:

  • Activated release.yml to publish to npm with provenance and create a GitHub Release afterward.
  • Updated package.json for public publishing (removed private, added publishConfig, repo/homepage/bugs metadata) and bumped version 0.1.30.1.4.
  • Updated README with npm install command and added npm/CI badges.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
README.md Adds npm/CI badges and switches install instructions to npm i -D @zoldytech/javascript.
package.json Adds npm registry metadata, enables public publishing, and bumps package version.
.github/workflows/release.yml Re-enables release workflow to publish via OIDC provenance and create a GitHub Release post-publish.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/release.yml Outdated
Comment thread .github/workflows/release.yml
Addresses Copilot review on #2: contents:write wasn't needed for npm
publish itself; the tag-vs-package.json version gate was documented but
never enforced; and a failed `gh release create` after a successful
publish had no clean retry path (rerunning the job would rerun npm
publish, which fails on an already-published version). Splitting into
publish -> release jobs fixes all three, and lets the release job be
rerun independently.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@a-tokyo

a-tokyo commented Jul 22, 2026

Copy link
Copy Markdown
Member Author

Addressed both Copilot findings in e8b6a10:

  • Reworded the header comment — it now correctly states the tag itself already exists once pushed (that's the trigger), and only the GitHub Release is deferred until publish succeeds.
  • Split publish and release into separate jobs with least-privilege permissions (contents: read for publish, contents: write only for release), added an explicit tag-vs-package.json-version check that fails the job on mismatch, and the release job can now be re-run independently if it fails without re-attempting npm publish.

Copilot AI 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.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

@a-tokyo
a-tokyo merged commit fd23f6c into main Jul 22, 2026
3 checks passed
@a-tokyo
a-tokyo deleted the chore/npm-release-prep branch July 22, 2026 19:36
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