소스 검색

fix(ci): 将 Windows 工作流从 Bash 迁移至 PowerShell

- 添加执行策略检查步骤(提前检测配置问题)
- 将所有 shell: bash 改为 shell: powershell
- 转换文件操作:echo -> Out-File, rm -> Remove-Item
- 转换路径:/tmp/ -> F:\Users\ddx\AppData\Local\Temp\
- 转换时间戳:date -> Get-Date
- 使用 scp -r 替代 rsync
- 修复 WSL bash 导致的执行策略错误

前置要求:需在 runner 机器上设置执行策略
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser -Force
dengdx 5 일 전
부모
커밋
d1b4b72ed6
1개의 변경된 파일4개의 추가작업 그리고 3개의 파일을 삭제
  1. 4 3
      .github/workflows/build-win-h5-only.yml

+ 4 - 3
.github/workflows/build-win-h5-only.yml

@@ -17,9 +17,10 @@ jobs:
   build-h5-production:
     runs-on: [win-h5-only]
     steps:
-      - name: 设置 PowerShell 执行策略
-        shell: powershell
-        run: Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process -Force
+      - name: 检查 PowerShell 执行策略
+        shell: cmd
+        run: |
+          powershell -Command "$policy = Get-ExecutionPolicy -Scope CurrentUser; Write-Host '当前执行策略:' $policy; if ($policy -eq 'Restricted' -or $policy -eq 'Undefined') { Write-Error '执行策略未正确配置!请在 runner 机器上执行:Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser -Force'; exit 1 } else { Write-Host '✓ 执行策略检查通过' }"
 
       - name: Test SSH key
         shell: powershell