ci: auto-publish npm when a fresh index lands on master - #69
Merged
Conversation
Adds .github/workflows/npm-publish.yml: on a data/version.txt change pushed to master (a merged local index rebuild), it patch-bumps @yya007/skill-finder, publishes to npm (NPM_TOKEN secret — granular bypass-2FA token), tags v<version>, and stamps the release log — entirely on GitHub runners, no local machine or OTP. Version is bumped from the *published* npm version, so a missed commit/push self-heals on the next run. workflow_dispatch supports dry_run (default true) to test without publishing. The index build stays manual/local (CI can't rebuild it, per PRD-005); only the npm release step is automated. Documents this in PRD-005. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Automates the npm release so it happens on GitHub (no local machine, no OTP) whenever a fresh index lands on
master..github/workflows/npm-publish.yml:mastertouchingdata/version.txt(i.e. a merged local index rebuild). Plusworkflow_dispatchwith adry_runinput (default true) for safe testing.npm publish(auth viaNPM_TOKENsecret) → tagv<version>→update_release_log.py --npm-version→ commit the bump back tomaster.package.json), so a missed commit/push self-heals on the next run. The bump commit is[skip ci]and doesn't touchdata/version.txt, so it can't re-trigger the workflow.concurrencyprevents overlapping runs. Usessetup-node+NODE_AUTH_TOKEN(token never written to disk in plaintext).What's automatic vs manual: the index build stays manual/local (CI can't rebuild a 42k IVF index — PRD-005). Once you merge a fresh index, everything after is hands-off on GitHub. The
npm-releaseskill remains for ad-hoc manual publishes.Setup done
NPM_TOKENrepo secret set (granular bypass-2FA token; encrypted, never in git/logs).masteris unprotected andupdate-index.ymlalready pushes generated commits from CI (precedent), so the bot can commit the bump + tag.Verification
dry_rundispatch to confirm the flow end-to-end without publishing.Risk & rollback
Medium — it publishes to npm automatically on index changes (outward-facing). Guard rails: index-change trigger only, dry-run default for manual runs, self-healing version,
[skip ci]. Rollback = delete the workflow file (revert) and/or remove theNPM_TOKENsecret.🤖 Generated with Claude Code