File tree Expand file tree Collapse file tree 2 files changed +65
-0
lines changed Expand file tree Collapse file tree 2 files changed +65
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Commit Gate
2
+
3
+ on :
4
+ push :
5
+ branches : [ "main" ]
6
+ pull_request :
7
+ branches : [ "main" ]
8
+
9
+ jobs :
10
+ build :
11
+
12
+ runs-on : ubuntu-latest
13
+
14
+ steps :
15
+ - name : checkout code
16
+ uses : actions/checkout@v3
17
+
18
+ - name : Set up Node.js
19
+ uses : actions/setup-node@v3
20
+ with :
21
+ node-version : ' 20' # Or any other version you need
22
+
23
+ - name : Install dependencies
24
+ run : npm ci --prefix src/
25
+
26
+ - name : Build
27
+ run : npm run build --prefix src/
28
+
29
+ - name : Install test dependencies
30
+ run : npm ci --prefix tests/
31
+
32
+ - name : Run tests
33
+ run : npm run test --prefix tests/
Original file line number Diff line number Diff line change
1
+ name : Publish npm package
2
+
3
+ on :
4
+ push :
5
+ tags : v*
6
+
7
+ jobs :
8
+ build :
9
+
10
+ runs-on : ubuntu-latest
11
+
12
+ steps :
13
+ - name : checkout code
14
+ uses : actions/checkout@v3
15
+
16
+ - name : Set up Node.js
17
+ uses : actions/setup-node@v3
18
+ with :
19
+ node-version : ' 20' # Or any other version you need
20
+
21
+ - name : Create npm package
22
+ run : |
23
+ cd src
24
+ npm version ${{ steps.get_version.outputs.version_number }}
25
+ npm pack
26
+
27
+ - name : Publish package
28
+ run : |
29
+ cd src
30
+ npm publish
31
+ env :
32
+ NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
You can’t perform that action at this time.
0 commit comments