diff --git a/.gitea/workflows/build-windows-release.yml b/.gitea/workflows/build-windows-release.yml index dfb0283..a3c4028 100644 --- a/.gitea/workflows/build-windows-release.yml +++ b/.gitea/workflows/build-windows-release.yml @@ -89,17 +89,7 @@ jobs: mkdir -p dist-windows/chengnan cp build-windows/chengnan.exe dist-windows/chengnan/ /ucrt64/bin/windeployqt6.exe --release --no-translations dist-windows/chengnan/chengnan.exe || /ucrt64/bin/windeployqt.exe --release --no-translations dist-windows/chengnan/chengnan.exe - cat > dist-windows/chengnan/README.txt <<'EOF' - chengnan Windows x64 发布包 - - 运行方式: - 1. 解压整个目录。 - 2. 双击 chengnan.exe 运行。 - - 说明: - - 本目录由 Windows Runner 使用 MSYS2 UCRT64 + Qt 构建生成。 - - 请不要只复制 chengnan.exe,需保留同目录 DLL 和 Qt 插件目录。 - EOF + printf '%s\n' 'chengnan Windows x64 package' '' 'Usage:' '1. Extract the whole directory.' '2. Double-click chengnan.exe to run.' '' 'Note:' '- This package is built by Windows Runner with MSYS2 UCRT64 + Qt.' '- Do not copy chengnan.exe alone; keep DLLs and Qt plugin directories together.' > dist-windows/chengnan/README.txt "@ & $bash -lc $script @@ -110,13 +100,14 @@ jobs: $shortSha = $env:GITHUB_SHA.Substring(0, 10) $version = if ($env:GITHUB_REF_TYPE -eq 'tag') { $env:GITHUB_REF_NAME } else { "build-$shortSha" } $zipName = "$env:PACKAGE_BASENAME-$version.zip" - $dist = Join-Path $env:SOURCE_DIR 'dist-windows\chengnan' + $sourceDir = Join-Path $env:RUNNER_TEMP 'chengnan-work' + $dist = Join-Path $sourceDir 'dist-windows\chengnan' if (-not (Test-Path "$dist\chengnan.exe")) { throw "Missing build output: $dist\chengnan.exe" } Push-Location (Split-Path $dist -Parent) - if (Test-Path (Join-Path $env:SOURCE_DIR $zipName)) { Remove-Item -Force (Join-Path $env:SOURCE_DIR $zipName) } - Compress-Archive -Path 'chengnan\*' -DestinationPath (Join-Path $env:SOURCE_DIR $zipName) -Force + if (Test-Path (Join-Path $sourceDir $zipName)) { Remove-Item -Force (Join-Path $sourceDir $zipName) } + Compress-Archive -Path 'chengnan\*' -DestinationPath (Join-Path $sourceDir $zipName) -Force Pop-Location - $zipPath = Join-Path $env:SOURCE_DIR $zipName + $zipPath = Join-Path $sourceDir $zipName $hash = (Get-FileHash $zipPath -Algorithm SHA256).Hash.ToLowerInvariant() "$hash $zipName" | Out-File -FilePath "$zipPath.sha256" -Encoding ascii "PACKAGE_ZIP=$zipPath" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8