Skip to content

Commit b68f655

Browse files
committed
added github release support
1 parent 139086e commit b68f655

File tree

2 files changed

+65
-1
lines changed

2 files changed

+65
-1
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ jobs:
3232
id: changesets
3333
uses: changesets/action@v1
3434
with:
35-
# This expects you to have a script called release which does a build for your packages and calls changeset publish
3635
publish: pnpm release
36+
createGithubReleases: true
3737
env:
3838
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3939
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Plan: Enable GitHub Releases from Changesets
2+
3+
## Summary
4+
5+
Add automatic GitHub release creation when packages are published via changesets.
6+
7+
## Current State
8+
9+
The release workflow at `.github/workflows/release.yml` uses `changesets/action@v1` to:
10+
1. Create "Version Packages" PRs when changesets exist
11+
2. Publish packages to npm when the version PR is merged
12+
13+
**GitHub releases are NOT currently created.**
14+
15+
## Solution
16+
17+
Add the `createGithubReleases: true` option to the changesets action configuration. This is a single-line change.
18+
19+
## Files to Modify
20+
21+
### `.github/workflows/release.yml`
22+
23+
**Current:**
24+
```yaml
25+
- name: Create Release Pull Request or Publish to npm
26+
id: changesets
27+
uses: changesets/action@v1
28+
with:
29+
publish: pnpm release
30+
env:
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
33+
```
34+
35+
**After:**
36+
```yaml
37+
- name: Create Release Pull Request or Publish to npm
38+
id: changesets
39+
uses: changesets/action@v1
40+
with:
41+
publish: pnpm release
42+
createGithubReleases: true
43+
env:
44+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
46+
```
47+
48+
## Behavior After Change
49+
50+
When packages are published (after merging a "Version Packages" PR):
51+
- Packages are published to npm (existing behavior)
52+
- A GitHub release is automatically created for each published package
53+
- The release will include the changelog content from the changeset
54+
55+
## Verification
56+
57+
1. Merge this change to `main`
58+
2. Create a changeset: `pnpm changeset`
59+
3. Commit and push to `main`
60+
4. Wait for the "Version Packages" PR to be created
61+
5. Merge the "Version Packages" PR
62+
6. Verify that:
63+
- Packages are published to npm
64+
- GitHub releases appear in the repository's Releases page

0 commit comments

Comments
 (0)