Publish NPM packages #10
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 | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| publish: | |
| # prevents this action from running on forks | |
| if: github.repository == 'thesysdev/create-c1-app' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4.1.0 | |
| with: | |
| version: 9 | |
| - name: Set node version to 22 | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| registry-url: https://registry.npmjs.org/ | |
| - name: Install deps | |
| run: pnpm install | |
| - name: Build package | |
| run: pnpm run build | |
| - name: Publish package | |
| run: npm publish | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |