publish doccape n8n #6
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 Package to npmjs | |
| on: | |
| push: | |
| branches: | |
| - master | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| id-token: write | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v4 | |
| - name: Set Up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20.x' | |
| registry-url: 'https://registry.npmjs.org' | |
| - uses: pnpm/action-setup@v3 | |
| with: | |
| version: 10 | |
| - name: Install Dependencies | |
| run: pnpm install | |
| - name: Build Package | |
| run: pnpm build | |
| - name: Extract Version from package.json | |
| id: version | |
| run: echo "VERSION=$(node -p 'require(\"./package.json\").version')" >> $GITHUB_ENV | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: v${{ env.VERSION }} | |
| release_name: Release v${{ env.VERSION }} | |
| body: | | |
| Automatically generated release from push to master branch. | |
| - name: Publish to npm | |
| run: pnpm publish --provenance --access public | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |