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

ci.yml

57 lines1.6 KB

1name: ci
2​
3on:
4 workflow_dispatch:
5 inputs:
6 tag:
7 description: override release tag
8 required: false
9 push:
10 branches: [main, alpha, beta]
11​
12concurrency:
13 group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
14 cancel-in-progress: true
15​
16env:
17 NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
18​
19permissions:
20 contents: write
21 id-token: write
22​
23jobs:
24 test-and-publish:
25 name: Test & Publish
26 if: github.repository == 'TanStack/form'
27 runs-on: ubuntu-latest
28 steps:
29 - name: Checkout
30 uses: actions/checkout@v4
31 with:
32 fetch-depth: 0
33 - name: Start Nx Agents
34 run: npx nx-cloud start-ci-run --distribute-on=".nx/workflows/dynamic-changesets.yaml"
35 - name: Setup Tools
36 uses: tanstack/config/.github/setup@main
37 - name: Run Tests
38 run: pnpm run test:ci --parallel=3
39 - name: Stop Nx Agents
40 if: ${{ always() }}
41 run: npx nx-cloud stop-all-agents
42 - name: Publish
43 run: |
44 git config --global user.name 'Tanner Linsley'
45 git config --global user.email 'tannerlinsley@users.noreply.github.com'
46 npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
47 pnpm run cipublish
48 env:
49 GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50 NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
51 TAG: ${{ inputs.tag }}
52 - name: Upload coverage to Codecov
53 uses: codecov/codecov-action@v4
54 with:
55 directory: packages
56 env:
57 CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}