Skip to content

Commit f28f10e

Browse files
committed
workflow to publish package
1 parent 7c9e39f commit f28f10e

File tree

4 files changed

+41
-0
lines changed

4 files changed

+41
-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@v2
12+
- uses: actions/setup-node@v2
13+
with:
14+
node-version: 12
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@v2
26+
- uses: actions/setup-node@v2
27+
with:
28+
node-version: 12
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}}

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -97,3 +97,7 @@ lcov.info
9797
coverage/lcov-report/
9898

9999
.DS_Store
100+
test/coverage/*.xml
101+
test/coverage/*.json
102+
test/coverage/*.info
103+
test/coverage/lcov-report

.npmrc

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

package.json

+3
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@
3939
"dependencies": {
4040
"qs": "^6.10.1"
4141
},
42+
"publishConfig": {
43+
"@128keaton:registry": "https://npm.pkg.github.com"
44+
},
4245
"files": [
4346
"dist"
4447
]

0 commit comments

Comments
 (0)