ci: Version Packages (#442) #305
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, alpha, beta, rc] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.number || github.ref }} | |
| # Never cancel an in-flight release — a mid-publish cancellation can leave | |
| # partial versions on npm with no rollback. | |
| cancel-in-progress: false | |
| env: | |
| NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }} | |
| permissions: | |
| contents: read | |
| jobs: | |
| release: | |
| name: Release | |
| if: github.repository_owner == 'TanStack' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| id-token: write | |
| pull-requests: write | |
| # Configure required reviewers / wait timer for this environment in | |
| # repo settings → Environments → release. Until configured, this only | |
| # creates a deployment record (no gating). | |
| environment: release | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Setup Tools | |
| uses: TanStack/config/.github/setup@e4b48f16568324f76f467aa4c2aac2f05db632c3 # main | |
| - name: Run Tests | |
| run: pnpm run test:ci | |
| - name: Run Changesets (version or publish) | |
| id: changesets | |
| uses: changesets/action@6a0a831ff30acef54f2c6aa1cbbc1096b066edaf # v1.7.0 | |
| with: | |
| version: pnpm run changeset:version | |
| publish: pnpm run changeset:publish | |
| commit: 'ci: Version Packages' | |
| title: 'ci: Version Packages' | |
| - name: Comment on PRs about release | |
| if: steps.changesets.outputs.published == 'true' | |
| uses: TanStack/config/.github/comment-on-release@e4b48f16568324f76f467aa4c2aac2f05db632c3 # main | |
| with: | |
| published-packages: ${{ steps.changesets.outputs.publishedPackages }} |