File tree Expand file tree Collapse file tree 1 file changed +65
-0
lines changed Expand file tree Collapse file tree 1 file changed +65
-0
lines changed Original file line number Diff line number Diff line change 1+ name : CI
2+
3+ on :
4+ schedule :
5+ - cron : " 0 0 * * *"
6+ push :
7+ branches :
8+ - " main"
9+ tags : ["v[0-9]+.[0-9]+.[0-9]+"]
10+ pull_request :
11+ branches :
12+ - " main"
13+
14+ workflow_dispatch :
15+ inputs :
16+ logLevel :
17+ description : " Log level"
18+ required : true
19+ default : " warning"
20+ type : choice
21+ options :
22+ - info
23+ - warning
24+ - debug
25+
26+ jobs :
27+ test :
28+ runs-on : ubuntu-latest
29+ name : Run unit and integration tests
30+ strategy :
31+ matrix :
32+ version : [18, 20]
33+ steps :
34+ - uses : actions/checkout@v4
35+ - name : Using Node.js ${{ matrix.version }}
36+ uses : actions/setup-node@v4
37+ with :
38+ node-version : ${{ matrix.version }}
39+ - name : Install dependencies
40+ run : npm install
41+ - name : Run tests
42+ run : npm test
43+
44+ build_and_publish :
45+ needs : [test]
46+ runs-on : ubuntu-latest
47+ if : startsWith(github.ref, 'refs/tags')
48+ steps :
49+ - uses : actions/checkout@v4
50+
51+ - uses : actions/setup-node@v4
52+ with :
53+ node-version : 20
54+ registry-url : " https://registry.npmjs.org"
55+
56+ - name : Install dependencies
57+ run : npm install
58+
59+ - name : Build
60+ run : npm run build
61+
62+ - name : Publish
63+ run : npm publish
64+ env :
65+ NPM_PUBLISH_TOKEN : ${{ secrets.NPM_TOKEN }}
You can’t perform that action at this time.
0 commit comments