From 20df6ee7d7b85f501577f23f72f1346e6fce34ae Mon Sep 17 00:00:00 2001 From: zkz098 <92242020+zkz098@users.noreply.github.com> Date: Sat, 20 May 2023 14:19:48 +0800 Subject: [PATCH] Update npm-publish.yml --- .github/workflows/npm-publish.yml | 39 ++++++++++++++++++------------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index f0230c7..2f1c6a2 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -4,32 +4,39 @@ on: release: types: [created] -env: - NPM_TOKEN: ${{ secrets.npm_token }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - jobs: publish: if: "!github.event.release.prerelease" runs-on: ubuntu-latest - strategy: - matrix: - registry: - - name: NPM Registry - url: https://registry.npmjs.org/ - token: ${{ env.NPM_TOKEN }} - - name: GitHub Packages Registry - url: https://npm.pkg.github.com/ - token: ${{ env.GITHUB_TOKEN }} - steps: - uses: actions/checkout@v2 - uses: actions/setup-node@v2 with: node-version: 16 - registry-url: ${{ matrix.registry.url }} + registry-url: https://registry.npmjs.org/ + + - name: Install dependencies + run: npm install pnpm -g + - name: Build TypeScript files + run: pnpm run build + + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.npm_token }} + + publish-gh: + if: "!github.event.release.prerelease" + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: 16 + registry-url: https://npm.pkg.github.com + - name: Install dependencies run: npm install pnpm -g @@ -38,4 +45,4 @@ jobs: - run: npm publish env: - NODE_AUTH_TOKEN: ${{ matrix.registry.token }} + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}