diff --git a/.gitea/workflows/master.yml b/.gitea/workflows/master.yml index 7f96524..3b6d03f 100644 --- a/.gitea/workflows/master.yml +++ b/.gitea/workflows/master.yml @@ -11,7 +11,7 @@ on: jobs: build: name: 打包 Uniapp 项目 - runs-on: ubuntu # 云 Runner 环境(自建 Runner 可替换为自定义名称) + runs-on: windows # 云 Runner 环境(自建 Runner 可替换为自定义名称) steps: ######################################################################## # 步骤 1:检出 Gitea 代码 @@ -51,10 +51,10 @@ jobs: # 解压到目标目录 # unzip -q hbuilderx.zip -d /hbuilderxcli/HBuilderX # 赋予 CLI 执行权限 - sudo chmod +x /hbuilderxcli/HBuilderX/cli + # sudo chmod +x /hbuilderxcli/HBuilderX/cli # 验证 CLI 版本(确保部署成功) - /hbuilderxcli/HBuilderX/cli -v - echo "HBuilderX CLI 部署完成,路径:/hbuilderxcli/HBuilderX/cli" + C:\Users\Administrator\Desktop\runner\HBuilderX\cli -v + echo "HBuilderX CLI 部署完成,路径:C:\Users\Administrator\Desktop\runner\HBuilderX\cli" ######################################################################## # 步骤 5:HBuilderX 密钥登录(安全读取账户信息) @@ -64,7 +64,7 @@ jobs: run: | echo "开始登录 HBuilderX 账户..." # 执行登录命令(读取 Gitea Secrets 中的账户密码) - LOGIN_OUTPUT=$(/hbuilderxcli/HBuilderX/cli user login --username ${{ secrets.HBUILDERX_USERNAME }} --password ${{ secrets.HBUILDERX_PASSWORD }}) + LOGIN_OUTPUT=$(C:\Users\Administrator\Desktop\runner\HBuilderX\cli user login --username ${{ secrets.HBUILDERX_USERNAME }} --password ${{ secrets.HBUILDERX_PASSWORD }}) # 打印登录输出(便于调试,无敏感信息) echo "登录结果:$LOGIN_OUTPUT" # 验证登录是否成功(根据文档,成功返回 "0:user login:OK") @@ -84,13 +84,13 @@ jobs: echo "========================================" echo "正在查询打包队列状态..." # (可选)提前查询队列(部分场景下 HBuilderX 会返回排队信息) - /hbuilderxcli/HBuilderX/cli publish --platform android --query-queue + C:\Users\Administrator\Desktop\runner\HBuilderX\cli publish --platform android --query-queue echo "========================================" echo "开始执行打包(实时输出进度)..." # 执行打包命令(根据目标平台调整 --platform 参数,支持 android/ios/h5 等) # --project:指定项目根目录(当前检出目录) # --output:指定产物输出目录(便于后续归档) - BUILD_OUTPUT=$(/hbuilderxcli/HBuilderX/cli publish \ + BUILD_OUTPUT=$(C:\Users\Administrator\Desktop\runner\HBuilderX\cli publish \ --platform android \ --project ./ \ --output ./unpackage/dist/build/android \ @@ -123,7 +123,7 @@ jobs: - name: 8. HBuilderX 账户登出 run: | echo "开始登出 HBuilderX 账户..." - LOGOUT_OUTPUT=$(/hbuilderxcli/HBuilderX/cli user logout) + LOGOUT_OUTPUT=$(C:\Users\Administrator\Desktop\runner\HBuilderX\cli user logout) echo "登出结果:$LOGOUT_OUTPUT" # 验证登出是否成功(根据文档,成功返回 "0:user logout:OK") if [[ $(echo "$LOGOUT_OUTPUT" | grep -c "0:user logout:OK") -eq 0 ]]; then