Skip to content

Commit

Permalink
ci: add a github actions for publishing to npm
Browse files Browse the repository at this point in the history
Signed-off-by: Sarthak Shyngle <[email protected]>
  • Loading branch information
Sarthak160 committed Jun 25, 2024
1 parent 03bae50 commit b40a15c
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Publish to npm

on:
release:
types: [published]

jobs:
build-and-publish:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '16' # Change this to the Node.js version you are using
cache: 'npm'

- name: Install dependencies
run: npm install

- name: Build project
run: npm run build

- name: Publish to npm
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish

0 comments on commit b40a15c

Please sign in to comment.