-
Notifications
You must be signed in to change notification settings - Fork 21
159 lines (132 loc) · 4.63 KB
/
nodejs.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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
name: Full publish pipeline
on: [push]
jobs:
build:
strategy:
matrix:
include:
- node-version: 18.x # fastest, so run first, to error fast
os: ubuntu-latest
- node-version: 18.x # slowest, so run next. sort by slowest from here to get earliest end through parallelism
os: macos-latest
- node-version: 18.x # finish check big-3 on latest current
os: windows-latest
- node-version: 10.x # lastly check just ubuntu on historic node versions because speed, oldest (slowest) first
os: ubuntu-latest
- node-version: 11.x
os: ubuntu-latest
- node-version: 12.x
os: ubuntu-latest
- node-version: 13.x
os: ubuntu-latest
- node-version: 14.x
os: ubuntu-latest
- node-version: 15.x
os: ubuntu-latest
- node-version: 16.x
os: ubuntu-latest
- node-version: 17.x
os: ubuntu-latest
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: npm install, build, and test
run: |
npm install && npm run ci_build
env:
CI: true
- name: Coveralls GitHub Action
uses: coverallsapp/github-action@v1.0.1
with:
github-token: ${{ secrets.github_token }}
path-to-lcov: ./coverage/spec/lcov.info
benchmark:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js 18.x
uses: actions/setup-node@v1
with:
node-version: 18.x
- name: Verify the version was bumped
run: |
npm install && npm run benny
verify-version-bump:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js 18.x
uses: actions/setup-node@v1
with:
node-version: 18.x
- name: Verify the version was bumped
run: |
npm install
git config --global user.email "stonecypher@users.noreply.github.com"
git config --global user.name "John Haugeland through Github Actions"
node ./src/buildjs/verify_version_bump.js
release:
if: (github.event.pusher.name == github.event.repository.owner.name) && (github.ref == 'refs/heads/main')
needs: [build, verify-version-bump]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Export tag to envvars
run: |
export TAG=$(awk -F'"' '/"version": ".+"/{ print $4; exit; }' package.json)
echo "TAG=$TAG" >> $GITHUB_ENV
- name: Use Node.js 18.x
uses: actions/setup-node@v1
with:
node-version: 18.x
registry-url: https://registry.npmjs.org/
- name: Push tags
run: git push origin --tags
- name: Create the release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.TAG }}
release_name: ${{ env.TAG }}
body_path: CHANGELOG.md
- name: Publish to npm
run: |
npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.JSSM_PUBLISH_TOKEN_FOR_GH_CI_CD }}
# bump-jssm-viz:
# needs: [release]
# name: Update jssm-viz
# uses: StoneCypher/jssm-viz/.github/workflows/lib_update.js.yml@main
# with:
# libversion: env.TAG
# bump-jssm-viz:
# needs: [release]
# runs-on: ubuntu-latest
# steps:
# - name: CURL RPC to jssm-viz action
# run: |
# curl -X POST "https://api.github.com/repos/StoneCypher/jssm-viz/actions/workflows/lib_update.js.yml/dispatches" -H "Accept: application/vnd.github.v3+json" -H "Content-Type: application/json" -H "Authorization: Bearer ${GITHUB_TOKEN}" --data "{\"inputs\":{\"libversion\":\"${}\"}}"
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# LIBVERSION: foo.bar.baz
bump-jssm-viz:
needs: [release]
runs-on: ubuntu-latest
steps:
- name: CURL RPC to jssm-viz action
# env:
# LIBVERSION: foo.bar.baz
run: |
curl -X POST "https://api.github.com/repos/StoneCypher/jssm-viz/dispatches" -H 'Accept: application/vnd.github.everest-preview+json' -u ${{ secrets.JSSM_UPGRADE_PERSONAL_ACCESS_TOKEN }} --data '{"event_type": "upgrade_jssm", "client_payload": { "lib_version": "${{ env.TAG }}" }}'
finish:
needs: [bump-jssm-viz]
runs-on: ubuntu-latest
steps:
- name: Results page
run: echo '### Results!\n\n* Published to NPM\n* Bumped `jssm-viz`\n* Bumped `jssm-viz-demo`' >> $GITHUB_STEP_SUMMARY