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