@@ -3,62 +3,60 @@ name: CI
33on :
44 push :
55 paths-ignore :
6- - ' *.md'
7- branches : [ main ]
6+ - " *.md"
7+ branches : [main]
88 tags :
9- - ' * '
9+ - " * "
1010 pull_request :
11- branches : [ main ]
11+ branches : [main]
1212
1313jobs :
1414 build :
1515 runs-on : ubuntu-latest
1616 steps :
17-
18- - name : Git checkout
19- uses : actions/checkout@v3
20- with :
21- fetch-depth : 0
22-
23- - name : Setup Node.js
24- uses : actions/setup-node@v3
25- with :
26- node-version : ' 16'
27-
28- - name : Cache node_modules
29- uses : actions/cache@v3
30- with :
31- path : |
32- ~/.npm
33- ~/.nvm
34- ~/work/better-sqlite3-wrapper/better-sqlite3-wrapper/node_modules
35- ~/work/better-sqlite3-wrapper/better-sqlite3-wrapper/package-lock.json
36- key : ${{ runner.os }}-node_modules-cache-v3-${{ hashFiles('**/package-lock.json') }}
37- restore-keys : |
38- ${{ runner.os }}-node_modules-cache-v3-
39-
40- - name : Extract Tag Name
41- run : echo "TAG_NAME=$(echo ${GITHUB_REF##*/})" >> $GITHUB_ENV
42- if : ${{ startsWith(github.ref, 'refs/tags') }}
43-
44- - name : Run tests
45- run : |
46- npm i
47- node --test
48- if : ${{ env.TAG_NAME == '' }}
49-
50- - name : Build SNAPSHOT
51- run : npm pack
52- if : ${{ env.TAG_NAME == '' }}
53-
54- - name : Publish RELEASE
55- run : |
56- VERSION="$(echo "$TAG_NAME" | cut -d'v' -f 2)"
57- echo "Publish a release version=$VERSION for tag $TAG_NAME"
58- npm --no-git-tag-version --allow-same-version version $VERSION
59- npm pack
60- echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" > .npmrc
61- npm publish --access=public farjs-better-sqlite3-wrapper-${VERSION}.tgz
62- if : ${{ env.TAG_NAME != '' }}
63- env :
64- NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
17+ - name : Git checkout
18+ uses : actions/checkout@v4
19+ with :
20+ fetch-depth : 0
21+
22+ - name : Setup Node.js
23+ uses : actions/setup-node@v4
24+ with :
25+ node-version : " 20"
26+
27+ - name : Cache node_modules
28+ uses : actions/cache@v4
29+ with :
30+ path : |
31+ ~/.npm
32+ ~/.nvm
33+ ~/work/better-sqlite3-wrapper/better-sqlite3-wrapper/node_modules
34+ ~/work/better-sqlite3-wrapper/better-sqlite3-wrapper/package-lock.json
35+ key : ${{ runner.os }}-node_modules-cache-v4-${{ hashFiles('**/package-lock.json') }}
36+ restore-keys : |
37+ ${{ runner.os }}-node_modules-cache-v4-
38+
39+ - name : Extract Tag Name
40+ run : echo "TAG_NAME=$(echo ${GITHUB_REF##*/})" >> $GITHUB_ENV
41+ if : ${{ startsWith(github.ref, 'refs/tags') }}
42+
43+ - name : Run tests
44+ run : |
45+ npm i
46+ node ./index.test.js
47+ if : ${{ env.TAG_NAME == '' }}
48+
49+ - name : Build SNAPSHOT
50+ run : npm pack
51+ if : ${{ env.TAG_NAME == '' }}
52+
53+ - name : Publish RELEASE
54+ run : |
55+ VERSION="$(echo "$TAG_NAME" | cut -d'v' -f 2)"
56+ echo "Publish a release version=$VERSION for tag $TAG_NAME"
57+ npm --no-git-tag-version --allow-same-version version $VERSION
58+ echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" > .npmrc
59+ npm publish
60+ if : ${{ env.TAG_NAME != '' }}
61+ env :
62+ NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
0 commit comments