feat: add Claude Code plugin packaging + update Actions to Node 22 #2
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: | |
| push: | |
| tags: | |
| - 'v*' | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-node@v5 | |
| with: | |
| node-version: 22 | |
| registry-url: https://registry.npmjs.org | |
| - run: npm ci | |
| - name: Check if version already published | |
| id: check | |
| run: | | |
| PKG_NAME=$(node -p "require('./package.json').name") | |
| PKG_VER=$(node -p "require('./package.json').version") | |
| PUBLISHED=$(npm view "$PKG_NAME@$PKG_VER" version 2>/dev/null || echo "") | |
| if [ "$PUBLISHED" = "$PKG_VER" ]; then | |
| echo "skip=true" >> $GITHUB_OUTPUT | |
| echo "Version $PKG_VER already published, skipping." | |
| else | |
| echo "skip=false" >> $GITHUB_OUTPUT | |
| fi | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| - run: npm publish --access public | |
| if: steps.check.outputs.skip != 'true' | |
| continue-on-error: true | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |