Version Packages (#3) #13
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: Release | |
| on: | |
| push: { branches: [main] } | |
| permissions: { contents: write, pull-requests: write, id-token: write } | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v4 | |
| with: { node-version: 20, cache: pnpm } | |
| - run: pnpm install --frozen-lockfile | |
| - run: pnpm build | |
| # Write the npm auth token ourselves so it is unambiguously used at publish | |
| # time (avoids the setup-node registry-url / NODE_AUTH_TOKEN mismatch). | |
| - run: | | |
| echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > "$HOME/.npmrc" | |
| env: | |
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| - uses: changesets/action@v1 | |
| with: { publish: pnpm release } | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| NPM_CONFIG_PROVENANCE: "true" |