Open History to see the last commit
1name: ci
2β
3on:
4 workflow_dispatch:
5 inputs:
6 tag:
7 description: override release tag
8 required: false
9 push:
10 branches:
11 - 'main'
12 - 'alpha'
13 - 'beta'
14 - 'rc'
15β
16concurrency:
17 group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
18 cancel-in-progress: true
19β
20env:
21 NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
22 NX_CLOUD_AUTH_TOKEN: ${{ secrets.NX_CLOUD_AUTH_TOKEN }}
23β
24jobs:
25 test-and-publish:
26 if: github.repository == 'TanStack/query' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/alpha' || github.ref == 'refs/heads/beta' || github.ref == 'refs/heads/rc')
27 name: 'Test & Publish'
28 runs-on: ubuntu-latest
29 steps:
30 - uses: actions/checkout@v4
31 with:
32 fetch-depth: '0'
33 - uses: pnpm/action-setup@v2
34 with:
35 version: 8
36 - uses: actions/setup-node@v3
37 with:
38 registry-url: https://registry.npmjs.org/
39 node-version-file: .nvmrc
40 cache: pnpm
41 cache-dependency-path: pnpm-lock.yaml
42 - name: Install dependencies
43 run: pnpm --filter "./packages/**" --filter query --prefer-offline install
44 - name: Run Tests
45 uses: nick-fields/retry@v2.8.3
46 with:
47 command: pnpm run test:ci
48 timeout_minutes: 10
49 max_attempts: 3
50 - name: Publish
51 run: |
52 git config --global user.name 'Tanner Linsley'
53 git config --global user.email 'tannerlinsley@users.noreply.github.com'
54 npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
55 pnpm run cipublish
56 env:
57 GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
58 GH_TOKEN: ${{ secrets.GH_TOKEN }}
59 NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
60 NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
61 TAG: ${{ inputs.tag }}
62 - name: Upload coverage to Codecov
63 uses: codecov/codecov-action@v3