-
Notifications
You must be signed in to change notification settings - Fork 2
96 lines (83 loc) · 2.63 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
name: CI and CD
on:
push:
branches:
- "main"
jobs:
build:
name: 'Test Build and Publish'
runs-on: ubuntu-latest
if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')"
strategy:
matrix:
node-version: [12.x]
steps:
- name: Checkout
uses: actions/checkout@v2
# caching node modules
- name: Cache node modules
uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Setup Node ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: npm ci
- name: Test
run: npm run test:ci
- name: Test Report
uses: EnricoMi/[email protected]
if: always()
with:
files: ./coverage/fsms-angular-pubsub/test-report.xml
- name: Code Coverage Report
uses: romeovs/[email protected]
with:
github-token: ${{ secrets.GH_TOKEN }}
lcov-file: ./coverage/fsms-angular-pubsub/lcov.info
- name: Generate tag and ChangeLog
if: success()
run: |
git config user.name rupeshtiwari
git config user.email [email protected]
npx standard-version --release-as patch --skip.commit
- name: Publish Tag
id: publish_tag
run: |
git push --follow-tags origin main
echo ::set-output name=tag_name::$(git describe HEAD --abbrev=0)
- name: Read Tag Name
run: echo Git Tag Name is ${{ steps.publish_tag.outputs.tag_name }}
- name: Build
run: npm run build:ci
- name: NPM Publish
run: npm publish --access public
working-directory: ./dist/fsms-angular-pubsub
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Archive build
if: success()
uses: actions/upload-artifact@v1
with:
name: deploy_dist
path: dist
- name: Archive code coverage result
if: success()
uses: actions/upload-artifact@v1
with:
name: deploy_coverage
path: coverage
- name: Create release
if: success()
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
with:
release_name: Release ${{ steps.publish_tag.outputs.tag_name }}
tag_name: ${{ steps.publish_tag.outputs.tag_name }}
body_path: CHANGELOG.md