eb4afc6ef7
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
45 lines
1.2 KiB
YAML
45 lines
1.2 KiB
YAML
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
|