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: ['main', 'alpha', 'beta', 'rc', 'v4']
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 NX_CLOUD_AUTH_TOKEN: ${{ secrets.NX_CLOUD_AUTH_TOKEN }}
19β
20jobs:
21 test-and-publish:
22 name: Test & Publish
23 if: github.repository == 'TanStack/query'
24 runs-on: ubuntu-latest
25 steps:
26 - name: Checkout
27 uses: actions/checkout@v4
28 with:
29 fetch-depth: '0'
30 - name: Setup pnpm
31 uses: pnpm/action-setup@v2
32 with:
33 version: 8
34 - name: Setup Node
35 uses: actions/setup-node@v4
36 with:
37 node-version-file: .nvmrc
38 cache: pnpm
39 - name: Install dependencies
40 run: pnpm install --frozen-lockfile --prefer-offline
41 - name: Run Tests
42 run: pnpm run test:ci
43 - name: Publish
44 run: |
45 git config --global user.name 'Tanner Linsley'
46 git config --global user.email 'tannerlinsley@users.noreply.github.com'
47 npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
48 pnpm run cipublish
49 env:
50 GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
51 GH_TOKEN: ${{ secrets.GH_TOKEN }}
52 NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
53 NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
54 TAG: ${{ inputs.tag }}
55 - name: Upload coverage to Codecov
56 uses: codecov/codecov-action@v3
57 with:
58 directory: packages