Skip to content

Commit 201b4e7

Browse files
committed
feat: add automated release workflow with changesets
- Implement GitHub Actions workflow for automated versioning and publishing - Add changeset configuration for monorepo version management - Update documentation with changeset workflow instructions - Remove manual publish workflow in favor of automated approach
1 parent 1988fa3 commit 201b4e7

File tree

6 files changed

+125
-53
lines changed

6 files changed

+125
-53
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
"@mcp-pointer/server": patch
3+
"@mcp-pointer/shared": patch
4+
---
5+
6+
Add automated release workflow with changesets
7+
8+
- Implement GitHub Actions workflow for automated versioning and publishing
9+
- Add changeset configuration for monorepo version management
10+
- Update documentation with changeset workflow instructions
11+
- Remove manual publish workflow in favor of automated approach

.changeset/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"linked": [
77
["@mcp-pointer/server", "@mcp-pointer/shared", "@mcp-pointer/chrome-extension"]
88
],
9-
"access": "restricted",
9+
"access": "public",
1010
"baseBranch": "main",
1111
"updateInternalDependencies": "patch",
1212
"ignore": [],

.github/workflows/publish-server.yml

Lines changed: 0 additions & 41 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
concurrency: ${{ github.workflow }}-${{ github.ref }}
9+
10+
permissions:
11+
contents: write
12+
pull-requests: write
13+
id-token: write # Required for npm provenance
14+
15+
jobs:
16+
release:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
22+
- name: Setup Node.js
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: '20'
26+
registry-url: 'https://registry.npmjs.org'
27+
28+
- name: Setup pnpm
29+
uses: pnpm/action-setup@v2
30+
with:
31+
version: latest
32+
33+
- name: Install dependencies
34+
run: pnpm install --frozen-lockfile
35+
36+
- name: Build all packages
37+
run: pnpm build
38+
39+
- name: Run tests
40+
run: pnpm test
41+
42+
- name: Create Release Pull Request or Publish to npm
43+
id: changesets
44+
uses: changesets/action@v1
45+
with:
46+
publish: pnpm release
47+
env:
48+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

CONTRIBUTING.md

Lines changed: 62 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -454,19 +454,71 @@ Include screenshots for UI changes
454454

455455
## 📋 Release Process
456456

457-
This project uses automated publishing:
457+
This project uses **Changesets** for automated versioning and publishing. Contributors add changeset files to describe their changes, and maintainers manage releases through automated PRs.
458458

459-
1. **Create a PR** with your changes
460-
2. **Get it reviewed** and merged
461-
3. **Create a release** on GitHub to trigger publishing
462-
4. **Automated CI** handles building and npm publishing
459+
### Using Changesets
460+
461+
When you make changes that should trigger a new release, add a changeset:
463462

464-
For maintainers only:
465463
```bash
466-
# Create a release
467-
git tag v0.2.0
468-
git push origin v0.2.0
469-
# Or use GitHub's release UI
464+
# Add a changeset describing your changes
465+
pnpm changeset
466+
```
467+
468+
This will prompt you to:
469+
1. **Select packages** that should be updated
470+
2. **Choose version bump type** (patch/minor/major)
471+
3. **Write a summary** of your changes
472+
473+
Example changeset session:
474+
```
475+
🦋 Which packages would you like to include?
476+
◉ @mcp-pointer/server
477+
◉ @mcp-pointer/shared
478+
◯ @mcp-pointer/chrome-extension
479+
480+
🦋 Which packages should have a major bump?
481+
◯ @mcp-pointer/server
482+
◯ @mcp-pointer/shared
483+
484+
🦋 Which packages should have a minor bump?
485+
◉ @mcp-pointer/server
486+
◯ @mcp-pointer/shared
487+
488+
🦋 Please enter a summary for this change
489+
Added WebSocket connection retry logic with exponential backoff
490+
```
491+
492+
### Version Types
493+
494+
- **Patch** (0.1.0 → 0.1.1): Bug fixes, small improvements
495+
- **Minor** (0.1.0 → 0.2.0): New features, backwards compatible
496+
- **Major** (0.1.0 → 1.0.0): Breaking changes
497+
498+
### Creating a Release
499+
500+
**For maintainers only:**
501+
502+
1. **Review pending changesets** in `.changeset/` folder
503+
2. **Push to main** - GitHub Actions will create a "Version Packages" PR
504+
3. **Review the Version PR** - Check version bumps and changelog
505+
4. **Merge the Version PR** - Packages are published automatically
506+
507+
The automated workflow:
508+
- Creates git tags (e.g., `@mcp-pointer/server@0.3.1`)
509+
- Publishes to npm with provenance
510+
- Creates GitHub releases with changelogs
511+
- Handles monorepo versioning automatically
512+
513+
### Release Workflow
514+
515+
```mermaid
516+
graph LR
517+
A[Add Changeset] --> B[Push to Main]
518+
B --> C[Version PR Created]
519+
C --> D[Review & Merge PR]
520+
D --> E[Auto Publish to npm]
521+
E --> F[Git Tags & GitHub Releases]
470522
```
471523

472524
## 🎯 Contribution Ideas

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
"test": "cd packages/server && pnpm test",
1212
"typecheck": "tsc --noEmit",
1313
"changeset": "changeset",
14-
"version": "changeset version"
14+
"version": "changeset version",
15+
"release": "changeset publish"
1516
},
1617
"devDependencies": {
1718
"@changesets/cli": "^2.27.9",

0 commit comments

Comments
 (0)