11name : CI
22
3- on : [push, pull_request]
3+ on :
4+ push :
5+ branches :
6+ - master
7+ pull_request :
48
59permissions :
610 contents : read
913 lint :
1014 runs-on : ubuntu-latest
1115 steps :
12- - uses : actions/checkout@v3
16+ - uses : actions/checkout@v4
1317
1418 - name : Set up Node.js
15- uses : actions/setup-node@v3
19+ uses : actions/setup-node@v4
1620 with :
1721 node-version : ^20
1822
@@ -29,10 +33,10 @@ jobs:
2933 contents : read
3034 pull-requests : write
3135 steps :
32- - uses : actions/checkout@v3
36+ - uses : actions/checkout@v4
3337
3438 - name : Set up Node.js
35- uses : actions/setup-node@v3
39+ uses : actions/setup-node@v4
3640 with :
3741 node-version : ^20
3842
4347 run : yarn run coverage
4448
4549 - name : Coveralls
46- uses : coverallsapp/github-action@master
50+ uses : coverallsapp/github-action@v2
4751 with :
4852 github-token : ${{ secrets.GITHUB_TOKEN }}
4953
@@ -54,10 +58,10 @@ jobs:
5458 matrix :
5559 node : [^20]
5660 steps :
57- - uses : actions/checkout@v3
61+ - uses : actions/checkout@v4
5862
5963 - name : Set up Node.js
60- uses : actions/setup-node@v3
64+ uses : actions/setup-node@v4
6165 with :
6266 node-version : ${{ matrix.node }}
6367
6973
7074 - name : Run Build
7175 run : yarn run build
76+
77+ semantic-release :
78+ needs : [lint, test, coverage]
79+ runs-on : ubuntu-latest
80+ permissions :
81+ contents : write
82+ issues : write
83+ pull-requests : write
84+ steps :
85+ - uses : actions/checkout@v4
86+ with :
87+ fetch-depth : 0
88+ persist-credentials : false
89+
90+ - name : Set up Node.js
91+ uses : actions/setup-node@v4
92+ with :
93+ node-version : ^20
94+
95+ - name : Run semantic-release
96+ if : github.repository == 'casbin/casbin-core' && github.event_name == 'push' && github.ref == 'refs/heads/master'
97+ run : |
98+ yarn install
99+ yarn run build
100+ yarn run release
101+ env :
102+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
103+ NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
0 commit comments