1
1
name : Node CI
2
2
3
- # Push tests pushes; PR tests merges; create tests tags (and releases)
4
- on : [push, pull_request, create ]
3
+ # Push tests pushes; PR tests merges
4
+ on : [push, pull_request]
5
5
6
6
jobs :
7
7
@@ -16,35 +16,58 @@ jobs:
16
16
17
17
# Go
18
18
steps :
19
- - uses : actions/checkout@v1
20
- - uses : actions/setup-node@v1
19
+ - name : Check out repo
20
+ uses : actions/checkout@v1
21
+
22
+ - name : Set up Node.js
23
+ uses : actions/setup-node@v1
21
24
with :
22
25
node-version : ${{ matrix.node-version }}
23
26
24
- - name : Versions
25
- run : node --version
27
+ - name : Env
28
+ run : |
29
+ echo "Event name: ${{ github.event_name }}"
30
+ echo "Git ref: ${{ github.ref }}"
31
+ echo "GH actor: ${{ github.actor }}"
32
+ echo "SHA: ${{ github.sha }}"
33
+ VER=`node --version`; echo "Node ver: $VER"
34
+ VER=`npm --version`; echo "npm ver: $VER"
26
35
27
36
- name : Install
28
37
run : npm install
29
38
30
39
- name : Test
31
40
run : npm test
41
+ env :
42
+ CI : true
43
+
44
+ - name : Notify
45
+ uses : homoluctus/slatify@master
46
+ # Only fire alert once
47
+ if : github.ref == 'refs/heads/master' && failure() && matrix.node-version == '10.x' && matrix.os == 'ubuntu-latest'
48
+ with :
49
+ type : ${{ job.status }}
50
+ job_name : ' *Build*'
51
+ url : ${{ secrets.SLACK_WEBHOOK }}
32
52
33
53
# ----- Only git tag testing + package publishing beyond this point ----- #
34
54
35
55
# Publish to package registries
36
56
publish :
37
57
# Setup
38
58
needs : build
39
- if : github.event_name == 'create' && startsWith(github.ref, 'refs/tags/v')
59
+ if : startsWith(github.ref, 'refs/tags/v')
40
60
runs-on : ubuntu-latest
41
61
42
62
# Go
43
63
steps :
44
- - uses : actions/checkout@v1
45
- - uses : actions/setup-node@v1
64
+ - name : Check out repo
65
+ uses : actions/checkout@v1
66
+
67
+ - name : Set up Node.js
68
+ uses : actions/setup-node@v1
46
69
with :
47
- node-version : 12
70
+ node-version : 10
48
71
registry-url : https://registry.npmjs.org/
49
72
50
73
- name : Install
64
87
NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
65
88
66
89
# Set up Node again, this time using GitHub as the publish target
67
- - uses : actions/setup-node@v1
90
+ - name : Set up Node.js
91
+ uses : actions/setup-node@v1
68
92
with :
69
- node-version : 12
93
+ node-version : 10
70
94
registry-url : https://npm.pkg.github.com/
71
95
72
96
# Publish to GitHub
@@ -81,3 +105,11 @@ jobs:
81
105
run : npm publish
82
106
env :
83
107
NODE_AUTH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
108
+
109
+ - name : Notify
110
+ uses : homoluctus/slatify@master
111
+ if : always()
112
+ with :
113
+ type : ${{ job.status }}
114
+ job_name : ' *Publish*'
115
+ url : ${{ secrets.SLACK_WEBHOOK }}
0 commit comments