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 }}