Skip to content

Commit a58bca0

Browse files
naivefunclaude
andcommitted
Setup changesets for automated release management
- Add @changesets/cli for semantic versioning and changelog generation - Configure changesets with public access for npm publishing - Add npm scripts: changeset, version-packages, release - Create GitHub Action for automated release workflow - Enables structured release process with user-friendly changelogs Usage: - pnpm changeset (create changeset for your changes) - pnpm version-packages (bump versions and update changelog) - pnpm release (build and publish to npm) 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 88ff724 commit a58bca0

File tree

5 files changed

+644
-0
lines changed

5 files changed

+644
-0
lines changed

.changeset/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Changesets
2+
3+
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4+
with multi-package repos, or single-package repos to help you version and publish your code. You can
5+
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
6+
7+
We have a quick list of common questions to get you started engaging with this project in
8+
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)

.changeset/config.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/config@3.1.1/schema.json",
3+
"changelog": "@changesets/cli/changelog",
4+
"commit": false,
5+
"fixed": [],
6+
"linked": [],
7+
"access": "public",
8+
"baseBranch": "main",
9+
"updateInternalDependencies": "patch",
10+
"ignore": []
11+
}

.github/workflows/release.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
concurrency: ${{ github.workflow }}-${{ github.ref }}
9+
10+
jobs:
11+
release:
12+
name: Release
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
with:
18+
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
19+
fetch-depth: 0
20+
21+
- name: Setup pnpm
22+
uses: pnpm/action-setup@v4
23+
with:
24+
version: 10.13.1
25+
26+
- name: Setup Node.js
27+
uses: actions/setup-node@v4
28+
with:
29+
node-version: 18
30+
cache: 'pnpm'
31+
32+
- name: Install dependencies
33+
run: pnpm install --frozen-lockfile
34+
35+
- name: Create Release Pull Request or Publish to npm
36+
id: changesets
37+
uses: changesets/action@v1
38+
with:
39+
# This expects you to have a script called release which does a build for your packages and calls changeset publish
40+
publish: pnpm release
41+
env:
42+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
"ladle:serve": "ladle serve",
1515
"ladle:build": "ladle build",
1616
"docs:deploy": "pnpm ladle:build",
17+
"changeset": "changeset",
18+
"version-packages": "changeset version",
19+
"release": "pnpm build && changeset publish",
1720
"prepublishOnly": "pnpm run build"
1821
},
1922
"keywords": [
@@ -35,6 +38,7 @@
3538
"react-dom": ">=16.8.0"
3639
},
3740
"devDependencies": {
41+
"@changesets/cli": "^2.29.5",
3842
"@ladle/react": "^5.0.3",
3943
"@types/lodash-es": "^4.17.12",
4044
"@types/react": "^19.1.10",

0 commit comments

Comments
 (0)