From b40a15cbfbc383a35b24d0161522ed5532eb2c15 Mon Sep 17 00:00:00 2001 From: Sarthak Shyngle <50234097+Sarthak160@users.noreply.github.com> Date: Tue, 25 Jun 2024 14:44:51 +0530 Subject: [PATCH] ci: add a github actions for publishing to npm Signed-off-by: Sarthak Shyngle <50234097+Sarthak160@users.noreply.github.com> --- .github/workflows/release.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..39bd661 --- /dev/null +++ b/.github/workflows/release.yml @@ -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