🎯 Why npmjs registry?
- Ready up to open source projects
- In-box GitHub Actions solution
- CLI support
-
Config GitHub workflow using a
yml
template as follows
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
name: npm
on:
release:
types: [published]
jobs:
publish-npm:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: '20.x'
registry-url: https://registry.npmjs.org
- run: npm install --package-lock-only
- run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: $
GITHUB_TOKEN: $