Skip to content

Migrate npm publishing to GitHub Actions (npm OIDC) - #4

Merged
MykhailoTamarin merged 2 commits into
masterfrom
tech/gha-publish-workflow
Oct 1, 2026
Merged

MykhailoTamarin merged 2 commits into
masterfrom
tech/gha-publish-workflow

Conversation

@MykhailoTamarin

@MykhailoTamarin MykhailoTamarin commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

What

  • Add .github/workflows/publish.yml:
    • On PR: npm install -> npm run build (babel) -> npm publish --dry-run (validates build + pack; ships nothing)
    • On push to master: same build, then real npm publish --access public via OIDC (id-token: write, Node 24 / npm >= 11.5.1 - no registry token needed)
    • Versioning: reads current version from npm view, bumps patch (next release 1.0.438, continuing the 1.0.x sequence)
    • Job-level concurrency + fail-fast registry lookup
  • Remove .circleci/config.yml (NPM_TOKEN-based publishing) - publishing now happens in exactly one place

Notes

  • Requires a one-time npm Trusted Publisher entry for @flipdish/api-client-javascript (repo flipdishbytes/api-client-javascript, workflow .github/workflows/publish.yml) before the first publish to master.
  • Dry-run error detection matches npm error / npm ERR! prefixes only - this package legitimately contains files like ValidationErrorResult.js, which a bare error grep would false-positive on.
  • Heads-up: master currently has no package.json (deleted in fadf0ac on 2025-10-21 by a generator run that produced no output), so the PR check will fail until the generator repopulates the repo on its next run - same recovery path the CircleCI pipeline would have needed.
  • update-javascript.sh has git restore .circleci/config.yml which will now find nothing - harmless (script continues), to be cleaned up in the generator repo separately.
  • CircleCI project should be un-followed in the CircleCI UI.

Summary by CodeRabbit

  • Chores
    • Updated the package release process: changes proposed through pull requests now receive a publish dry run, and successful updates pushed to the main branch are published to npm.
    • Package patch versions are incremented automatically during the release process.
    • Removed the previous branch-based publishing workflow.

- Add publish workflow: build + dry-run publish on PR, build + publish on master
  (npm OIDC trusted publishing, id-token: write, Node 24, npm view + patch bump
  versioning, job-level concurrency, fail-fast registry lookup)
- Remove .circleci/config.yml (NPM_TOKEN based publishing)

Dry-run error detection matches npm's error prefixes ("npm error" / "npm ERR!")
only, since this package legitimately contains files like ValidationErrorResult.js
that would false-positive a bare "error" grep.
@MykhailoTamarin
MykhailoTamarin requested a review from a team as a code owner October 1, 2026 13:34
@coderabbitai

coderabbitai Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Walkthrough

Warning

Review details and warnings were omitted to fit the comment limit.

Commit fadf0ac (2025-10-21) accidentally deleted package.json, README.md,
mocha.opts and src/, docs/, test/ - the generator script deletes these before
regeneration but produced no output that day, leaving the repo unpublishable.
Restored from 3e1089c, the exact tree the last release (1.0.437) was built from.
@MykhailoTamarin
MykhailoTamarin merged commit 8824685 into master Oct 1, 2026
3 of 4 checks passed
@MykhailoTamarin
MykhailoTamarin deleted the tech/gha-publish-workflow branch October 1, 2026 13:38
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