Skip to content

Commit dcfd892

Browse files
GenerQAQclaude
andcommitted
chore: release claude-code plugin v0.1.1 (#427)
- Bump version to 0.1.1 across package.json, plugin.json, marketplace.json - Add release.ts script with clean install before rebuild - Add package-release-claude-code.yaml CI workflow (version verify + git diff bundle check + GitHub Release) - Update AGENTS.md with Claude Code Plugin release instructions - Rebuild bundles from clean npm install Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent a03ab94 commit dcfd892

File tree

8 files changed

+12751
-3074
lines changed

8 files changed

+12751
-3074
lines changed

.claude-plugin/marketplace.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
{
22
"name": "memodb-io",
3-
"owner": { "name": "memodb-io" },
3+
"owner": {
4+
"name": "memodb-io"
5+
},
46
"plugins": [
57
{
68
"name": "acontext",
7-
"version": "0.1.0",
9+
"version": "0.1.1",
810
"source": "./src/packages/claude-code/plugin",
911
"description": "Skill memory layer for Claude Code - auto-capture, learn, and reuse skills"
1012
}
Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
name: Claude Code Plugin Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'package-claude-code/v*'
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: write
11+
12+
jobs:
13+
verify:
14+
name: Verify & Build
15+
runs-on: ubuntu-latest
16+
timeout-minutes: 10
17+
defaults:
18+
run:
19+
working-directory: src/packages/claude-code
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
23+
24+
- name: Set up Node.js
25+
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
26+
with:
27+
node-version: '20'
28+
29+
- name: Extract version from package.json
30+
id: pkg_version
31+
run: |
32+
VERSION=$(node -p "require('./package.json').version")
33+
echo "version=$VERSION" >> $GITHUB_OUTPUT
34+
echo "Package version: $VERSION"
35+
36+
- name: Extract version from tag
37+
id: tag_version
38+
env:
39+
GIT_REF: ${{ github.ref }}
40+
run: |
41+
if [[ "$GIT_REF" == refs/tags/* ]]; then
42+
TAG_NAME=${GIT_REF#refs/tags/package-claude-code/v}
43+
echo "version=$TAG_NAME" >> $GITHUB_OUTPUT
44+
echo "Tag version: $TAG_NAME"
45+
else
46+
echo "version=" >> $GITHUB_OUTPUT
47+
fi
48+
49+
- name: Verify tag matches package.json
50+
if: steps.tag_version.outputs.version != ''
51+
env:
52+
PKG_VERSION: ${{ steps.pkg_version.outputs.version }}
53+
TAG_VERSION: ${{ steps.tag_version.outputs.version }}
54+
run: |
55+
if [ "$PKG_VERSION" != "$TAG_VERSION" ]; then
56+
echo "Error: package.json version ($PKG_VERSION) does not match tag version ($TAG_VERSION)"
57+
exit 1
58+
fi
59+
echo "Version match: $PKG_VERSION"
60+
61+
- name: Verify plugin.json version
62+
env:
63+
PKG_VERSION: ${{ steps.pkg_version.outputs.version }}
64+
run: |
65+
PLUGIN_VERSION=$(node -p "require('./plugin/.claude-plugin/plugin.json').version")
66+
if [ "$PKG_VERSION" != "$PLUGIN_VERSION" ]; then
67+
echo "Error: plugin.json version ($PLUGIN_VERSION) does not match package.json ($PKG_VERSION)"
68+
echo "Hint: run 'npm run release -- $PKG_VERSION' to sync all versions"
69+
exit 1
70+
fi
71+
echo "plugin.json version: $PLUGIN_VERSION ✓"
72+
73+
- name: Verify marketplace.json version
74+
env:
75+
PKG_VERSION: ${{ steps.pkg_version.outputs.version }}
76+
run: |
77+
MKT_VERSION=$(node -p "require('../../../.claude-plugin/marketplace.json').plugins.find(p => p.name === 'acontext').version")
78+
if [ "$PKG_VERSION" != "$MKT_VERSION" ]; then
79+
echo "Error: marketplace.json version ($MKT_VERSION) does not match package.json ($PKG_VERSION)"
80+
echo "Hint: run 'npm run release -- $PKG_VERSION' to sync all versions"
81+
exit 1
82+
fi
83+
echo "marketplace.json version: $MKT_VERSION ✓"
84+
85+
- name: Install dependencies
86+
run: npm install
87+
88+
- name: Run tests
89+
run: npm test
90+
91+
- name: Save committed bundle checksums
92+
run: |
93+
sha256sum plugin/scripts/mcp-server.cjs plugin/scripts/hook-handler.cjs > /tmp/committed-checksums.txt
94+
echo "Committed checksums:"
95+
cat /tmp/committed-checksums.txt
96+
97+
- name: Build
98+
run: npm run build
99+
100+
- name: Verify build output
101+
run: |
102+
node -e "
103+
const fs = require('fs');
104+
const files = ['plugin/scripts/mcp-server.cjs', 'plugin/scripts/hook-handler.cjs'];
105+
for (const f of files) {
106+
if (!fs.existsSync(f)) { console.error('Missing: ' + f); process.exit(1); }
107+
const stat = fs.statSync(f);
108+
if (stat.size < 1000) { console.error('Suspiciously small: ' + f + ' (' + stat.size + ' bytes)'); process.exit(1); }
109+
console.log('OK: ' + f + ' (' + (stat.size / 1024).toFixed(0) + ' KB)');
110+
}
111+
"
112+
113+
- name: Verify bundles match committed artifacts
114+
run: |
115+
sha256sum plugin/scripts/mcp-server.cjs plugin/scripts/hook-handler.cjs > /tmp/rebuilt-checksums.txt
116+
echo "Rebuilt checksums:"
117+
cat /tmp/rebuilt-checksums.txt
118+
if ! diff /tmp/committed-checksums.txt /tmp/rebuilt-checksums.txt; then
119+
echo ""
120+
echo "Error: Committed bundles do not match a clean rebuild."
121+
echo "Hint: run 'npm run release -- X.Y.Z' to rebuild and commit the updated bundles."
122+
exit 1
123+
fi
124+
echo "Bundles match ✓"
125+
126+
create-release:
127+
name: Create GitHub Release
128+
runs-on: ubuntu-latest
129+
timeout-minutes: 10
130+
needs: verify
131+
steps:
132+
- name: Checkout repository
133+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
134+
135+
- name: Extract version from tag
136+
id: version
137+
env:
138+
GIT_REF: ${{ github.ref }}
139+
run: |
140+
TAG_NAME=${GIT_REF#refs/tags/package-claude-code/v}
141+
echo "version=$TAG_NAME" >> $GITHUB_OUTPUT
142+
143+
- name: Generate Changelog
144+
env:
145+
VERSION: ${{ steps.version.outputs.version }}
146+
CHANGELOG_FILE: ${{ github.workspace }}-CHANGELOG.txt
147+
run: |
148+
cat > "$CHANGELOG_FILE" << EOF
149+
# Claude Code Plugin v${VERSION}
150+
151+
## Installation
152+
153+
\`\`\`bash
154+
claude mcp add-from-marketplace acontext --publisher memodb-io
155+
\`\`\`
156+
157+
## Release Checklist
158+
- [x] Version synced across package.json, plugin.json, marketplace.json
159+
- [x] Tests passed
160+
- [x] Plugin bundles built and verified
161+
EOF
162+
163+
- name: Create Release
164+
uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2
165+
with:
166+
body_path: ${{ github.workspace }}-CHANGELOG.txt

AGENTS.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,22 @@ When releasing a new version, follow these steps in order:
5555
- Python SDK: update `version` in `src/client/acontext-py/pyproject.toml`
5656
- OpenClaw Plugin: update `"version"` in `src/packages/openclaw/package.json`, `version` in `src/packages/openclaw/index.ts` (the plugin object), **and** `expect(plugin.version)` in `src/packages/openclaw/tests/plugin.test.ts`
5757
- Sandbox Cloudflare: update `"version"` in `src/packages/sandbox-cloudflare/package.json`
58+
- Claude Code Plugin: run `npm run release -- X.Y.Z` in `src/packages/claude-code/` — this updates `package.json`, `plugin/.claude-plugin/plugin.json`, and `.claude-plugin/marketplace.json`, then rebuilds the plugin bundles automatically. Full steps:
59+
```bash
60+
cd src/packages/claude-code
61+
npm run release -- 0.1.1 # bump 3 version files + rebuild bundles
62+
cd ../../..
63+
git add -A && git commit -m "chore: release claude-code plugin v0.1.1"
64+
git tag package-claude-code/v0.1.1
65+
git push && git push --tags # triggers CI: version verify + GitHub Release
66+
```
67+
CI (`package-release-claude-code.yaml`) verifies that all 3 version files match the tag, runs tests, rebuilds bundles and checks that the rebuilt output matches the committed artifacts (catches forgotten rebuilds), then creates a GitHub Release. It does **not** publish to a registry — the plugin is distributed via the repo itself.
5868
2. **Regenerate the lock file** so it stays in sync:
5969
- TypeScript SDK: run `npm install` in `src/client/acontext-ts/` (updates `package-lock.json`)
6070
- Python SDK: run `uv lock` in `src/client/acontext-py/` (updates `uv.lock`)
6171
- OpenClaw Plugin: run `npm install` in `src/packages/openclaw/` (updates `package-lock.json`)
6272
- Sandbox Cloudflare: no lock file needed (template is synced from `src/server/sandbox/cloudflare` via `prepublishOnly` script)
73+
- Claude Code Plugin: no lock file needed (`npm run release` already rebuilds bundles)
6374
3. **Commit** the version bump + lock file changes.
6475
4. **Tag** the commit to trigger the CI/CD release pipeline. Each tag pattern maps to a specific workflow, publish target, and directory:
6576

@@ -73,6 +84,7 @@ When releasing a new version, follow these steps in order:
7384
| CLI | `cli/vX.Y.Z` | GitHub Releases (binaries) | `src/client/acontext-cli` | `release-cli.yaml` |
7485
| OpenClaw Plugin | `package-openclaw/vX.Y.Z` | npm (`@acontext/openclaw`) | `src/packages/openclaw` | `release-package-openclaw.yaml` |
7586
| Sandbox Cloudflare | `package-sandbox-cloudflare/vX.Y.Z` | npm (`@acontext/create-sandbox-cloudflare`) | `src/packages/sandbox-cloudflare` | `release-package-sandbox-cloudflare.yaml` |
87+
| Claude Code Plugin | `package-claude-code/vX.Y.Z` | Claude Plugin Marketplace | `src/packages/claude-code` | `release-package-claude-code.yaml` |
7688
| Helm Chart | `chart/vX.Y.Z` | ghcr.io (OCI helm chart) | `charts/acontext` | `release-helm.yaml` |
7789

7890
All workflows create a GitHub Release with changelog. Docker builds produce multi-platform images (`linux/amd64`, `linux/arm64`). npm/PyPI workflows skip publishing if the version already exists on the registry.

src/packages/claude-code/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@acontext/claude-code",
3-
"version": "0.1.0",
3+
"version": "0.1.1",
44
"private": true,
55
"description": "Acontext skill memory plugin for Claude Code — auto-capture, learn, and reuse skills",
66
"license": "Apache-2.0",
@@ -10,6 +10,7 @@
1010
},
1111
"scripts": {
1212
"build": "tsx build.ts",
13+
"release": "tsx release.ts",
1314
"clean": "rm -rf plugin/scripts/*.cjs",
1415
"test": "vitest run"
1516
},

src/packages/claude-code/plugin/.claude-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "acontext",
3-
"version": "0.1.0",
3+
"version": "0.1.1",
44
"description": "Skill memory layer for Claude Code — auto-capture, learn, and reuse skills from Acontext",
55
"author": {
66
"name": "memodb-io"

0 commit comments

Comments
 (0)