Open History to see the last commit
1name: Release
2
3on:
4 push:
5 branches: [main, alpha, beta, rc]
6
7concurrency:
8 group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
9 cancel-in-progress: true
10
11env:
12 NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
13
14permissions:
15 contents: write
16 id-token: write
17 pull-requests: write
18
19jobs:
20 release:
21 name: Release
22 if: github.repository_owner == 'TanStack'
23 runs-on: ubuntu-latest
24 steps:
25 - name: Checkout
26 uses: actions/checkout@v6.0.1
27 with:
28 fetch-depth: 0
29 - name: Setup Tools
30 uses: tanstack/config/.github/setup@main
31 - name: Run Tests
32 run: pnpm run test:ci
33 - name: Run Changesets (version or publish)
34 id: changesets
35 uses: changesets/action@v1.5.3
36 with:
37 version: pnpm run changeset:version
38 publish: pnpm run changeset:publish
39 commit: "ci: Version Packages"
40 title: "ci: Version Packages"
41 env:
42 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43 - name: Generate Docs
44 if: steps.changesets.outputs.published == 'true'
45 run: pnpm generate-docs
46 - name: Commit Generated Docs
47 if: steps.changesets.outputs.published == 'true'
48 run: |
49 if [[ -n $(git status --porcelain) ]]; then
50 git config user.name "github-actions[bot]"
51 git config user.email "github-actions[bot]@users.noreply.github.com"
52 BRANCH_NAME="docs/auto-update-$(date +%s)"
53 git checkout -b $BRANCH_NAME
54 git add .
55 git commit -m "docs: regenerate API documentation"
56 git push origin $BRANCH_NAME
57 gh pr create --title "docs: regenerate API documentation" --body "Automated documentation update from release" --base main --head $BRANCH_NAME
58 fi
59 env:
60 GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
61 - name: Comment on PRs about release
62 if: steps.changesets.outputs.published == 'true'
63 uses: tanstack/config/.github/comment-on-release@main
64 with:
65 published-packages: ${{ steps.changesets.outputs.publishedPackages }}