Skip to content

ci: auto-publish npm when a fresh index lands on master - #69

Merged
yya007 merged 1 commit into
masterfrom
ci/npm-auto-publish
Jun 23, 2026
Merged

ci: auto-publish npm when a fresh index lands on master#69
yya007 merged 1 commit into
masterfrom
ci/npm-auto-publish

Conversation

@yya007

@yya007 yya007 commented Jun 23, 2026

Copy link
Copy Markdown
Owner

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:

  • Trigger: push to master touching data/version.txt (i.e. a merged local index rebuild). Plus workflow_dispatch with a dry_run input (default true) for safe testing.
  • Does: patch-bump → npm publish (auth via NPM_TOKEN secret) → tag v<version>update_release_log.py --npm-version → commit the bump back to master.
  • Robustness: bumps from the published npm version (not package.json), so a missed commit/push self-heals on the next run. The bump commit is [skip ci] and doesn't touch data/version.txt, so it can't re-trigger the workflow. concurrency prevents overlapping runs. Uses setup-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-release skill remains for ad-hoc manual publishes.

Setup done

  • NPM_TOKEN repo secret set (granular bypass-2FA token; encrypted, never in git/logs).
  • master is unprotected and update-index.yml already pushes generated commits from CI (precedent), so the bot can commit the bump + tag.
  • PRD-005 updated to document the automation.

Verification

  • Workflow YAML parses; release-log scripts are stdlib-only (no pip needed in CI).
  • After merge I'll trigger a dry_run dispatch 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 the NPM_TOKEN secret.

🤖 Generated with Claude Code

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>
@yya007
yya007 merged commit 9e5f9ab into master Jun 23, 2026
1 check passed
@yya007
yya007 deleted the ci/npm-auto-publish branch June 23, 2026 05:30
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.

1 participant