Skip to content

ci(publish): mirror releases to GitHub Packages - #8

Merged
lonetis merged 1 commit into
mainfrom
claude/wonderful-pasteur-lkdysc
Oct 20, 2026
Merged

lonetis merged 1 commit into
mainfrom
claude/wonderful-pasteur-lkdysc

Conversation

@lonetis

@lonetis lonetis commented Oct 20, 2026

Copy link
Copy Markdown
Owner

Summary

Mirrors each release to GitHub Packages, so the package and its versions show on the repo page (the Packages section of the sidebar) alongside npm.

A new github-packages job in publish.yml runs after the npm job:

  • Scoped name. GitHub Packages only accepts owner-scoped names, so the job runs npm pkg set name=@lonetis/claudeleaf in the runner before publishing. The npm package stays claudeleaf, and the installed command is still claudeleaf.
  • Auth. Uses the built-in GITHUB_TOKEN with packages: write, so no secret is needed. setup-node gets scope: "@lonetis", which sends only that scope to npm.pkg.github.com; dependencies still install from npmjs.
  • Repo link. The repository field added in ci(publish): publish via npm trusted publishing instead of NPM_TOKEN #6 links the package to this repo.
  • Only new versions, checked against GitHub Packages separately from npm. Merging this PR therefore publishes 0.3.1 to GitHub Packages right away, while the npm job skips it.
  • Runs after the npm job (needs: publish), so it only mirrors a build that passed the tests.

Permissions are now set per job. The npm job keeps id-token: write for trusted publishing. The GitHub Packages job gets packages: write and no id-token, so npm never tries trusted-publishing sign-in against GitHub's registry.

CLAUDE.md's publishing section describes the mirror. npm stays the install source in the README, because GitHub Packages requires sign-in even to install public packages.

Verification

  • actionlint 1.7.7 reports no issues for publish.yml and ci.yml.
  • Simulated the rename in a scratch copy: npm pack --dry-run produces @lonetis/claudeleaf@0.3.1 (lonetis-claudeleaf-0.3.1.tgz, 51 files), with bin.claudeleaf and repository unchanged.
  • The PR's CI doesn't run publish.yml. The first real run is the push to main when this merges.

After merging

  • GitHub makes a new package private by default. To make it public, open the package page and choose Package settings → Change visibility → Public.
  • Only versions from 0.3.1 on are mirrored; 0.1.0–0.3.0 remain on npm only.

Generated by Claude Code

Adds a second Publish job that mirrors each new version to GitHub Packages, so
the package and its versions show on the repo page alongside npm.

GitHub Packages only accepts owner-scoped names, so the job renames the package
to @lonetis/claudeleaf in the runner before publishing; the npm package stays
`claudeleaf`. It authenticates with GITHUB_TOKEN (packages: write), and the
existing `repository` field links the package to this repo. Like the npm job,
it publishes only a version the registry does not have yet, so merging this
backfills 0.3.1 there.

Permissions move to job level: the npm job keeps id-token: write for trusted
publishing; the GitHub Packages job gets packages: write and no id-token, so
npm never attempts an OIDC exchange against GitHub's registry. It runs after
the npm job, mirroring only a build that passed the tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015XnPdQXFWDT6FTnQs1d1f1
@lonetis
lonetis marked this pull request as ready for review October 20, 2026 13:06
@lonetis
lonetis merged commit ceaef52 into main Oct 20, 2026
2 checks passed
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-20T13:06:37.220668Z df40e84 Draft marked ready
🔒 Security Review ✅ Completed 2026-10-20T13:07:23.224602Z df40e84 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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