Skip to content

Commit aced4b2

Browse files
committed
ci: publish to both registries in the same job
1 parent 2a35cff commit aced4b2

1 file changed

Lines changed: 9 additions & 12 deletions

File tree

.github/workflows/publish-npm-package.yml

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,36 @@ name: Publish Node.js package
22

33
on:
44
release:
5-
types: [created]
5+
types: [ created ]
66
workflow_dispatch:
77

88
env:
99
NODE_ENV: production
10+
NODE_VERSION: '10.x'
1011

1112
jobs:
12-
build-npmjs:
13+
build-and-publish:
14+
name: Build and publish Node.js package
1315
runs-on: ubuntu-latest
16+
permissions:
17+
contents: read
18+
packages: write
1419
steps:
1520
- uses: actions/checkout@v3
1621
- name: Set up publishing to npmjs.com
1722
uses: actions/setup-node@v3
1823
with:
19-
node-version: '10.x'
24+
node-version: ${{ env.NODE_VERSION }}
2025
registry-url: 'https://registry.npmjs.org'
2126
- run: npm ci
2227
- run: npm publish
2328
env:
2429
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
25-
build-github-packages:
26-
runs-on: ubuntu-latest
27-
permissions:
28-
contents: read
29-
packages: write
30-
steps:
31-
- uses: actions/checkout@v3
3230
- name: Set up publishing to GitHub Packages
3331
uses: actions/setup-node@v3
3432
with:
35-
node-version: '10.x'
33+
node-version: ${{ env.NODE_VERSION }}
3634
registry-url: 'https://npm.pkg.github.com'
37-
- run: npm ci
3835
- run: npm publish
3936
env:
4037
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)