-
Notifications
You must be signed in to change notification settings - Fork 17
110 lines (104 loc) · 3.03 KB
/
main.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
name: build
on:
- push
- workflow_dispatch
jobs:
install:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
- uses: actions/setup-node@v3
with:
node-version: 18
cache: npm
- run: npm install
lint:
needs: install
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
- uses: actions/setup-node@v3
with:
node-version: 18
cache: npm
- run: npm install
- run: npm run lint
verify-api:
needs: install
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
- uses: actions/setup-node@v3
with:
node-version: 18
cache: npm
- run: npm install
- run: npm run check-missing-api
test:
needs: install
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
- uses: actions/setup-node@v3
with:
node-version: 18
cache: npm
- run: npm install
- run: npm run build:lib
- run: npm run test:ci
- uses: actions/upload-artifact@v3
with:
name: tests-coverage
path: coverage/
if-no-files-found: error
- uses: coverallsapp/github-action@v2
with:
file: ./coverage/ngx-matomo-client/lcov.info
flag-name: ngx-matomo-client
github-token: ${{ secrets.GITHUB_TOKEN }}
publish-npm:
needs: [lint, test, verify-api]
runs-on: ubuntu-latest
env:
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}
GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }}
GIT_AUTHOR_NAME: ${{ secrets.GIT_AUTHOR_NAME }}
GIT_AUTHOR_EMAIL: ${{ secrets.GIT_AUTHOR_EMAIL }}
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
- uses: actions/setup-node@v3
with:
node-version: 18
cache: npm
- run: echo -n "${GPG_SECRET_KEY}" > git_gpg_key.asc
- run: gpg --batch --yes --import git_gpg_key.asc
- run: git config user.name ${GIT_AUTHOR_NAME}
- run: git config user.email ${GIT_AUTHOR_EMAIL}
- run: git config commit.gpgsign true
- run: git config --global user.signingkey ${GPG_KEY_ID}
- run: npm install
- run: npm run build:prod:lib
- uses: actions/upload-artifact@v3
with:
name: dist-prod
path: dist-prod
if-no-files-found: error
- run: npm run semantic-release:ci
env:
GITHUB_TOKEN: ${{ secrets.CUSTOM_GITHUB_TOKEN }}
GH_TOKEN: ${{ secrets.CUSTOM_GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GIT_AUTHOR_EMAIL: ${{ secrets.GIT_AUTHOR_EMAIL }}
GIT_AUTHOR_NAME: ${{ secrets.GIT_AUTHOR_NAME }}
GIT_COMMITTER_EMAIL: ${{ secrets.GIT_COMMITTER_EMAIL }}
GIT_COMMITTER_NAME: ${{ secrets.GIT_COMMITTER_NAME }}