Repository navigation
Merge pull request #21 from TanStack/taren/fix-release-cli #9
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] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.number || github.ref }} | |
| cancel-in-progress: true | |
| 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 | |
| actions: write | |
| 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 | |
| - name: Run Tests | |
| run: pnpm run verify | |
| - name: Run Changesets (version or publish) | |
| id: changesets | |
| uses: changesets/action@63a615b9cd06ba9a3e6d13796c7fbcb080a60a0b # v1.8.0 | |
| with: | |
| version: pnpm run release:version | |
| publish: pnpm run release:publish | |
| commit: 'ci: Version Packages' | |
| title: 'ci: Version Packages' | |
| - name: Run CI on the release pull request | |
| if: steps.changesets.outputs.pullRequestNumber != '' | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| RELEASE_PR: ${{ steps.changesets.outputs.pullRequestNumber }} | |
| # Dispatch CI because PRs created with GITHUB_TOKEN do not trigger it. | |
| run: | | |
| RELEASE_BRANCH=$(gh pr view "$RELEASE_PR" --json headRefName --jq .headRefName) | |
| gh workflow run ci.yml --ref "$RELEASE_BRANCH" |