-
Notifications
You must be signed in to change notification settings - Fork 21
90 lines (78 loc) · 2.69 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
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
verify-version-bump-then-release:
if: (github.event.pusher.name == github.event.repository.owner.name) && (github.ref == 'refs/heads/main')
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js 17.x
uses: actions/setup-node@v1
with:
node-version: 17.x
registry-url: https://registry.npmjs.org/
- 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
export TAG=$(awk -F'"' '/"version": ".+"/{ print $4; exit; }' package.json)
echo "TAG=$TAG" >> $GITHUB_ENV
- 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 }}