From 93d90eb653c968fae2b00477a6fda24d8dcfb76d Mon Sep 17 00:00:00 2001 From: imsyy Date: Thu, 6 Jun 2024 09:39:09 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=B3=20chore:=20Publish=20npm?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/npm.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/npm.yml diff --git a/.github/workflows/npm.yml b/.github/workflows/npm.yml new file mode 100644 index 0000000..a72c3cd --- /dev/null +++ b/.github/workflows/npm.yml @@ -0,0 +1,32 @@ +name: Publish npm package + +on: + release: + types: [created] + +jobs: + publish-npm: + runs-on: + ubuntu-latest + strategy: + matrix: + node-version: [20] + steps: + - name: Check out the repo + uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + registry-url: https://registry.npmjs.org + + - name: Install dependencies + run: npm install + + - name: Build + run: npm run build + + - name: Publish to npm + run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}