File tree Expand file tree Collapse file tree 4 files changed +85
-55
lines changed
Expand file tree Collapse file tree 4 files changed +85
-55
lines changed Original file line number Diff line number Diff line change 1+ name : ci-cd
2+
3+ on :
4+ push :
5+ branches :
6+ - main
7+ workflow_dispatch :
8+ pull_request :
9+ branches :
10+ - main
11+
12+ jobs :
13+
14+ build-and-test :
15+ name : Build and Test
16+
17+ strategy :
18+ matrix :
19+ os : [ubuntu-latest]
20+ node : ['18']
21+ java : ['11']
22+
23+ runs-on : ${{ matrix.os }}
24+ timeout-minutes : 10
25+
26+ steps :
27+ - name : Checkout
28+ uses : actions/checkout@v3
29+ with :
30+ fetch-depth : 1
31+
32+ - name : Use Node.js ${{ matrix.node }}
33+ uses : actions/setup-node@v3
34+ with :
35+ node-version : ${{ matrix.node }}
36+ registry-url : ' https://registry.npmjs.org'
37+
38+ - name : Use Java ${{ matrix.java }}
39+ uses : actions/setup-java@v3
40+ with :
41+ distribution : ' adopt'
42+ java-version : ${{ matrix.java }}
43+
44+ - name : Run Tests
45+ if : matrix.tests != 'skip'
46+ shell : bash
47+ run : |
48+ yarn
49+ yarn test
50+
51+ publish-latest :
52+ needs : build-and-test
53+ # if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags/v') && github.repository == 'eclipse-dash/nodejs-wrapper'
54+ if : github.ref == 'refs/heads/main' && github.event_name == 'push' && github.repository == 'eclipse-dash/nodejs-wrapper' && contains(github.event.head_commit.message, '[Release]: v')
55+ runs-on : ubuntu-latest
56+ strategy :
57+ matrix :
58+ node : ['18']
59+ steps :
60+ - name : Checkout
61+ uses : actions/checkout@v3
62+ with :
63+ fetch-depth : 0
64+ - name : Use Node.js ${{ matrix.node }}
65+ uses : actions/setup-node@v3
66+ with :
67+ node-version : ${{ matrix.node }}
68+ registry-url : ' https://registry.npmjs.org'
69+ - name : Pre-Publish
70+ shell : bash
71+ run : |
72+ yarn
73+ - name : Publish to npm
74+ uses : nick-invision/retry@v2
75+ with :
76+ timeout_minutes : 5
77+ retry_wait_seconds : 60
78+ max_attempts : 3
79+ retry_on : error
80+ command : yarn publish:ci
81+ env :
82+ NODE_AUTH_TOKEN : ${{ secrets.NPM_AUTH_TOKEN }}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1515
1616jobs :
1717 gh-release :
18+ name : Create GitHub release
1819 runs-on : ubuntu-latest
1920 steps :
2021 - uses : actions/checkout@v3
Original file line number Diff line number Diff line change 1111 },
1212 "scripts" : {
1313 "start" : " node src/dash-licenses-wrapper.js" ,
14- "test" : " mocha --reporter spec"
14+ "test" : " mocha --reporter spec" ,
15+ "publish:ci" : " yarn publish --non-interactive --access public --registry https://registry.npmjs.org/"
1516 },
1617 "files" : [
1718 " src/*" ,
You can’t perform that action at this time.
0 commit comments