-
Notifications
You must be signed in to change notification settings - Fork 893
chore: use changesets to support an automatic release process #3448
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
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
b357dcb
chore: use changesets to support an automatic release process
zbynekstara e52fc27
add a link between core and layout packages
zbynekstara b3747d4
explain changesets format in readme files + improve their formatting
zbynekstara de644aa
update joint-core dependency of joint-decorators
zbynekstara 45ca9c8
update yarn.lock
zbynekstara 3c753f1
improve GHA comment
zbynekstara 8f0a634
readme updates
zbynekstara 63c7a2c
add deprecation message for v4 to root changelog
zbynekstara 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,40 @@ | ||
| # Changesets | ||
|
|
||
| This folder holds pending changesets. Versions, `CHANGELOG.md` files and npm | ||
| publishing are driven from them by | ||
| [`@changesets/cli`](https://github.com/changesets/changesets) | ||
| - see [CONTRIBUTING.md](../CONTRIBUTING.md#changesets) for the full workflow and | ||
| [Changeset format](../CONTRIBUTING.md#changeset-format) for the rules this | ||
| project expects. | ||
|
|
||
| Add one with `yarn changeset`, or write the file by hand: | ||
|
|
||
| ```markdown | ||
| --- | ||
| "@joint/core": minor | ||
| --- | ||
|
|
||
| dia.Paper - add `originX` and `originY` options to `getFitToContentArea()` | ||
| ``` | ||
|
|
||
| The short version of the format: | ||
|
|
||
| - **Frontmatter** - which packages this changeset releases, and the bump type | ||
| (`patch`, `minor`, `major`). Listing several packages is rare: the body is | ||
| copied verbatim into each one's changelog. Prefer one changeset per package. | ||
| - **Body** - the changelog entry, one line, `scope - description`. One changeset | ||
| becomes exactly one changelog bullet (later lines are folded into that same | ||
| bullet, not turned into new ones) - so write no `-`/`*` bullets of your own | ||
| and add another changeset file for each further changelog line. | ||
| - **Scope** - usually `namespace.Class` (`dia.Paper`, `elementTools.Control`, | ||
| `mvc.View`, `layout.MSAGL`), or the component/hook for `@joint/react` | ||
| (`<Paper />`, `useCells`). A bare `namespace` (`anchors`, `connectionPoints`) | ||
| when the change covers all of it; no scope at all for package-wide, | ||
| architectural changes. | ||
| - **Description** - less than ~100 characters, lowercase, no trailing period, | ||
| verb first. Code artifacts in backticks (`` `changeId` ``, | ||
| `` `batch:start` ``, `` `initializeUnmounted: true` ``); functions and | ||
| methods always with `()`. | ||
|
|
||
| An empty changeset (`yarn changeset add --empty`) marks a PR that touches | ||
| releasable files but should not trigger a release. |
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,6 @@ | ||
| --- | ||
|
|
||
| --- | ||
|
|
||
|
|
||
|
|
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,57 @@ | ||
| { | ||
| "$schema": "https://unpkg.com/@changesets/config@4.0.0/schema.json", | ||
| "baseBranch": "master", | ||
| "access": "public", | ||
| "changelog": "@changesets/cli/changelog", | ||
| "commit": false, | ||
| "ignore": [], | ||
| "fixed": [], | ||
| "linked": [ | ||
| [ | ||
| "@joint/core", | ||
| "@joint/layout-directed-graph", | ||
| "@joint/layout-msagl" | ||
| ] | ||
| ], | ||
| "updateInternalDependencies": "patch", | ||
| "privatePackages": { | ||
| "version": false, | ||
| "tag": false | ||
| }, | ||
| "changedFilePatterns": [ | ||
| "**", | ||
| "!**/*.test.{js,jsx,ts,tsx,mjs}", | ||
| "!**/test/**", | ||
| "!**/__tests__/**", | ||
| "!**/__mocks__/**", | ||
| "!**/bench/**", | ||
| "!**/demo/**", | ||
| "!**/stories/**", | ||
| "!**/.storybook/**", | ||
| "!**/dist/**", | ||
| "!**/build/**", | ||
| "!**/coverage/**", | ||
| "!**/coverage.json", | ||
| "!**/.tscache/**", | ||
| "!**/scripts/**", | ||
| "!**/grunt/**", | ||
| "!**/Gruntfile.js", | ||
| "!**/Makefile", | ||
| "!**/rollup.config.*", | ||
| "!**/rollup.resources.mjs", | ||
| "!**/vite.config.*", | ||
| "!**/vitest.workspace.*", | ||
| "!**/jest.config.js", | ||
| "!**/jest.react18.config.mjs", | ||
| "!**/karma.conf.js", | ||
| "!**/tsconfig*.json", | ||
| "!**/dts-generator.config.js", | ||
| "!**/knip.json", | ||
| "!**/typedoc.*", | ||
| "!**/.prettierrc*", | ||
| "!**/.gitignore", | ||
| "!**/eslint.config.mjs", | ||
| "!**/*.md", | ||
| "!**/LICENSE" | ||
| ] | ||
| } |
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
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,141 @@ | ||
| # Release pipeline, driven by Changesets (https://changesets.dev). | ||
| # | ||
| # On every push to `master` this workflow decides between two modes: | ||
| # | ||
| # * `version` - there are pending changesets in `.changeset/`. The workflow | ||
| # applies the version bumps + per-package `CHANGELOG.md` entries, deletes | ||
| # the consumed changesets and opens (or updates) `changeset-release/master` | ||
| # PR titled "Version Packages". | ||
| # * `publish` - the release PR has been merged, so the versions in `master` | ||
| # are ahead of what is on npm. The workflow builds the workspace, publishes | ||
| # every changed public package, and creates a git tag + GitHub Release per | ||
| # published package. | ||
| # | ||
| # Nothing is published until the release PR is merged by a maintainer. | ||
| # | ||
| # Repository setup: | ||
| # * Settings > Actions > General > "Allow GitHub Actions to create and approve | ||
| # pull requests" must be enabled (needed to open the release PR). | ||
| # * Secret `NPM_TOKEN` - an npm automation token that bypasses 2FA. | ||
| # | ||
| # Note: the release PR is opened by `github-actions[bot]`, so `test-pr.yml` does | ||
| # not run on it. | ||
| name: Release | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ "master" ] | ||
|
|
||
| # Reset permissions and grant them explicitly per job. | ||
| permissions: {} | ||
|
|
||
| # Never release twice at the same time. | ||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: false | ||
|
|
||
| jobs: | ||
| # Decide whether this push should version or publish. | ||
| select-mode: | ||
| if: ${{ github.repository == 'clientIO/joint' }} | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| outputs: | ||
| mode: ${{ steps.select-mode.outputs.mode }} | ||
| steps: | ||
| - name: Checkout joint | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: Setup Node.js v22 | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 22.14.0 | ||
|
|
||
| - name: Cache Yarn | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: | | ||
| .yarn/cache | ||
| key: yarn-cache-${{ hashFiles('yarn.lock') }} | ||
|
|
||
| - name: Install dependencies | ||
| run: yarn install --immutable | ||
|
|
||
| - name: Select Changesets mode | ||
| id: select-mode | ||
| uses: changesets/action/select-mode@v2 | ||
|
|
||
| # Pending changesets: open/update the "Version Packages" PR. | ||
| version: | ||
| needs: select-mode | ||
| if: ${{ needs.select-mode.outputs.mode == 'version' }} | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: write # commit the version bumps | ||
| pull-requests: write # open the release PR | ||
| steps: | ||
| - name: Checkout joint | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: Setup Node.js v22 | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 22.14.0 | ||
|
|
||
| - name: Cache Yarn | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: | | ||
| .yarn/cache | ||
| key: yarn-cache-${{ hashFiles('yarn.lock') }} | ||
|
|
||
| - name: Install dependencies | ||
| run: yarn install --immutable | ||
|
|
||
| # Runs `changeset version` and pushes the result to `changeset-release/master`. | ||
| - name: Version packages | ||
| uses: changesets/action/version@v2 | ||
|
|
||
| # Release PR merged: build and publish everything that is not on npm yet. | ||
| publish: | ||
| needs: select-mode | ||
| if: ${{ needs.select-mode.outputs.mode == 'publish' }} | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: write # push git tags and create GitHub Releases | ||
| steps: | ||
| - name: Checkout joint | ||
| uses: actions/checkout@v4 | ||
|
|
||
|
|
||
| - name: Setup Node.js v22 | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 22.14.0 | ||
| # No `registry-url` on purpose (not used by Yarn) | ||
|
|
||
| - name: Cache Yarn | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: | | ||
| .yarn/cache | ||
| key: yarn-cache-${{ hashFiles('yarn.lock') }} | ||
|
|
||
| - name: Install dependencies | ||
| run: yarn install --immutable | ||
|
|
||
| - name: Build packages | ||
| run: yarn dist | ||
|
|
||
| # Runs `changeset publish`, which publishes through `yarn npm publish` (Yarn Berry | ||
| # is auto-detected), then tags each published package and cuts a GitHub Release. | ||
| - name: Publish packages | ||
| uses: changesets/action/publish@v2 | ||
| env: | ||
| YARN_NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
| # No `NODE_AUTH_TOKEN` on purpose (must use Yarn) | ||
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.
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.