-
Notifications
You must be signed in to change notification settings - Fork 30
59 lines (47 loc) · 1.36 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
name: CI
on:
pull_request:
push:
branches:
- 'master'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@master
with:
node-version: 18.4.0
- name: Install dependencies
run: npm install && npm run install-peers
- name: Run tests
run: npm test
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
config-file: ./.github/configs/codeql-config.yml
- name: Perform build
run: npm run build
- name: Copy type definition to docs
if: github.ref_name == 'master'
run: cp ./build/index.d.ts ./docs/
- name: Perform CodeQL analysis
uses: github/codeql-action/analyze@v2
- name: Publish github pages docs
uses: peaceiris/actions-gh-pages@v3
if: github.ref_name == 'master'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs
- name: Publish to NPM if version has been updated
uses: pascalgn/[email protected]
if: github.event_name != 'pull_request'
with:
tag_name: "v%s"
tag_message: "v%s"
commit_pattern: "^Release (\\S+)"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}