diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml index b4efe61d..c84ffcd6 100644 --- a/.github/release-drafter.yml +++ b/.github/release-drafter.yml @@ -40,16 +40,24 @@ template: | - - + + - + + + + + + + + + diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 63882aef..3b0603d9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -34,19 +34,60 @@ jobs: build-windows: if: ${{ github.event.inputs.platform == 'all' || github.event.inputs.platform == 'windows' }} - runs-on: windows-2022 needs: [get-release] + strategy: + fail-fast: false + matrix: + include: + - arch: arm64 + os: windows-11-arm + llvm_ver: "20251202" # Only ARM64 + flutter_channel: 'master' + flutter_version: '8817d45220d' # Only ARM64 + - arch: amd64 + os: windows-2022 + flutter_channel: 'stable' + runs-on: ${{ matrix.os }} + steps: - uses: actions/checkout@v3 + + # Install LLVM environment only on ARM64 + - name: Install llvm-mingw-ucrt-aarch64 (ARM64 only) + if: matrix.arch == 'arm64' + run: | + $ver = "${{ matrix.llvm_ver }}" + $url = "https://github.com/mstorsjo/llvm-mingw/releases/download/$ver/llvm-mingw-$ver-ucrt-aarch64.zip" + $zip = "$env:RUNNER_TEMP\\llvm.zip" + $extract = "$env:RUNNER_TEMP\\extract" + $target = "C:\\clangarm64" + + curl -L $url -o $zip + rm -r -fo $extract,$target -ea Ignore + mkdir $extract | Out-Null + + tar -xf $zip -C $extract + mv (Get-ChildItem $extract)[0].FullName $target + + $b = "$target\\bin" + "CC=$b\\clang.exe" >> $env:GITHUB_ENV + "CXX=$b\\clang++.exe" >> $env:GITHUB_ENV + "CLANGARM64_BIN=$b" >> $env:GITHUB_ENV + "CGO_ENABLED=1" >> $env:GITHUB_ENV + "CLANGARM64_ROOT=$target" >> $env:GITHUB_ENV + $b >> $env:GITHUB_PATH + - uses: actions/setup-go@v4 with: go-version: ${{ env.GO_VERSION }} - uses: subosito/flutter-action@v2 with: - flutter-version: ${{ env.FLUTTER_VERSION }} + channel: ${{ matrix.flutter_channel }} + flutter-version: ${{ matrix.flutter_version || env.FLUTTER_VERSION }} - name: Build env: VERSION: ${{ needs.get-release.outputs.version }} + GOARCH: ${{ matrix.arch }} run: | Invoke-WebRequest -Uri "https://github.com/jrsoftware/issrc/raw/main/Files/Languages/Unofficial/ChineseSimplified.isl" -OutFile "ChineseSimplified.isl" mv ChineseSimplified.isl "C:\Program Files (x86)\Inno Setup 6\Languages\" @@ -57,18 +98,26 @@ jobs: cd ui/flutter $TAG = "v$env:VERSION" flutter build windows --dart-define="UPDATE_CHANNEL=windowsPortable" - $mingw = "C:\Program Files\Git\mingw64\bin" $system = "C:\Windows\System32" - $release = "build\windows\x64\runner\Release\" - cp $mingw\libstdc++-6.dll $release - cp $mingw\libgcc_s_seh-1.dll $release + if ("${{ matrix.arch }}" -eq "amd64") { + # for amd64 + $release = "build\windows\x64\runner\Release\" + $mingw = "C:\Program Files\Git\mingw64\bin" + cp $mingw\libstdc++-6.dll $release + cp $mingw\libgcc_s_seh-1.dll $release + } else { + # for ARM64 + $release = "build\windows\arm64\runner\Release\" + $mingw = "$env:CLANGARM64_ROOT\aarch64-w64-mingw32\bin" + cp $mingw\libc++.dll $release + } cp $mingw\libwinpthread-1.dll $release cp $system\msvcp140.dll $release cp $system\vcruntime140.dll $release cp $system\vcruntime140_1.dll $release New-Item -Path build\windows\Output -ItemType Directory - Compress-Archive -Path "$release*" -DestinationPath "build\windows\Output\Gopeed-$TAG-windows-amd64-portable.zip" + Compress-Archive -Path "$release*" -DestinationPath "build\windows\Output\Gopeed-$TAG-windows-${{ matrix.arch }}-portable.zip" flutter build windows --dart-define="UPDATE_CHANNEL=windowsInstaller" cd build/windows @@ -116,7 +165,7 @@ jobs: Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked [Files] - Source: ".\x64\runner\Release\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs; + Source: ".\${{ matrix.arch == 'amd64' && 'x64' || 'arm64' }}\runner\Release\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs; ; NOTE: Don't use "Flags: ignoreversion" on any shared system files [UninstallDelete] @@ -130,9 +179,9 @@ jobs: Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent "@ > setup.iss iscc.exe setup.iss - mv "Output\gopeed.exe" "Output\Gopeed-$TAG-windows-amd64.exe" - Compress-Archive -Path "Output\Gopeed-$TAG-windows-amd64.exe" -DestinationPath "Output\Gopeed-$TAG-windows-amd64.zip" - Remove-Item -Path "Output\Gopeed-$TAG-windows-amd64.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" + Remove-Item -Path "Output\Gopeed-$TAG-windows-${{ matrix.arch }}.exe" - name: Upload uses: shogo82148/actions-upload-release-asset@v1 with: diff --git a/README.md b/README.md index ce0a614a..f57ad90e 100644 --- a/README.md +++ b/README.md @@ -25,16 +25,24 @@ Visit ✈ [Official Website](https://gopeed.com) | 📖 [Official Docs](https://
🪟 WindowsEXE🪟 WindowsEXE amd64 📥
Portablearm64📥
Portable amd64 📥
arm64📥
🍎 MacOS DMG
- - + + - + + + + + + + + + diff --git a/ui/flutter/pubspec.yaml b/ui/flutter/pubspec.yaml index afa81ebb..9596a6ca 100644 --- a/ui/flutter/pubspec.yaml +++ b/ui/flutter/pubspec.yaml @@ -57,7 +57,7 @@ dependencies: flutter_form_builder: ^9.5.0 form_builder_validators: ^11.0.0 flutter_foreground_task: ^8.2.0 - open_filex: ^4.5.0 + open_filex: ^4.7.0 tray_manager: git: url: https://github.com/monkeyWie/tray_manager.git
🪟 WindowsEXE🪟 WindowsEXE amd64 📥
Portablearm64📥
Portable amd64 📥
arm64📥
🍎 MacOS DMG