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

ci.yml

57 lines1.8 KB

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