From 91ba8232cf0e20ad6b9c2c8eed36f383ad505bf1 Mon Sep 17 00:00:00 2001 From: interstellarmt <787982239@qq.com> Date: Mon, 21 Sep 2026 15:33:51 +0800 Subject: [PATCH 1/2] chore: add GitHub Actions workflow for publishing to npm --- .github/workflows/publish.yml | 40 +++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 00000000..217fe460 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,40 @@ +name: Publish to npm + +on: + push: + tags: + - '[0-9]*.[0-9]*.[0-9]*' + +permissions: + id-token: write + contents: read + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: 24 + registry-url: 'https://registry.npmjs.org' + + - name: Install pnpm + uses: pnpm/action-setup@v4 + with: + version: 9 + + - name: Install dependencies + run: pnpm install + + - name: Build + run: pnpm build + + - name: Publish to NPM + run: | + if [[ "${{ github.ref_name }}" == *"-beta"* ]]; then + npm publish --access public --tag beta + else + npm publish --access public + fi From c2e369cd78d909c3d70f16655fd2d8931b3e1e7d Mon Sep 17 00:00:00 2001 From: interstellarmt <787982239@qq.com> Date: Mon, 21 Sep 2026 15:47:51 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=E4=BD=BF=E7=94=A8=20npm?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/publish.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 217fe460..1fd8cfdc 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -20,16 +20,11 @@ jobs: node-version: 24 registry-url: 'https://registry.npmjs.org' - - name: Install pnpm - uses: pnpm/action-setup@v4 - with: - version: 9 - - name: Install dependencies - run: pnpm install + run: npm install - name: Build - run: pnpm build + run: npm run build - name: Publish to NPM run: |