11name : ci
22
33on :
4- - push
5- - pull_request
4+ push :
5+ pull_request :
66
77jobs :
8-
98 test :
109 strategy :
1110 matrix :
12- node-version : [ 14.x ]
13- os : [ ubuntu-latest ]
11+ node-version : [14.x]
12+ os : [ubuntu-latest]
1413 runs-on : ${{ matrix.os }}
1514 steps :
16-
17- # checkout the code
18- - name : Checkout
19- uses : actions/checkout@v2
20-
21- # verify the version in package.json matches the release tag
22- - name : Version
23- uses : tcurdt/action-verify-version-npm@master
24-
25- # setup the node version
26- - name : Setup Node ${{ matrix.node-version }}
27- uses : actions/setup-node@v1
28- with :
29- node-version : ${{ matrix.node-version }}
30-
31- # cache node_modules if we can
32- - name : Cache
33- id : cache-modules
34- uses : actions/cache@v2
35- with :
36- path : node_modules
37- key : ${{ matrix.node-version }}-${{ runner.OS }}-build-${{ hashFiles('package.json') }}
38-
39- # ottherweise run install
40- - name : Install
41- if : steps.cache-modules.outputs.cache-hit != 'true'
42- run : npm install
43-
44- # run tests
45- - name : Test
46- run : npm test
15+ # checkout the code
16+ - name : Checkout
17+ uses : actions/checkout@v4 # Updated to v4 (latest as of 2025)
18+
19+ # verify the version in package.json matches the release tag
20+ - name : Version
21+ uses : tcurdt/action-verify-version-npm@master # No version update as it's using @master
22+
23+ # setup the node version
24+ - name : Setup Node ${{ matrix.node-version }}
25+ uses : actions/setup-node@v4 # Updated to v4 (latest as of 2025)
26+ with :
27+ node-version : ${{ matrix.node-version }}
28+
29+ # cache node_modules if we can
30+ - name : Cache
31+ id : cache-modules
32+ uses : actions/cache@v4 # Updated to v4 (latest as of 2025)
33+ with :
34+ path : node_modules
35+ key : ${{ matrix.node-version }}-${{ runner.os }}-build-${{ hashFiles('package.json') }}
36+
37+ # otherwise run install
38+ - name : Install
39+ if : steps.cache-modules.outputs.cache-hit != 'true'
40+ run : npm install
41+
42+ # run tests
43+ - name : Test
44+ run : npm test
4745
4846 # create github release
4947 release :
5048 if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
51- needs : [ test ]
49+ needs : [test]
5250 runs-on : ubuntu-latest
5351 steps :
54-
55- # create github release (which triggers the release workflows)
56- - name : Release
57- uses : softprops/action-gh-release@v1
58- # env:
59- # GITHUB_TOKEN: ${{ secrets.PAT }}
52+ # create github release (which triggers the release workflows)
53+ - name : Release
54+ uses : softprops/action-gh-release@v2 # Updated to v2 (latest stable version as of 2025)
55+ # env:
56+ # GITHUB_TOKEN: ${{ secrets.PAT }}
6057
6158# # publish latest master or release to dockerhub
6259# dockerhub:
6360# if: github.event_name == 'push'
64- # needs: [ test ]
61+ # needs: [test]
6562# runs-on: ubuntu-latest
6663# env:
6764# image: ${{ secrets.DOCKERHUB_USERNAME }}/gun
6865# steps:
69-
66+ #
7067# - name: Checkout
71- # uses: actions/checkout@v2
72-
68+ # uses: actions/checkout@v4 # Updated to v4
69+ #
7370# - name: Login
7471# env:
7572# DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
7673# DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
7774# run: echo -n ${{ secrets.DOCKERHUB_TOKEN }} | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin
78-
75+ #
7976# - name: Build
8077# run: |
8178# echo "SHA=$GITHUB_SHA"
@@ -89,26 +86,23 @@ jobs:
8986# --tag ${{ env.image }}:${GITHUB_REF##*/} \
9087# --tag ${{ env.image }}:latest \
9188# .
92-
89+ #
9390# - name: Push
9491# run: docker push ${{ env.image }}
9592
96-
9793 # publish release to npm
9894 npm :
9995 if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
100- needs : [ test ]
101- # needs: [ release ]
96+ needs : [test]
10297 runs-on : ubuntu-latest
10398 steps :
104-
105- - name : Checkout
106- uses : actions/checkout@v2
107-
108- - name : Publish
109- env :
110- NPM_AUTH_TOKEN : ${{ secrets.NPM_AUTH_TOKEN }}
111- run : |
112- npm config set //registry.npmjs.org/:_authToken=$NPM_AUTH_TOKEN
113- npm install
114- npm publish --access=public
99+ - name : Checkout
100+ uses : actions/checkout@v4 # Updated to v4
101+
102+ - name : Publish
103+ env :
104+ NPM_AUTH_TOKEN : ${{ secrets.NPM_AUTH_TOKEN }}
105+ run : |
106+ npm config set //registry.npmjs.org/:_authToken=$NPM_AUTH_TOKEN
107+ npm install
108+ npm publish --access=public
0 commit comments