|
| 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