-
-
Notifications
You must be signed in to change notification settings - Fork 48
65 lines (57 loc) · 1.62 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: CI
on:
push:
branches:
- main
- alpha
- beta
pull_request:
jobs:
commitlint:
runs-on: ubuntu-latest
name: "Lint commit message"
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: wagoid/commitlint-github-action@v3
verify:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12, 14, 16]
name: "Verify (Node ${{ matrix.node-version }})"
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- run: npm ci --force
- run: npm run lint
- run: npm run build
- run: npm test
env:
CI: true
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
publish:
# publish only when merged in master on original repo, not on PR
if: github.repository == 'DamianOsipiuk/vue-query' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/beta' || github.ref == 'refs/heads/alpha')
needs: [verify, commitlint]
runs-on: ubuntu-latest
name: "Publish to NPM"
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 14
registry-url: https://registry.npmjs.org/
- run: npm ci --force
- run: npm run build
- run: npx semantic-release@17
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_AUTOMATION_TOKEN}}
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}