Skip to content

Commit

Permalink
Create npm-publish-packages.yml
Browse files Browse the repository at this point in the history
Publish to npm and GitHub packages
  • Loading branch information
mayank1513 committed Jul 31, 2023
1 parent daaf8ba commit bb2a454
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/publish-on-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Publish to npm and GitHub

on:
release:
types: [created]

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
registry-url: https://npm.pkg.github.com/
- name: Update version
run: |
git config --global user.name "mayank1513"
git config --global user.email "[email protected]"
git fetch
git checkout main
npm i && npm version patch
git push origin main
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
- uses: actions/setup-node@v3
with:
registry-url: https://registry.npmjs.org
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}}
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@mayank1513:registry=https://npm.pkg.github.com

0 comments on commit bb2a454

Please sign in to comment.