v0.2.6 #7
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Publish to npm | |
| on: | |
| release: | |
| types: [published] | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| registry-url: 'https://registry.npmjs.org' | |
| - run: npm ci | |
| - run: npm run build | |
| - run: npm run lint | |
| - run: npm test | |
| - run: npm publish --access public | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| # Sync plugin bundle to axme-code-plugin repo | |
| - name: Sync plugin repo | |
| env: | |
| PLUGIN_REPO_TOKEN: ${{ secrets.PLUGIN_REPO_TOKEN }} | |
| run: | | |
| git clone https://x-access-token:${PLUGIN_REPO_TOKEN}@github.com/AxmeAI/axme-code-plugin.git /tmp/plugin-repo | |
| cd /tmp/plugin-repo | |
| # Remove old files (except .git and .gitignore) | |
| ls -A | grep -v '^\.\(git\|gitignore\)$' | xargs rm -rf | |
| # Copy new plugin bundle | |
| cp -r ${GITHUB_WORKSPACE}/dist/plugin/. . | |
| cp ${GITHUB_WORKSPACE}/dist/plugin/.mcp.json . | |
| cp -r ${GITHUB_WORKSPACE}/dist/plugin/.claude-plugin . | |
| # Remove sourcemaps and node_modules (not needed in repo) | |
| rm -f *.map | |
| rm -rf node_modules package-lock.json | |
| git config user.name "github-actions" | |
| git config user.email "[email protected]" | |
| git add -A | |
| git commit -m "sync: ${GITHUB_REF_NAME} from axme-code" || echo "No changes to commit" | |
| git push |