publish npm packages #1
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 npm packages | |
| on: | |
| workflow_dispatch: | |
| workflow_run: | |
| workflows: ["Continuous Integration"] | |
| branches: [main] | |
| types: | |
| - completed | |
| permissions: | |
| id-token: write | |
| contents: read | |
| jobs: | |
| publish: | |
| if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }} | |
| runs-on: ubuntu-latest | |
| environment: production | |
| steps: | |
| - name: Checkout Repo | |
| uses: actions/checkout@v4 | |
| - name: Setup Pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10.23.0 | |
| - name: Setup Node.js 22 | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| registry-url: "https://registry.npmjs.org" | |
| cache: "pnpm" | |
| - name: Install Dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Upgrade npm for trusted publishing | |
| run: npm install -g "npm@^11.5.1" | |
| - name: Build | |
| run: pnpm build | |
| - name: Publish packages | |
| run: pnpm exec changeset publish |