Skip to content

Commit a856cf7

Browse files
committed
feat: add Changesets for automated npm releases
Add @changesets/cli with config linking manifest and @manifest/server packages. Mark backend and frontend as private to exclude from publishing. Add release workflow (changesets/action) for automated npm publishing on push to main, and changeset status check in CI for PRs. Rename @mnfst/manifest-server to @manifest/server.
1 parent 7771797 commit a856cf7

File tree

11 files changed

+1179
-24
lines changed

11 files changed

+1179
-24
lines changed

.changeset/README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Changesets
2+
3+
This folder is managed by [Changesets](https://github.com/changesets/changesets).
4+
5+
## Adding a changeset
6+
7+
When you make a change to a publishable package (`manifest` or `@manifest/server`), run:
8+
9+
```bash
10+
npx changeset
11+
```
12+
13+
Follow the prompts to select the affected packages and the semver bump type (patch / minor / major). This creates a markdown file in this folder describing the change.
14+
15+
Commit the changeset file along with your code changes.
16+
17+
## How releases work
18+
19+
1. PRs that include changeset files get merged into `main`.
20+
2. The release workflow opens a "Version Packages" PR that bumps versions and updates changelogs.
21+
3. When that PR is merged, the workflow publishes the new versions to npm.

.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://github.com/changesets/changesets/blob/main/packages/config/schema.json",
3+
"changelog": "@changesets/cli/changelog",
4+
"commit": false,
5+
"fixed": [],
6+
"linked": [["manifest", "@manifest/server"]],
7+
"access": "public",
8+
"baseBranch": "main",
9+
"updateInternalDependencies": "patch",
10+
"ignore": []
11+
}

.github/workflows/ci.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ jobs:
6666
cache: npm
6767
- run: npm ci
6868
- run: npm run build --workspace=packages/backend
69+
- name: Unit tests (SQLite dialect)
70+
run: npm test --workspace=packages/backend
6971
- name: E2E tests (SQLite in-memory)
7072
run: npm run test:e2e --workspace=packages/backend
7173

@@ -94,3 +96,18 @@ jobs:
9496
cache: npm
9597
- run: npm ci
9698
- run: npm test --workspace=packages/openclaw-plugin
99+
100+
changeset-check:
101+
name: Changeset status
102+
runs-on: ubuntu-latest
103+
if: github.event_name == 'pull_request'
104+
steps:
105+
- uses: actions/checkout@v4
106+
with:
107+
fetch-depth: 0
108+
- uses: actions/setup-node@v4
109+
with:
110+
node-version: 22
111+
cache: npm
112+
- run: npm ci
113+
- run: npx changeset status --since=origin/main

.github/workflows/release.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
permissions:
8+
contents: write
9+
pull-requests: write
10+
11+
jobs:
12+
release:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: actions/setup-node@v4
17+
with:
18+
node-version: 22
19+
cache: npm
20+
registry-url: https://registry.npmjs.org
21+
- run: npm ci
22+
- run: npm run build
23+
- uses: changesets/action@v1
24+
with:
25+
publish: npm run release
26+
version: npm run version-packages
27+
title: "chore: version packages"
28+
env:
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)