Skip to content

Commit 170ec5d

Browse files
committed
add: workflow to publish package
1 parent 63c35fa commit 170ec5d

File tree

3 files changed

+37
-0
lines changed

3 files changed

+37
-0
lines changed

.github/workflows/release-package.yml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Node.js Package
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v3
12+
- uses: actions/setup-node@v3
13+
with:
14+
node-version: 16
15+
- run: npm ci
16+
- run: npm test
17+
18+
publish-gpr:
19+
needs: build
20+
runs-on: ubuntu-latest
21+
permissions:
22+
packages: write
23+
contents: read
24+
steps:
25+
- uses: actions/checkout@v3
26+
- uses: actions/setup-node@v3
27+
with:
28+
node-version: 16
29+
registry-url: https://npm.pkg.github.com/
30+
- run: npm ci
31+
- run: npm publish
32+
env:
33+
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}

.npmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@ashutosh887:registry=https://npm.pkg.github.com

package.json

+3
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,8 @@
2828
"chalk": "^5.2.0",
2929
"chalk-animation": "^2.0.3",
3030
"inquirer": "^9.1.4"
31+
},
32+
"publishConfig": {
33+
"@ashutosh887:registry": "https://npm.pkg.github.com"
3134
}
3235
}

0 commit comments

Comments
 (0)