Skip to content

Commit 288e8bc

Browse files
munessMuness Castleclaude
authored
feat: add npm publishing for opencode plugin (#53)
* feat: add npm publishing for opencode plugin - Rename package from @cloud-atlas-ai/bottle to @open-horizon-labs/bottle-opencode - Add publish-npm job to release workflow for automated npm publishing - Uses OIDC provenance for supply chain security Co-Authored-By: Claude Opus 4.5 <[email protected]> * chore: address superego review feedback - Add _versionNote field to package.json explaining version is set at publish time - Add build verification step to check dist/index.js exists before npm publish - Add comment explaining why npm upgrade is needed (Node 22 has npm 10.x, OIDC requires 11.5.1+) Co-Authored-By: Claude Opus 4.5 <[email protected]> * chore: update wm-opencode to 0.3.8 --------- Co-authored-by: Muness Castle <[email protected]> Co-authored-by: Claude Opus 4.5 <[email protected]>
1 parent e8cca5f commit 288e8bc

File tree

3 files changed

+64
-6
lines changed

3 files changed

+64
-6
lines changed

.github/workflows/release.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,3 +388,59 @@ jobs:
388388
env:
389389
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
390390
run: cargo publish --allow-dirty
391+
392+
# =============================================================================
393+
# PUBLISH: npm (OpenCode plugin)
394+
# =============================================================================
395+
publish-npm:
396+
name: Publish npm
397+
needs: [plan, release]
398+
runs-on: ubuntu-latest
399+
if: needs.plan.outputs.is_release == 'true' && needs.plan.outputs.is_dry_run != 'true'
400+
environment: npm
401+
permissions:
402+
contents: read
403+
id-token: write
404+
steps:
405+
- uses: actions/checkout@v4
406+
407+
- name: Setup Bun
408+
uses: oven-sh/setup-bun@v2
409+
410+
- name: Setup Node for npm publish
411+
uses: actions/setup-node@v4
412+
with:
413+
node-version: '22'
414+
registry-url: 'https://registry.npmjs.org'
415+
416+
# Node 22 ships with npm 10.x, but OIDC trusted publishing requires npm 11.5.1+
417+
- name: Upgrade npm for OIDC support
418+
run: npm install -g npm@latest
419+
420+
- name: Extract version from tag
421+
id: version
422+
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT
423+
424+
- name: Update package.json version
425+
working-directory: opencode-plugin
426+
run: |
427+
jq --arg v "${{ steps.version.outputs.VERSION }}" '.version = $v' package.json > package.json.tmp
428+
mv package.json.tmp package.json
429+
430+
- name: Install dependencies
431+
working-directory: opencode-plugin
432+
run: bun install
433+
434+
- name: Build
435+
working-directory: opencode-plugin
436+
run: bun run build
437+
438+
- name: Verify build output
439+
working-directory: opencode-plugin
440+
run: test -f dist/index.js
441+
442+
- name: Publish to npm
443+
working-directory: opencode-plugin
444+
run: npm publish --access public --provenance
445+
env:
446+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

bottles/stable/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"@cloud-atlas-ai/bottle": "0.2.6",
66
"ba-opencode": "0.2.1",
77
"superego-opencode": "0.9.1",
8-
"wm-opencode": "0.1.0"
8+
"wm-opencode": "0.3.8"
99
},
1010
"plugins": [
1111
"ba",

opencode-plugin/package.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
2-
"name": "@cloud-atlas-ai/bottle",
3-
"version": "0.2.7",
4-
"description": "Open Horizon Labs thin wrapper plugin for OpenCode - invokes bottle CLI",
2+
"name": "@open-horizon-labs/bottle-opencode",
3+
"_versionNote": "Version is set at publish time from git tag",
4+
"version": "0.1.0",
5+
"description": "Bottle snapshot manager plugin for OpenCode - CLI wrapper for the Open Horizon Labs tool stack",
56
"type": "module",
67
"main": "dist/index.js",
78
"types": "dist/index.d.ts",
@@ -14,15 +15,16 @@
1415
"opencode-plugin",
1516
"ai",
1617
"bottle",
17-
"cloud-atlas"
18+
"open-horizon-labs"
1819
],
1920
"author": {
2021
"name": "Open Horizon Labs",
2122
"email": "[email protected]"
2223
},
2324
"repository": {
2425
"type": "git",
25-
"url": "git+https://github.com/open-horizon-labs/bottle.git"
26+
"url": "git+https://github.com/open-horizon-labs/bottle.git",
27+
"directory": "opencode-plugin"
2628
},
2729
"license": "MIT",
2830
"devDependencies": {

0 commit comments

Comments
 (0)