Merge pull request #111 from IntersectMBO/changeset-release/main #108
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 | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| id-token: write | |
| concurrency: ${{ github.workflow }}-${{ github.ref }} | |
| jobs: | |
| release: | |
| name: π Release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: β¬οΈ Checkout repo | |
| uses: actions/checkout@v4 | |
| with: | |
| # This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits | |
| fetch-depth: 0 | |
| - name: π¦ Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| - name: β Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: 'pnpm' | |
| registry-url: 'https://registry.npmjs.org/' | |
| - name: π¦ Update npm to latest (required for trusted publishing) | |
| run: npm install -g npm@latest | |
| - name: π¦ Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: π Build packages | |
| run: pnpm turbo run build | |
| - name: π§ͺ Run tests | |
| run: pnpm turbo run test | |
| - name: π¦ Create Release Pull Request or Publish to npm | |
| id: changesets | |
| uses: changesets/action@v1 | |
| continue-on-error: true | |
| with: | |
| # This uses our custom publish script that builds before publishing | |
| publish: pnpm changeset-publish | |
| title: "ci(changesets): version packages" | |
| commit: "ci(changesets): version packages" | |
| createGithubReleases: true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| NPM_CONFIG_PROVENANCE: true |