0xmrpeter 2bdccd25a4 revert(ci): remove direct registry push, use PR-based approach instead
Plugin registry updates should go through PR → validate → auto-merge,
same flow as community plugins. Each plugin repo handles its own
registry PR via CI.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 10:13:45 +07:00

53 lines
1.3 KiB
YAML

name: Publish to npm
on:
push:
tags:
- 'v*'
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org
- run: pnpm install --frozen-lockfile
- name: Set version from tag
run: |
VERSION="${GITHUB_REF_NAME#v}"
echo "VERSION=$VERSION" >> $GITHUB_ENV
node -e "
const fs = require('fs');
const pkg = JSON.parse(fs.readFileSync('package.json', 'utf-8'));
pkg.version = '$VERSION';
fs.writeFileSync('package.json', JSON.stringify(pkg, null, 2) + '\n');
"
- name: Build CLI types (needed by SDK)
run: pnpm build
- run: pnpm build:publish
- name: Publish @openacp/cli
working-directory: dist-publish
run: npm publish --access=public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish @openacp/plugin-sdk
if: hashFiles('dist-publish-sdk/package.json') != ''
working-directory: dist-publish-sdk
run: npm publish --access=public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}