Skip to content

Commit bb2a454

Browse files
committed
Create npm-publish-packages.yml
Publish to npm and GitHub packages
1 parent daaf8ba commit bb2a454

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Publish to npm and GitHub
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
publish:
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+
registry-url: https://npm.pkg.github.com/
16+
- name: Update version
17+
run: |
18+
git config --global user.name "mayank1513"
19+
git config --global user.email "[email protected]"
20+
git fetch
21+
git checkout main
22+
npm i && npm version patch
23+
git push origin main
24+
- run: npm publish
25+
env:
26+
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
27+
- uses: actions/setup-node@v3
28+
with:
29+
registry-url: https://registry.npmjs.org
30+
- run: npm publish
31+
env:
32+
NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}}

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@mayank1513:registry=https://npm.pkg.github.com

0 commit comments

Comments
 (0)