From c51c5b284d28150ca3bcfa823e44ba01db29b978 Mon Sep 17 00:00:00 2001 From: Levi Date: Sat, 24 Oct 2026 00:39:11 +0800 Subject: [PATCH] fix(ci): select the first Windows compiler for runtime packaging (#1604) --- .github/workflows/build.yml | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 28a4ff55..96e6afbc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -84,6 +84,17 @@ jobs: - uses: actions/setup-go@v5 with: go-version: ${{ env.GO_VERSION }} + - name: Diagnose Windows compiler selection + if: matrix.arch == 'amd64' && github.event.inputs.test == 'true' + run: | + $ccName = go env CC + Get-Command -Name $ccName -CommandType Application | Format-Table Source + $cc = (Get-Command -Name $ccName -CommandType Application -ErrorAction Stop | Select-Object -First 1).Source + Write-Host "Selected cgo compiler: $cc" + & $cc --version + foreach ($dll in @("libstdc++-6.dll", "libgcc_s_seh-1.dll", "libwinpthread-1.dll")) { + & $cc "-print-file-name=$dll" + } - uses: subosito/flutter-action@v2 with: channel: ${{ matrix.flutter_channel || 'stable' }} @@ -107,7 +118,7 @@ jobs: # for amd64 $release = "build\windows\x64\runner\Release\" # Use the same toolchain as cgo instead of Git's bundled DLLs. - $cc = (Get-Command -Name (go env CC) -CommandType Application -ErrorAction Stop).Source + $cc = (Get-Command -Name (go env CC) -CommandType Application -ErrorAction Stop | Select-Object -First 1).Source foreach ($dll in @("libstdc++-6.dll", "libgcc_s_seh-1.dll", "libwinpthread-1.dll")) { $runtimePath = [string](& $cc "-print-file-name=$dll") if ($LASTEXITCODE -ne 0 -or [string]::IsNullOrWhiteSpace($runtimePath)) { @@ -201,7 +212,15 @@ jobs: iscc.exe setup.iss mv "Output\gopeed.exe" "Output\Gopeed-$TAG-windows-${{ matrix.arch }}.exe" Compress-Archive -Path "Output\Gopeed-$TAG-windows-${{ matrix.arch }}.exe" -DestinationPath "Output\Gopeed-$TAG-windows-${{ matrix.arch }}.zip" + - name: Upload Windows test packages + if: github.event.inputs.test == 'true' + uses: actions/upload-artifact@v4 + with: + name: windows-${{ matrix.arch }}-packages + path: ui/flutter/build/windows/Output/* + if-no-files-found: error - name: Upload + if: github.event.inputs.test != 'true' uses: shogo82148/actions-upload-release-asset@v1.9.2 with: upload_url: ${{ needs.get-release.outputs.upload_url }}