-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (48 loc) · 1.47 KB
/
actions.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
on:
push:
branches:
- main
name: pipeline
jobs:
pipeline:
name: Test & Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 18
- name: Cache node_modules
id: cache-modules
uses: actions/cache@v1
with:
path: node_modules
key: 18.x-${{ runner.OS }}-build-${{ hashFiles('package.json') }}
- name: NPM Install
if: steps.cache-modules.outputs.cache-hit != 'true'
run: npm install
- name: Lint
run: npm run-script lint
- name: Pretty
run: npm run-script prettier-check
# complete the test coverage
- name: Test
run: npm test
- name: Build
run: npm run build
- name: Publish
id: publish
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NODE_SERVER_SDK_NPM_AUTH_TOKEN }}
- name: Send Slack notification
uses: 8398a7/action-slack@v3
with:
status: ${{ job.status }}
fields: repo
text: Published to NPM ${{ steps.publish.outputs.old-version }} -> ${{ steps.publish.outputs.version }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
if: steps.publish.outputs.type != 'none' && always()