A forked and improved version of the Changesets library, featuring a consolidated architecture and a built-in GitHub Action.
- Simplified Core: Logic from
apply,assemble, andgetrelease plans is consolidated into@changesets/release-core. - Unified Action: The GitHub Action is included in the monorepo at
packages/actionand versioned alongside the CLI. - Better CLI: Improved CLI tools with fewer internal dependencies.
yarn add @changesets/cliInitialize changesets in your project:
yarn changeset initAdd a changeset:
yarn changesetTo use the built-in GitHub Action in your workflow, reference ehudt/better-changesets/packages/action@main.
Create a file .github/workflows/release.yml:
name: Release
on:
push:
branches:
- main
concurrency: ${ { github.workflow } }-${ { github.ref } }
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 20
cache: 'yarn'
- name: Install Dependencies
run: yarn install
- name: Create Release Pull Request or Publish
uses: ehudt/better-changesets/packages/action@main
with:
# Command to update versions (creates PR)
version: yarn changeset version
# Command to publish packages (runs on merge)
publish: yarn changeset publish
env:
GITHUB_TOKEN: ${ { secrets.GITHUB_TOKEN } }
NPM_TOKEN: ${ { secrets.NPM_TOKEN } }