mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-17 22:03:41 +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
|
- uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version: ${{ env.GO_VERSION }}
|
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
|
- uses: subosito/flutter-action@v2
|
||||||
with:
|
with:
|
||||||
channel: ${{ matrix.flutter_channel || 'stable' }}
|
channel: ${{ matrix.flutter_channel || 'stable' }}
|
||||||
@@ -107,7 +118,7 @@ jobs:
|
|||||||
# for amd64
|
# for amd64
|
||||||
$release = "build\windows\x64\runner\Release\"
|
$release = "build\windows\x64\runner\Release\"
|
||||||
# Use the same toolchain as cgo instead of Git's bundled DLLs.
|
# 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")) {
|
foreach ($dll in @("libstdc++-6.dll", "libgcc_s_seh-1.dll", "libwinpthread-1.dll")) {
|
||||||
$runtimePath = [string](& $cc "-print-file-name=$dll")
|
$runtimePath = [string](& $cc "-print-file-name=$dll")
|
||||||
if ($LASTEXITCODE -ne 0 -or [string]::IsNullOrWhiteSpace($runtimePath)) {
|
if ($LASTEXITCODE -ne 0 -or [string]::IsNullOrWhiteSpace($runtimePath)) {
|
||||||
@@ -201,7 +212,15 @@ jobs:
|
|||||||
iscc.exe setup.iss
|
iscc.exe setup.iss
|
||||||
mv "Output\gopeed.exe" "Output\Gopeed-$TAG-windows-${{ matrix.arch }}.exe"
|
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"
|
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
|
- name: Upload
|
||||||
|
if: github.event.inputs.test != 'true'
|
||||||
uses: shogo82148/[email protected]
|
uses: shogo82148/[email protected]
|
||||||
with:
|
with:
|
||||||
upload_url: ${{ needs.get-release.outputs.upload_url }}
|
upload_url: ${{ needs.get-release.outputs.upload_url }}
|
||||||
|
|||||||
Reference in new issue
Block a user