Skip to content
Source
Sign inSign up
TanStack/query
Open History to see the last commit

release.yml

81 lines2.6 KB

1name: Release
2​
3on:
4 push:
5 branches: [main, alpha, beta, rc, v4]
6 repository_dispatch:
7 types: [release]
8​
9concurrency:
10 group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
11 cancel-in-progress: true
12​
13env:
14 NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
15​
16permissions:
17 contents: write
18 id-token: write
19 pull-requests: write
20​
21jobs:
22 release:
23 name: Release
24 if: github.repository_owner == 'TanStack'
25 runs-on: ubuntu-latest
26 steps:
27 - name: Checkout
28 uses: actions/checkout@v5.0.0
29 with:
30 fetch-depth: 0
31 - name: Start Nx Agents
32 run: npx nx-cloud start-ci-run --distribute-on=".nx/workflows/dynamic-changesets.yaml"
33 - name: Setup Tools
34 uses: tanstack/config/.github/setup@main
35 - name: Run Tests
36 run: pnpm run test:ci
37 - name: Stop Nx Agents
38 if: ${{ always() }}
39 run: npx nx-cloud stop-all-agents
40 # - name: Check for Changesets marked as major
41 # id: major
42 # run: |
43 # echo "found=false" >> $GITHUB_OUTPUT
44 # regex="(major)"
45 # shopt -s nullglob
46 # for file in .changeset/*.md; do
47 # if [[ $(cat $file) =~ $regex ]]; then
48 # echo "found=true" >> $GITHUB_OUTPUT
49 # fi
50 # done
51 - name: Run Changesets (version or publish)
52 id: changesets
53 uses: changesets/action@v1.5.3
54 with:
55 version: pnpm run changeset:version
56 publish: pnpm run changeset:publish
57 commit: 'ci: Version Packages'
58 title: 'ci: Version Packages'
59 env:
60 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
61 NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
62 # - name: Auto-merge Changesets PR
63 # if: steps.changesets.outputs.hasChangesets == 'true' && steps.major.outputs.found == 'false'
64 # run: |
65 # gh pr merge --squash "$PR_NUMBER"
66 # gh api --method POST /repos/$REPO/dispatches -f 'event_type=release'
67 # env:
68 # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
69 # REPO: ${{ github.repository }}
70 # PR_NUMBER: ${{ steps.changesets.outputs.pullRequestNumber }}
71 - name: Upload coverage to Codecov
72 uses: codecov/codecov-action@v4.6.0
73 with:
74 directory: packages
75 env:
76 CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
77 - name: Comment on PRs about release
78 if: steps.changesets.outputs.published == 'true'
79 uses: tanstack/config/.github/comment-on-release@main
80 with:
81 published-packages: ${{ steps.changesets.outputs.publishedPackages }}