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

ci.yml

58 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_VERBOSE_LOGGING: true
19 NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
20jobs:
21 test-and-publish:
22 if: github.repository == 'TanStack/query' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/alpha' || github.ref == 'refs/heads/beta')
23 name: 'Test & Publish'
24 runs-on: ubuntu-latest
25 steps:
26 - uses: actions/checkout@v3
27 with:
28 fetch-depth: '0'
29 - uses: pnpm/action-setup@v2.2.4
30 with:
31 version: 7
32 - uses: actions/setup-node@v3
33 with:
34 node-version: 16.14.2
35 registry-url: https://registry.npmjs.org/
36 cache: 'pnpm'
37 - name: Install dependencies
38 run: pnpm --filter "./packages/**" --filter query --prefer-offline install
39 - name: Run Tests
40 uses: nick-fields/retry@v2.8.3
41 with:
42 command: pnpm run test:ci --base=${{ github.event.before }}
43 timeout_minutes: 10
44 max_attempts: 3
45 - name: Publish
46 run: |
47 git config --global user.name 'Tanner Linsley'
48 git config --global user.email 'tannerlinsley@users.noreply.github.com'
49 npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
50 pnpm run cipublish
51 env:
52 GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
53 GH_TOKEN: ${{ secrets.GH_TOKEN }}
54 NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
55 NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
56 TAG: ${{ inputs.tag }}
57 - name: Upload coverage to Codecov
58 uses: codecov/codecov-action@v3