@@ -14,28 +14,54 @@ name: NPM
1414jobs :
1515 packagejsonlint :
1616 name : PackageJsonLint
17- runs-on : ubuntu-20 .04
17+ runs-on : ubuntu-24 .04
1818 timeout-minutes : 1
1919 steps :
20- - uses : actions/checkout@v3
20+ - uses : actions/checkout@v5
2121 - uses : mobsuccess-devops/github-actions-packagejsonlint@master
22+ sortpackagejson :
23+ name : Sort Package Json
24+ runs-on : ubuntu-24.04
25+ timeout-minutes : 7
26+ steps :
27+ - uses : actions/checkout@v5
28+ - uses : actions/setup-node@v4
29+ with :
30+ node-version : 20.12.0
31+ - name : Cache Node Modules
32+ id : cache
33+ uses : actions/cache@v4
34+ env :
35+ cache-name : cache-node-modules
36+ with :
37+ path : ./node_modules
38+ key : ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}-${{ hashFiles('**/package-lock.json') }}-node-20.12.0
39+ - run : echo "//npm.pkg.github.com/:_authToken=${{ secrets.MS_READ_PACKAGES_GITHUB_PAT }}" >> ~/.npmrc
40+ name : Configure Credentials For GitHub Packages
41+ - run : npm ci
42+ if : steps.cache.outputs.cache-hit != 'true'
43+ working-directory : .
44+ - run : |
45+ echo "💡 👉 Check not passing? see the doc at https://www.notion.so/mobsuccess/sort-package-json-de5cf4648e8545dbb5a2a5a910380535"
46+ npx --yes [email protected] --check 47+ working-directory: .
2248 prettier :
2349 name : Prettier
24- runs-on : ubuntu-20 .04
50+ runs-on : ubuntu-24 .04
2551 timeout-minutes : 7
2652 steps :
27- - uses : actions/checkout@v3
28- - uses : actions/setup-node@v3
53+ - uses : actions/checkout@v5
54+ - uses : actions/setup-node@v4
2955 with :
30- node-version : 16.16 .0
56+ node-version : 20.12 .0
3157 - name : Cache Node Modules
3258 id : cache
33- uses : actions/cache@v3
59+ uses : actions/cache@v4
3460 env :
3561 cache-name : cache-node-modules
3662 with :
3763 path : ./node_modules
38- key : ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}-${{ hashFiles('**/package-lock.json') }}-node-16.16 .0
64+ key : ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}-${{ hashFiles('**/package-lock.json') }}-node-20.12 .0
3965 - run : echo "//npm.pkg.github.com/:_authToken=${{ secrets.MS_READ_PACKAGES_GITHUB_PAT }}" >> ~/.npmrc
4066 name : Configure Credentials For GitHub Packages
4167 - run : npm ci
@@ -45,21 +71,21 @@ jobs:
4571 working-directory : .
4672 eslint :
4773 name : Eslint
48- runs-on : ubuntu-20 .04
74+ runs-on : ubuntu-24 .04
4975 timeout-minutes : 7
5076 steps :
51- - uses : actions/checkout@v3
52- - uses : actions/setup-node@v3
77+ - uses : actions/checkout@v5
78+ - uses : actions/setup-node@v4
5379 with :
54- node-version : 16.16 .0
80+ node-version : 20.12 .0
5581 - name : Cache Node Modules
5682 id : cache
57- uses : actions/cache@v3
83+ uses : actions/cache@v4
5884 env :
5985 cache-name : cache-node-modules
6086 with :
6187 path : ./node_modules
62- key : ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}-${{ hashFiles('**/package-lock.json') }}-node-16.16 .0
88+ key : ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}-${{ hashFiles('**/package-lock.json') }}-node-20.12 .0
6389 - run : echo "//npm.pkg.github.com/:_authToken=${{ secrets.MS_READ_PACKAGES_GITHUB_PAT }}" >> ~/.npmrc
6490 name : Configure Credentials For GitHub Packages
6591 - run : npm ci
@@ -69,21 +95,21 @@ jobs:
6995 working-directory : .
7096 test :
7197 name : Test
72- runs-on : ubuntu-20 .04
98+ runs-on : ubuntu-24 .04
7399 timeout-minutes : 7
74100 steps :
75- - uses : actions/checkout@v3
76- - uses : actions/setup-node@v3
101+ - uses : actions/checkout@v5
102+ - uses : actions/setup-node@v4
77103 with :
78- node-version : 16.16 .0
104+ node-version : 20.12 .0
79105 - name : Cache Node Modules
80106 id : cache
81- uses : actions/cache@v3
107+ uses : actions/cache@v4
82108 env :
83109 cache-name : cache-node-modules
84110 with :
85111 path : ./node_modules
86- key : ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}-${{ hashFiles('**/package-lock.json') }}-node-16.16 .0
112+ key : ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}-${{ hashFiles('**/package-lock.json') }}-node-20.12 .0
87113 - run : echo "//npm.pkg.github.com/:_authToken=${{ secrets.MS_READ_PACKAGES_GITHUB_PAT }}" >> ~/.npmrc
88114 name : Configure Credentials For GitHub Packages
89115 - run : npm ci
92118 - run : npm run test
93119 working-directory : .
94120 postBuild :
95- needs : [packagejsonlint, prettier, eslint, test]
121+ needs : [packagejsonlint, sortpackagejson, prettier, eslint, test]
96122 name : Post-Build
97- runs-on : ubuntu-20 .04
123+ runs-on : ubuntu-24 .04
98124 timeout-minutes : 2
99125 outputs :
100126 needsPackage : ${{ steps.checkEligibility.outputs.needsPackage }}
@@ -128,24 +154,24 @@ jobs:
128154 package :
129155 needs : [postBuild]
130156 name : Package
131- runs-on : ubuntu-20 .04
157+ runs-on : ubuntu-24 .04
132158 timeout-minutes : 2
133159 outputs :
134160 packageVersion : ${{ steps.outputPackageVersion.outputs.packageVersion }}
135161 if : needs.postBuild.outputs.needsPackage == 'true'
136162 steps :
137- - uses : actions/checkout@v3
138- - uses : actions/setup-node@v3
163+ - uses : actions/checkout@v5
164+ - uses : actions/setup-node@v4
139165 with :
140- node-version : 16.16 .0
166+ node-version : 20.12 .0
141167 - name : Cache Node Modules
142168 id : cache
143- uses : actions/cache@v3
169+ uses : actions/cache@v4
144170 env :
145171 cache-name : cache-node-modules
146172 with :
147173 path : ./node_modules
148- key : ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}-${{ hashFiles('**/package-lock.json') }}-node-16.16 .0
174+ key : ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}-${{ hashFiles('**/package-lock.json') }}-node-20.12 .0
149175 - run : echo "//npm.pkg.github.com/:_authToken=${{ secrets.MS_READ_PACKAGES_GITHUB_PAT }}" >> ~/.npmrc
150176 name : Configure Credentials For GitHub Packages
151177 - run : npm ci
@@ -196,18 +222,18 @@ jobs:
196222 publish :
197223 name : " Publish to GitHub Packages"
198224 needs : [postBuild, package]
199- runs-on : ubuntu-20 .04
225+ runs-on : ubuntu-24 .04
200226 timeout-minutes : 2
201227 if : needs.postBuild.outputs.needsPackage == 'true'
202228 steps :
203- - uses : actions/checkout@v3
229+ - uses : actions/checkout@v5
204230 - name : Upload
205231 uses : actions/download-artifact@v2
206232 with :
207233 name : package
208- - uses : actions/setup-node@v3
234+ - uses : actions/setup-node@v4
209235 with :
210- node-version : 16.16 .0
236+ node-version : 20.12 .0
211237 registry-url : https://npm.pkg.github.com/
212238 scope : " @mobsuccess-devops"
213239 - run : echo "registry=https://npm.pkg.github.com/@mobsuccess-devops" >> .npmrc
0 commit comments