Skip to content

Split npm publish out of sync.yml into its own manually-triggered workflow - #1

Merged
alexey-milovidov merged 1 commit into
mainfrom
michael/separate-publish-workflow
Sep 22, 2026
Merged

alexey-milovidov merged 1 commit into
mainfrom
michael/separate-publish-workflow

Conversation

@michael-anastasakis

Copy link
Copy Markdown
Member

Summary

  • sync.yml no longer publishes to npm. It still syncs, rebuilds, tests, commits, tags, and creates the GitHub release exactly as before.
  • New publish.yml: manually triggered (workflow_dispatch, requires a ref input — e.g. v1.0.1), runs the test suite against the checked-out tag, then publishes via npm OIDC trusted publishing (no NPM_TOKEN, no long-lived secrets).

Why

  • main now has branch protection requiring PR review; sync.yml's direct git push --follow-tags only works for identities on the bypass list, so it made sense to stop bundling an npm-auth-dependent step into that same job.
  • npm can't publish yet anyway — no auth is configured, and Trusted Publishing can only be set up once a first version exists on the registry.
  • Publishing becomes a deliberate button-press rather than an automatic side effect of the daily sync, per @alexey-milovidov's request.

Next steps (after merge)

  1. Manually publish the first version (npm login && npm publish --access public) from a local checkout — one-time, since Trusted Publisher can't be configured before the package exists on npm.
  2. Configure npm Trusted Publisher for @clickhouse/lexer: GitHub Actions, org ClickHouse, repo clickhouse-lexer, workflow publish.yml.
  3. Set the package's "Publishing access" to "Require two-factor authentication or automation tokens."
  4. From then on, publishing a synced release is Actions → "Publish to npm" → Run workflow → ref = the tag to publish.

Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com

sync.yml pushes commits and tags directly to main; with branch
protection now requiring PR review on main, that push would fail for
identities other than the allowed bypass user. It also can't publish
to npm yet since no auth is configured (trusted publisher can only be
set up once a first version exists on the registry).

Keep sync.yml focused on syncing, committing, tagging, and creating
GitHub releases. Add publish.yml as a manually-triggered
(workflow_dispatch) workflow that publishes a given tag to npm via
OIDC trusted publishing, mirroring click-ui's OIDC-only approach
(https://github.com/ClickHouse/click-ui/blob/main/.github/workflows/publish.yml)
rather than keeping a long-lived NPM_TOKEN fallback.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@alexey-milovidov alexey-milovidov self-assigned this Sep 22, 2026
@alexey-milovidov
alexey-milovidov merged commit 7387284 into main Sep 22, 2026
1 check passed
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