Skip to content

ci(release): auto-publish on package.json version change#2

Merged
simaonogueira101 merged 1 commit into
mainfrom
chore/auto-release-on-version-bump
May 11, 2026
Merged

ci(release): auto-publish on package.json version change#2
simaonogueira101 merged 1 commit into
mainfrom
chore/auto-release-on-version-bump

Conversation

@simaonogueira101

Copy link
Copy Markdown
Member

Summary

Removes the manual git tag && git push --tags step from releasing. The workflow now:

  • Triggers on push to main only when package.json is touched.
  • Detects whether version actually changed vs HEAD~1. If unchanged → skip everything.
  • Refuses to re-publish if v<version> already exists on the remote.
  • Runs lint + check-types + tests + build before publish (same gates as before).
  • Publishes to npm with provenance.
  • Creates + pushes the v<version> git tag from the workflow itself, so git history still marks every release.
  • workflow_dispatch with force=true lets you force-publish at the current version (useful for re-releasing after a failed publish without bumping).

Why

Until now the release flow required an extra manual step after merging a version-bump PR:

git checkout main && git pull
git tag v0.3.0 && git push origin v0.3.0

That step is easy to forget and adds friction. The new flow makes the version bump in package.json the single source of release intent: bump it in your feature PR, merge, done.

Safety properties preserved

  • Only intentional version bumps publish — a feature PR that doesn't touch package.json is a no-op for the workflow.
  • The same lint / types / test / build gates run before npm publish.
  • Provenance is still enabled.
  • The "tag already exists" check prevents accidental re-publish of an already-shipped version.

Test plan

  • YAML parsed and committed (CI will compile-check on next push).
  • Merge this PR — workflow should NOT fire (this PR changes release.yml, not package.json).
  • First real test: next feature PR that bumps version → workflow publishes + tags automatically.

🤖 Generated with Claude Code

Replaces the 'tag pushed → publish' trigger with 'push to main with
version change → publish + tag'. Removes the manual git tag + push
step from the release flow.

Behaviour:
- Push to main that bumps version in package.json → publish + tag
- Push to main that doesn't touch version → workflow does nothing
- workflow_dispatch with force=true → publish at current version
- Tag already exists on origin → fail (safety against double publish)

Safety properties preserved:
- Only intentional version bumps publish (no accidental release from
  routine main pushes)
- Lint + check-types + tests + build still gate the publish
- Provenance still enabled

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@simaonogueira101 simaonogueira101 merged commit 60fe96e into main May 11, 2026
2 checks passed
simaonogueira101 added a commit that referenced this pull request May 11, 2026
Self-hosting noticed isn't realistic for ~100% of users — the value
depends on a pre-ingested GHArchive + LinkedIn graph (hundreds of GiB
of ClickHouse, paid RapidAPI access, OpenAI/Anthropic keys, NextAuth
OAuth apps). The README pretending it's the common case was misleading
and added friction for everyone.

Changes:

- src/api-client.ts: createClientFromEnv() now defaults NOTICED_API_URL
  to https://www.noticed.so when unset. NOTICED_API_KEY is still
  required. Self-hosters can override NOTICED_API_URL explicitly.
- mcp.json + server.json: drop NOTICED_API_URL from required env;
  server.json marks it isRequired: false with a clarifying description.
- README.md: purge `https://your-instance.noticed.so` from every
  client snippet (~10 occurrences); update the env-var table; new
  'Self-hosting noticed' footnote that keeps the override documented
  without leading with it.
- package.json + server.json: bump 0.3.0 → 0.3.1 (patch — the env-var
  fallback is a small behavioural addition, not a breaking change).

Auto-release workflow (merged in PR #2) will pick up the version
change on merge and publish 0.3.1 to npm automatically.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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