From 545ed62ce13e7d83e97bd34caaf1970a9a1ef67e Mon Sep 17 00:00:00 2001 From: windychen Date: Fri, 29 May 2026 15:04:06 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E9=AA=8C=E8=AF=81=E5=AE=8C=E6=88=90?= =?UTF-8?q?=EF=BC=8C=E8=BF=98=E5=8E=9F=E5=B7=A5=E4=BD=9C=E6=B5=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/build.yaml | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index d9d7769..34c79ff 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -1,21 +1,28 @@ -name: Publish to Verdaccio +name: Node.js Build on: push: - branches: [ main, master ] + branches: [ "main", "master" ] + pull_request: + branches: [ "main", "master" ] jobs: - publish: - runs-on: docker + build: + runs-on: docker # 匹配你 runner 的标签 steps: - - name: Check NPM_TOKEN and configure registry - env: - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install dependencies + run: npm i # 或 npm install + + - name: Run build + run: npm run build + + - name: Setup npm for Verdaccio 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 + npm config set registry http://verdaccio:4873/ + npm config set //verdaccio:4873/:_authToken ${{ secrets.NPM_TOKEN }} + + - name: Publish package + run: npm publish \ No newline at end of file