Skip to content

chore(monorepo): 🤖 Independent Package Publisher (NPM)#953

Open
punkbit wants to merge 10 commits intochore/monorepo-changeset-root-setupfrom
chore/monorepo-package-releaser
Open

chore(monorepo): 🤖 Independent Package Publisher (NPM)#953
punkbit wants to merge 10 commits intochore/monorepo-changeset-root-setupfrom
chore/monorepo-package-releaser

Conversation

@punkbit
Copy link
Copy Markdown
Collaborator

@punkbit punkbit commented Mar 26, 2026

Why?

The existing release workflow's hardcoded for @clickhouse/click-ui. Supporting packages like design-tokens that live under ./packages/* need a way to publish independently without coupling to the click-ui release cycle (e.g. test/release-candidate -> stable -> latest) and related side-effects (e.g. branch name chore/v<Major.minor.patch>.

💡 In the next iteration, this workflow can have a similar automation to click-ui

⚠️ WARNING: This will require the npm admin to publish an initial placeholder version to NPM due to OIDC workflow whitelistening. See npm/cli#8544. setup-npm-trusted-publish, a dedicated tool for this, can be used to publish a "dummy" package to npm:

npx --yes setup-npm-trusted-publish <package-name>

How?

  • Added a manually triggered workflow that dynamically loads package config from packages//package.json, builds, validates, and publishes to npm (due to command conventions for changelogs, build)
  • Supports dry_run mode for safe validation (npm publish --dry-run), skipping GitHub release and Slack notification
  • Added documentation section explaining manual changeset responsibility (enter/leave pre-release, changeset version) vs the automated click-ui flow
  • Updated README.md release section to link both workflows

Preview?

N/A

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 26, 2026

⚠️ No Changeset found

Latest commit: aaa552a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

punkbit added 5 commits March 26, 2026 18:43
…e-publisher.yml → monorepo-package-release.yml
…aining why direct interpolation of string inputs into run: blocks is dangerous, a before/after code example, and a note that choice and boolean inputs are safe to interpolate
@ClickHouse ClickHouse deleted a comment from github-actions bot Mar 27, 2026
@ClickHouse ClickHouse deleted a comment from github-actions bot Mar 27, 2026
punkbit added 2 commits March 27, 2026 16:18
…ackage_name and version to env: extract changelog (lines 203-206): moved version, package_path, and changelog_file to env:
@punkbit
Copy link
Copy Markdown
Collaborator Author

punkbit commented Mar 27, 2026

  • Awk changelog extraction is fragile (line 210): The pattern ## [0-9] to find the next section boundary won't match changelog headings in ## [1.0.0] bracket format (standard Keep a Changelog style). Changesets uses the un-bracketed format by default, so this works for now, but a more robust terminator like ## [0-9\[] would be more defensive.

This has been covered in #947. Please ignore!

  • Awk pattern uses unescaped dots in $VERSION (line 210): awk "/## $VERSION/,/## [0-9]/" — dots in 1.0.0 match any character in the regex. For a version like 1.0.0, this is benign in practice, but 1X0X0 would also match. Escape dots: VERSION_ESCAPED="${VERSION//./\\.}" and use that in the awk pattern.

This has been covered in #947. Please ignore!

@ClickHouse ClickHouse deleted a comment from github-actions bot Mar 27, 2026
@ClickHouse ClickHouse deleted a comment from github-actions bot Mar 27, 2026
… with node-version: '23.x' already ships npm 10.x, which has full --provenance support — no upgrade needed
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 27, 2026

🚨 Must Fix

  • Unescaped dots in awk VERSION pattern (.github/workflows/monorepo-package-release.yml line 206): awk "/## $VERSION/,/## [0-9]/" — dots in 1.0.0 match any character in awk regex. A version like 1.0.0 would also match 1X0X0. Fix: VERSION_ESCAPED="${VERSION//./\\.}" and use $VERSION_ESCAPED in the awk pattern.

Anything related with parsing the changelog + AWK should be ignored because this has been covered in #947. Please ignore!

@ClickHouse ClickHouse deleted a comment from github-actions bot Mar 27, 2026
@workflow-authentication-public
Copy link
Copy Markdown
Contributor

📚 Storybook Preview Deployed

✅ Preview URL: https://click-m64auafk1-clickhouse.vercel.app

Built from commit: 856e34546878f2d4c1bdfcf6fca085405717b6c6

@punkbit punkbit marked this pull request as ready for review March 27, 2026 16:49
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