From 88f024c414294f2408e156d8f5ea8e31598ccf26 Mon Sep 17 00:00:00 2001 From: Jhonton Chen <504071088@qq.com> Date: Tue, 7 Apr 2026 22:12:29 +0800 Subject: [PATCH] =?UTF-8?q?'=E6=97=A0=E8=AF=AD'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/deploy.yml | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index dfee4c8..55d0413 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -5,11 +5,11 @@ on: tags: - "v*" branches: - - main # 暂时允许推送到 main 分支也触发,方便你测试流程 + - main jobs: deploy-job: - runs-on: windows # 确保你的 config.yaml 里标签匹配 + runs-on: windows steps: - name: 1. 检查代码检出 @@ -18,25 +18,31 @@ jobs: fetch-depth: 0 - name: 2. 打印环境信息 - shell: cmd + # 强制使用 powershell 并且设置编码为 UTF8 + shell: powershell run: | - echo "当前目录: %CD%" + $OutputEncoding = [Console]::OutputEncoding = [System.Text.Encoding]::UTF8 + chcp 65001 + Write-Host "当前目录: $PWD" node -v pnpm -v - echo "当前 Tag/分支: ${{ github.ref_name }}" + Write-Host "当前 Tag/分支: ${{ github.ref_name }}" - - name: 3. 安装依赖 (利用本地缓存) - shell: cmd - run: pnpm install --prefer-offline + - name: 3. 安装依赖 + shell: powershell + run: | + $OutputEncoding = [Console]::OutputEncoding = [System.Text.Encoding]::UTF8 + chcp 65001 + pnpm install --prefer-offline - name: 4. 执行部署脚本 - shell: cmd - run: node deploy.js + shell: powershell + run: | + $OutputEncoding = [Console]::OutputEncoding = [System.Text.Encoding]::UTF8 + chcp 65001 + node scripts/deploy.js env: - # 显式传入所有变量,确保脚本能读到 SENTRY_URL: ${{ secrets.GLITCHTIP_URL }} SENTRY_AUTH_TOKEN: ${{ secrets.GLITCHTIP_TOKEN }} SENTRY_ORG: ${{ secrets.GLITCHTIP_ORG }} SENTRY_PROJECT: ${{ secrets.GLITCHTIP_PROJECT }} - # 调试开关:让脚本输出更多信息 - NODE_ENV: production