Skip to content

armgit / mem0

Public Imported from GitHub
0

The Memory Layer for AI Agents - Drop-in memory infrastructure for AI agents and apps. Context that persists. Built for production.

ci(opencode-plugin): add build & publish workflows for @mem0/opencode-plugin (#5287)

Saket Aryaneb4afc6ef7e3
diff --git a/.github/workflows/opencode-plugin-cd.yml b/.github/workflows/opencode-plugin-cd.yml
new file mode 100644
index 000000000..746569aa8
--- /dev/null
+++ b/.github/workflows/opencode-plugin-cd.yml
@@ -0,0 +1,44 @@
+name: Publish @mem0/opencode-plugin 📦 to npm
+
+on:
+ release:
+ types: [published]
+
+jobs:
+ build-n-publish:
+ name: Build and publish @mem0/opencode-plugin 📦 to npm
+ if: startsWith(github.event.release.tag_name, 'opencode-v')
+ runs-on: ubuntu-latest
+ permissions:
+ id-token: write
+ defaults:
+ run:
+ working-directory: mem0-plugin/.opencode-plugin
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Install Bun
+ uses: oven-sh/setup-bun@v2
+ with:
+ bun-version: latest
+
+ - name: Set up Node.js
+ uses: actions/setup-node@v4
+ with:
+ node-version: '22'
+ registry-url: 'https://registry.npmjs.org'
+
+ - name: Install dependencies
+ run: bun install --frozen-lockfile
+
+ - name: Build
+ run: bun run build
+
+ - name: Publish to npm
+ run: |
+ if [ "${{ github.event.release.prerelease }}" = "true" ]; then
+ PREID=$(node -p "require('./package.json').version.split('-')[1].split('.')[0]")
+ npx npm@latest publish --provenance --access public --tag "$PREID"
+ else
+ npx npm@latest publish --provenance --access public
+ fi
diff --git a/.github/workflows/opencode-plugin-checks.yml b/.github/workflows/opencode-plugin-checks.yml
new file mode 100644
index 000000000..032e8817a
--- /dev/null
+++ b/.github/workflows/opencode-plugin-checks.yml
@@ -0,0 +1,40 @@
+name: opencode-plugin checks
+
+on:
+ workflow_dispatch:
+ push:
+ branches: [main]
+ paths:
+ - 'mem0-plugin/.opencode-plugin/**'
+ - '.github/workflows/opencode-plugin-checks.yml'
+ pull_request:
+ paths:
+ - 'mem0-plugin/.opencode-plugin/**'
+ - '.github/workflows/opencode-plugin-checks.yml'
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ defaults:
+ run:
+ working-directory: mem0-plugin/.opencode-plugin
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Install Bun
+ uses: oven-sh/setup-bun@v2
+ with:
+ bun-version: latest
+
+ - name: Install dependencies
+ run: bun install --frozen-lockfile
+
+ - name: Type check
+ run: bun run type-check
+
+ - name: Build
+ run: bun run build
+
+ - name: Verify dist output exists
+ run: |
+ test -f dist/index.js || (echo "Build output missing: dist/index.js" && exit 1)
diff --git a/AGENTS.md b/AGENTS.md
index 7754b84a2..bc40190b3 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -413,6 +413,7 @@ To add a new LLM, embedding, vector store, or reranker provider:
| Python CLI | `cli-python-ci.yml` | Push to `cli/python/`, PRs, manual | Ruff lint + pytest + hatch build on Python 3.10, 3.11, 3.12 |
| Node CLI | `cli-node-ci.yml` | Push to `cli/node/`, PRs, manual | Biome lint + tsc + vitest + tsup build on Node 20, 22 |
| OpenClaw | `openclaw-checks.yml` | Push to `openclaw/`, PRs, manual | tsc + vitest (with Codecov) + tsup build on Node 20, 22 |
+| OpenCode Plugin | `opencode-plugin-checks.yml` | Push to `mem0-plugin/.opencode-plugin/`, PRs, manual | Bun: tsc type-check + build + dist artifact check |
### CD Workflows (automated publishing)
@@ -424,6 +425,7 @@ To add a new LLM, embedding, vector store, or reranker provider:
| Node CLI | `cli-node-cd.yml` | `cli-node-v*` | npm (`@mem0/cli`) |
| Vercel AI SDK | `vercel-ai-cd.yml` | `vercel-ai-v*` | npm (`@mem0/vercel-ai-provider`) |
| OpenClaw | `openclaw-cd.yml` | `openclaw-v*` | npm (`@mem0/openclaw-mem0`) |
+| OpenCode Plugin | `opencode-plugin-cd.yml` | `opencode-v*` | npm (`@mem0/opencode-plugin`) |
- All publishing uses **OIDC trusted publishing** — no tokens or secrets required.
- First publish of a new npm package must be done manually; OIDC works for subsequent versions.