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

test-and-publish.yml

47 lines1.3 KB

1name: react-query tests
2​
3on:
4 push:
5 branches:
6 - 'master'
7 - 'next'
8 - 'beta'
9 - '1.x'
10 - '2.x'
11 pull_request:
12​
13jobs:
14 test:
15 name: 'Node ${{ matrix.node }}'
16 runs-on: ubuntu-latest
17 strategy:
18 matrix:
19 node: [10, 12, 14]
20 steps:
21 - uses: actions/checkout@v2
22 - uses: actions/setup-node@v1
23 with:
24 node-version: ${{ matrix.node }}
25 - name: Install dependencies
26 uses: bahmutov/npm-install@v1
27 - run: yarn test:ci
28​
29 publish-module:
30 name: 'Publish Module to NPM'
31 needs: test
32 # publish only when merged in master on original repo, not on PR
33 if: github.repository == 'tannerlinsley/react-query' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/next' || github.ref == 'refs/heads/beta' || github.ref == 'refs/heads/1.x' || github.ref == 'refs/heads/2.x')
34 runs-on: ubuntu-latest
35 steps:
36 - uses: actions/checkout@v2
37 - uses: actions/setup-node@v1
38 with:
39 node-version: 14
40 registry-url: https://registry.npmjs.org/
41 - name: Install dependencies
42 uses: bahmutov/npm-install@v1
43 - run: yarn build
44 - run: npx semantic-release@17
45 env:
46 NODE_AUTH_TOKEN: ${{secrets.npm_token}}
47 GH_TOKEN: ${{secrets.GH_TOKEN}}