-
Notifications
You must be signed in to change notification settings - Fork 36
chore(release): migrate from Lerna to Changesets #585
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
petermuessig
merged 3 commits into
UI5:main
from
petermuessig:chore/migrate-to-changesets
Jun 5, 2026
Merged
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| # Changesets | ||
|
|
||
| Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works | ||
| with multi-package repos, or single-package repos to help you version and publish your code. You can | ||
| find the full documentation for it [in our repository](https://github.com/changesets/changesets). | ||
|
|
||
| We have a quick list of common questions to get you started engaging with this project in | ||
| [our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md). | ||
|
|
||
| ## How this repo uses Changesets | ||
|
|
||
| This monorepo replaced Lerna with [Changesets](https://github.com/changesets/changesets) for | ||
| versioning and releases. The flow is: | ||
|
|
||
| 1. **In your PR**, run `yarn changeset` and answer the prompts (which packages, semver level, | ||
| summary). Commit the generated `.changeset/<random-name>.md` file alongside your code change. | ||
| 2. When your PR is merged to `main`, the **Release** workflow opens (or updates) a single | ||
| `Version Packages` PR that aggregates all pending changesets — bumping versions and updating | ||
| each package's `CHANGELOG.md`. | ||
| 3. **Merging the `Version Packages` PR** triggers the same workflow to publish the new versions | ||
| to npm. | ||
|
|
||
| Private packages (`test-packages/*`, `demos/*`) are skipped automatically by `changeset publish`. | ||
| Only the public packages under `packages/*` are released. | ||
|
|
||
| If a change does not warrant a release (docs-only, internal tooling, test refactors, etc.) just | ||
| don't add a changeset — the PR will surface a "no changeset detected" hint, which is fine to | ||
| acknowledge and merge. | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| { | ||
| "$schema": "https://unpkg.com/@changesets/config@3.0.0/schema.json", | ||
| "changelog": ["@changesets/changelog-github", { "repo": "UI5/typescript" }], | ||
| "commit": false, | ||
| "fixed": [], | ||
| "linked": [], | ||
| "access": "public", | ||
| "baseBranch": "main", | ||
| "updateInternalDependencies": "patch", | ||
| "ignore": ["@ui5/openui5-snapshot-test", "@ui5/typed-json-model"] | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| --- | ||
| --- |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| name: Changeset | ||
|
|
||
| # Verifies that every PR carries a changeset (or an explicit empty one). | ||
| # Runs only on pull_request — `push` to main carries already-merged | ||
| # changesets that the Release workflow then consumes. | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: [main] | ||
| workflow_dispatch: | ||
| inputs: | ||
| pr_number: | ||
| description: "PR number to test (for fork PRs)" | ||
| required: true | ||
| type: string | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| changeset: | ||
| name: Changeset present | ||
| runs-on: ubuntu-latest | ||
| # Skip on the auto-generated "Version Packages" PR (it consumes all changesets). | ||
| if: github.head_ref != 'changeset-release/main' | ||
| steps: | ||
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 | ||
| with: | ||
| ref: ${{ inputs.pr_number && format('refs/pull/{0}/head', inputs.pr_number) || '' }} | ||
| # Full history so `changeset status --since=origin/main` can diff. | ||
| fetch-depth: 0 | ||
|
|
||
| - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 | ||
| with: | ||
| node-version: 24.x | ||
|
|
||
| - name: Install dependencies | ||
| run: yarn --frozen-lockfile | ||
|
|
||
| # Fails the PR if no changeset describes the change. | ||
| # Add one with `yarn changeset` (or `yarn changeset:empty` for PRs | ||
| # that don't need a release entry) and commit it. | ||
| # We check `.changesets` (not `.releases`) so that empty changesets | ||
| # — which have 0 package bumps but still document the PR — pass. | ||
| - name: Verify changeset is present | ||
| run: | | ||
| yarn changeset status --since=origin/main --output=/tmp/cs.json | ||
| if [ "$(jq '.changesets | length' /tmp/cs.json)" -eq 0 ]; then | ||
| echo "::error::No changeset found on this PR. Run 'yarn changeset' (or 'yarn changeset:empty' for PRs that don't need a release entry) and commit the file." | ||
| exit 1 | ||
| fi |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,40 +1,69 @@ | ||
| name: Release | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| workflow_dispatch: | ||
| workflow_dispatch: # Manual trigger | ||
|
|
||
| env: | ||
| HUSKY_SKIP: true | ||
|
|
||
| # Skip when the head commit is the workflow's own version-bump commit, to avoid loops. | ||
| concurrency: | ||
| group: release-${{ github.ref }} | ||
| cancel-in-progress: false | ||
|
|
||
| permissions: | ||
| contents: read | ||
| id-token: write | ||
| contents: write # create the "Version Packages" PR and tags | ||
| pull-requests: write # open/update the version PR | ||
| id-token: write # REQUIRED for npm OIDC trusted publishing | ||
|
|
||
| jobs: | ||
| release: | ||
| runs-on: ubuntu-latest | ||
| # Only gate push events by commit message; allow workflow_dispatch always | ||
| if: > | ||
| github.event_name == 'workflow_dispatch' || | ||
| (github.event_name == 'push' && contains(github.event.head_commit.message, 'chore(release): publish')) | ||
| if: "!contains(github.event.head_commit.message, 'skip ci')" | ||
|
petermuessig marked this conversation as resolved.
Outdated
|
||
| steps: | ||
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 | ||
| - name: Checkout | ||
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 | ||
| - name: Setup node | ||
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 | ||
| with: | ||
| node-version: 24.15.0 | ||
| registry-url: https://registry.npmjs.org | ||
|
|
||
| - name: Install dependencies | ||
| run: yarn --frozen-lockfile | ||
|
|
||
| - name: Build | ||
| run: yarn build | ||
|
|
||
| # Choose publish command based on the event type | ||
| - name: Publish to NPM (push) | ||
| if: github.event_name == 'push' | ||
| run: npm run release:publish | ||
| - name: Detect token usage (optional safety) | ||
| run: | | ||
| if npm whoami 2>/dev/null; then | ||
| echo "::warning::Token-based auth active (expected only when OIDC isn't configured)" | ||
| else | ||
| echo "OIDC auth active" | ||
| fi | ||
|
petermuessig marked this conversation as resolved.
Outdated
|
||
|
|
||
| - name: Publish to NPM (manual) | ||
| if: github.event_name == 'workflow_dispatch' | ||
| run: npm run release:publish-manual | ||
| - name: Configure NPM bootstrap token (non OIDC flow) | ||
| env: | ||
| NPM_BOOTSTRAP_TOKEN: ${{ secrets.NPM_BOOTSTRAP_TOKEN }} | ||
| if: ${{ env.NPM_BOOTSTRAP_TOKEN != '' }} | ||
| run: | | ||
| echo "//registry.npmjs.org/:_authToken=${NPM_BOOTSTRAP_TOKEN}" >> ~/.npmrc | ||
|
|
||
| - name: Create Release Pull Request or Publish | ||
| id: changesets | ||
| uses: changesets/action@63a615b9cd06ba9a3e6d13796c7fbcb080a60a0b # v1.8.0 | ||
| with: | ||
| version: yarn run version-packages | ||
| publish: yarn run release-publish | ||
| commit: "chore(release): publish" | ||
| title: "chore(release): publish" | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| NODE_AUTH_TOKEN: ${{ secrets.NPM_BOOTSTRAP_TOKEN }} | ||
| NPM_CONFIG_PROVENANCE: "true" | ||
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.