generated from muturgan/my-typescript-template
-
Notifications
You must be signed in to change notification settings - Fork 2
74 lines (60 loc) · 1.8 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
name: MORE CI FOR THE CI GOD!
on:
push:
branches: [ master ]
pull_request:
types:
- opened
- reopened
- edited
- synchronize
jobs:
quality_checking_and_publishing:
name: quality_checking_and_publishing
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
uses: actions/checkout@master
- name: Set up Node.js
uses: actions/setup-node@master
with:
node-version: 20
registry-url: https://registry.npmjs.org/
- name: Check license
run: node tools/check_license.cjs
- name: Install dependencies
run: npm ci
- name: Audit vulnerabilities
run: npm run audit
- name: Linting
run: npm run lint_ci
- name: Build
run: npm run build
- name: Test
run: npm run test_coverage
- name: Calculate (and check) Coverage
run: |
echo "COVERAGE=$(node tools/check_coverage.cjs)" >> $GITHUB_ENV
echo "COVERAGE_COLOR=$(node tools/get_coverage_color.cjs)" >> $GITHUB_ENV
- name: Create Coverage Badge
uses: schneegans/[email protected]
with:
auth: ${{ secrets.GIST_SECRET }}
gistID: ${{ secrets.GIST_ID }}
filename: fev_coverage.json
label: coverage
message: ${{ env.COVERAGE }}
color: ${{ env.COVERAGE_COLOR }}
namedLogo: mocha
logoColor: white
- if: github.ref == 'refs/heads/master'
name: Check published versions
run: echo "NEED_PUBLISH=$(node tools/publish.helper.cjs)" >> $GITHUB_ENV
- if: ${{ env.NEED_PUBLISH == 'true' }}
name: Remove a dist folder from gitignore
run: sed -i '$ d' .gitignore
- if: ${{ env.NEED_PUBLISH == 'true' }}
name: Publish
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}