From 5823c9ae08bbe22c1d1346af372276f23bc74037 Mon Sep 17 00:00:00 2001 From: Aniket Gupta Date: Thu, 23 Jan 2025 17:23:33 -0800 Subject: [PATCH] Create npm-publish.yml --- .github/workflows/npm-publish.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/npm-publish.yml diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml new file mode 100644 index 0000000..de7f31b --- /dev/null +++ b/.github/workflows/npm-publish.yml @@ -0,0 +1,31 @@ +name: Publish to npm + +on: + push: + branches: + - main + +jobs: + publish: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: 18 + registry-url: "https://registry.npmjs.org/" + + - name: Install dependencies + run: npm install + + - name: Build the package (if using TypeScript) + run: npm run build || echo "No build step" + + - name: Publish to npm + run: npm publish --access public + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}