From 2ea10e2df4e59bfed8187791cc862826a9dfb58a Mon Sep 17 00:00:00 2001 From: windychen Date: Fri, 29 May 2026 14:56:37 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E8=B0=83=E8=AF=95=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E6=B5=81=E6=8E=A8=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/build.yaml | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index b0d0270..d9d7769 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -1,16 +1,21 @@ -name: Node.js Build +name: Publish to Verdaccio on: push: - branches: [ "main", "master" ] - pull_request: - branches: [ "main", "master" ] + branches: [ main, master ] jobs: - build: - runs-on: docker # 匹配你 runner 的标签 + publish: + runs-on: docker steps: - - name: Debug token length + - name: Check NPM_TOKEN and configure registry env: - TOKEN: ${{ secrets.NPM_TOKEN }} - run: echo "Token length: ${#TOKEN}" + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + run: | + if [ -z "$NPM_TOKEN" ]; then + echo "Error: NPM_TOKEN secret is not set" + exit 1 + fi + npm config set registry http://verdaccio:4873/ + npm config set //verdaccio:4873/:_authToken "$NPM_TOKEN" + npm whoami # 验证身份 \ No newline at end of file