mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-04 08:10:55 +00:00
fix(ci): select the first Windows compiler for runtime packaging (#1604)
This commit is contained in:
1 file changed
+20
-1
@@ -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 }}
|
||||
|
||||
Reference in new issue
Block a user