11name : build
22
3+ permissions :
4+ contents : write
5+ id-token : write
6+
37on :
48 push :
59 branches : [ '**' ]
6- pull_request :
7- branches : [ '**' ]
810
911jobs :
1012 lint :
@@ -179,7 +181,7 @@ jobs:
179181 name : Deploy ngx-repository
180182 runs-on : ubuntu-latest
181183 needs : [ test, lint, build-ngx-repository, build-ngx-http-repository, build-ngx-firestore-repository ]
182- if : github.ref == 'refs/heads/master'
184+ if : " github.ref == 'refs/heads/master' && startsWith(github.event.head_commit.message, 'release: v') "
183185 strategy :
184186 matrix :
185187 node-version : [ 18 ]
@@ -194,23 +196,28 @@ jobs:
194196 name : ngx-repository
195197 path : ./dist/ngx-repository
196198
197- - name : " Publish @paddls/ngx-repository "
198- uses : pascalgn/npm-publish-action@1.3.9
199+ - name : Setup Node
200+ uses : actions/setup-node@v4
199201 with :
200- tag_name : " v%s"
201- tag_message : " v%s"
202- commit_pattern : " ^release: v(\\ S+)"
203- workspace : " ./dist/ngx-repository"
204- publish_args : " --access public"
205- env :
206- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
207- NPM_AUTH_TOKEN : ${{ secrets.NPM_AUTH_TOKEN_PADDLS }}
202+ node-version : ${{ matrix.node-version }}
203+ registry-url : ' https://registry.npmjs.org'
204+
205+ - run : npm whoami || echo "trusted publishing context"
206+
207+ - name : Publish
208+ working-directory : ./dist/ngx-repository
209+ run : npm publish --access public
210+
211+ - name : Tag repo
212+ run : |
213+ git tag v$(node -p "require('./dist/ngx-repository/package.json').version")
214+ git push origin --tags
208215
209216 deploy-witty-ngx-repository :
210217 name : Deploy witty ngx-repository
211218 runs-on : ubuntu-latest
212219 needs : [ test, lint, build-ngx-repository, build-ngx-http-repository, build-ngx-firestore-repository ]
213- if : github.ref == 'refs/heads/master'
220+ if : " github.ref == 'refs/heads/master' && startsWith(github.event.head_commit.message, 'release: v') "
214221 strategy :
215222 matrix :
216223 node-version : [ 18 ]
@@ -219,6 +226,11 @@ jobs:
219226 - name : Checkout Repository
220227 uses : actions/checkout@v2
221228
229+ - name : Setup Node
230+ uses : actions/setup-node@v1
231+ with :
232+ node-version : ${{ matrix.node-version }}
233+
222234 - name : Download artifact
223235 uses : actions/download-artifact@master
224236 with :
@@ -231,22 +243,16 @@ jobs:
231243 file : " ./dist/ngx-repository/package.json"
232244 field : name
233245 value : " @witty-services/ngx-repository"
234- - name : " Publish @witty-services/ngx-repository"
235- uses : pascalgn/npm-publish-action@1.3.9
236- with :
237- commit_pattern : " ^release: v(\\ S+)"
238- workspace : " ./dist/ngx-repository"
239- publish_args : " --access public"
240- create_tag : " false"
241- env :
242- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
243- NPM_AUTH_TOKEN : ${{ secrets.NPM_AUTH_TOKEN_PADDLS }}
246+
247+ - name : Publish
248+ working-directory : ./dist/ngx-repository
249+ run : npm publish --access public
244250
245251 deploy-ngx-http-repository :
246252 name : Deploy ngx-http-repository
247253 runs-on : ubuntu-latest
248254 needs : [ test, lint, build-ngx-repository, build-ngx-http-repository, build-ngx-firestore-repository ]
249- if : github.ref == 'refs/heads/master'
255+ if : " github.ref == 'refs/heads/master' && startsWith(github.event.head_commit.message, 'release: v') "
250256 strategy :
251257 matrix :
252258 node-version : [ 18 ]
@@ -255,28 +261,26 @@ jobs:
255261 - name : Checkout Repository
256262 uses : actions/checkout@v2
257263
264+ - name : Setup Node
265+ uses : actions/setup-node@v1
266+ with :
267+ node-version : ${{ matrix.node-version }}
268+
258269 - name : Download artifact
259270 uses : actions/download-artifact@master
260271 with :
261272 name : ngx-http-repository
262273 path : ./dist/ngx-http-repository
263274
264- - name : " Publish @paddls/ngx-http-repository"
265- uses : pascalgn/npm-publish-action@1.3.9
266- with :
267- commit_pattern : " ^release: v(\\ S+)"
268- workspace : " ./dist/ngx-http-repository"
269- publish_args : " --access public"
270- create_tag : " false"
271- env :
272- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
273- NPM_AUTH_TOKEN : ${{ secrets.NPM_AUTH_TOKEN_PADDLS }}
275+ - name : Publish
276+ working-directory : ./dist/ngx-http-repository
277+ run : npm publish --access public
274278
275279 deploy-witty-ngx-http-repository :
276280 name : Deploy witty ngx-http-repository
277281 runs-on : ubuntu-latest
278282 needs : [ test, lint, build-ngx-repository, build-ngx-http-repository, build-ngx-firestore-repository ]
279- if : github.ref == 'refs/heads/master'
283+ if : " github.ref == 'refs/heads/master' && startsWith(github.event.head_commit.message, 'release: v') "
280284 strategy :
281285 matrix :
282286 node-version : [ 18 ]
@@ -285,6 +289,11 @@ jobs:
285289 - name : Checkout Repository
286290 uses : actions/checkout@v2
287291
292+ - name : Setup Node
293+ uses : actions/setup-node@v1
294+ with :
295+ node-version : ${{ matrix.node-version }}
296+
288297 - name : Download artifact
289298 uses : actions/download-artifact@master
290299 with :
@@ -297,22 +306,16 @@ jobs:
297306 file : " ./dist/ngx-http-repository/package.json"
298307 field : name
299308 value : " @witty-services/ngx-http-repository"
300- - name : " Publish @witty-services/ngx-http-repository"
301- uses : pascalgn/npm-publish-action@1.3.9
302- with :
303- commit_pattern : " ^release: v(\\ S+)"
304- workspace : " ./dist/ngx-http-repository"
305- publish_args : " --access public"
306- create_tag : " false"
307- env :
308- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
309- NPM_AUTH_TOKEN : ${{ secrets.NPM_AUTH_TOKEN_PADDLS }}
309+
310+ - name : Publish
311+ working-directory : ./dist/ngx-http-repository
312+ run : npm publish --access public
310313
311314 deploy-ngx-firestore-repository :
312315 name : Deploy ngx-firestore-repository
313316 runs-on : ubuntu-latest
314317 needs : [ test, lint, build-ngx-repository, build-ngx-http-repository, build-ngx-firestore-repository ]
315- if : github.ref == 'refs/heads/master'
318+ if : " github.ref == 'refs/heads/master' && startsWith(github.event.head_commit.message, 'release: v') "
316319 strategy :
317320 matrix :
318321 node-version : [ 18 ]
@@ -321,28 +324,26 @@ jobs:
321324 - name : Checkout Repository
322325 uses : actions/checkout@v2
323326
327+ - name : Setup Node
328+ uses : actions/setup-node@v1
329+ with :
330+ node-version : ${{ matrix.node-version }}
331+
324332 - name : Download artifact
325333 uses : actions/download-artifact@master
326334 with :
327335 name : ngx-firestore-repository
328336 path : ./dist/ngx-firestore-repository
329337
330- - name : " Publish @paddls/ngx-firestore-repository"
331- uses : pascalgn/npm-publish-action@1.3.9
332- with :
333- commit_pattern : " ^release: v(\\ S+)"
334- workspace : " ./dist/ngx-firestore-repository"
335- publish_args : " --access public"
336- create_tag : " false"
337- env :
338- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
339- NPM_AUTH_TOKEN : ${{ secrets.NPM_AUTH_TOKEN_PADDLS }}
338+ - name : Publish
339+ working-directory : ./dist/ngx-firestore-repository
340+ run : npm publish --access public
340341
341342 deploy-witty-ngx-firestore-repository :
342343 name : Deploy witty ngx-firestore-repository
343344 runs-on : ubuntu-latest
344345 needs : [ test, lint, build-ngx-repository, build-ngx-http-repository, build-ngx-firestore-repository ]
345- if : github.ref == 'refs/heads/master'
346+ if : " github.ref == 'refs/heads/master' && startsWith(github.event.head_commit.message, 'release: v') "
346347 strategy :
347348 matrix :
348349 node-version : [ 18 ]
@@ -351,6 +352,11 @@ jobs:
351352 - name : Checkout Repository
352353 uses : actions/checkout@v2
353354
355+ - name : Setup Node
356+ uses : actions/setup-node@v1
357+ with :
358+ node-version : ${{ matrix.node-version }}
359+
354360 - name : Download artifact
355361 uses : actions/download-artifact@master
356362 with :
@@ -363,13 +369,7 @@ jobs:
363369 file : " ./dist/ngx-firestore-repository/package.json"
364370 field : name
365371 value : " @witty-services/ngx-firestore-repository"
366- - name : " Publish @witty-services/ngx-firestore-repository"
367- uses : pascalgn/npm-publish-action@1.3.9
368- with :
369- commit_pattern : " ^release: v(\\ S+)"
370- workspace : " ./dist/ngx-firestore-repository"
371- publish_args : " --access public"
372- create_tag : " false"
373- env :
374- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
375- NPM_AUTH_TOKEN : ${{ secrets.NPM_AUTH_TOKEN_PADDLS }}
372+
373+ - name : Publish
374+ working-directory : ./dist/ngx-firestore-repository
375+ run : npm publish --access public
0 commit comments