diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 57bbf852..ff6c5105 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -44,15 +44,17 @@ jobs: - arch: arm64 os: windows-11-arm llvm_ver: "20251202" # Only ARM64 - flutter_channel: "master" - flutter_version: "8817d45220d" # Only ARM64 + flutter_channel: "main" + flutter_version: "7e1c8868" - arch: amd64 os: windows-2022 - flutter_channel: "stable" runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 + - name: Enable long paths for flutter main branch checks + run: | + git config --global core.longpaths true # Install LLVM environment only on ARM64 - name: Install llvm-mingw-ucrt-aarch64 (ARM64 only) @@ -84,7 +86,7 @@ jobs: go-version: ${{ env.GO_VERSION }} - uses: subosito/flutter-action@v2 with: - channel: ${{ matrix.flutter_channel }} + channel: ${{ matrix.flutter_channel || 'stable' }} flutter-version: ${{ matrix.flutter_version || env.FLUTTER_VERSION }} - name: Build env: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0708d526..529dda7c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -66,21 +66,56 @@ jobs: files: ./coverage.txt token: ${{ secrets.CODECOV_UPLOAD_TOKEN }} build-desktop: - name: Build desktop check - runs-on: ${{ matrix.os }} strategy: matrix: - os: [windows-2022, macos-latest, ubuntu-22.04, ubuntu-22.04-arm] + include: + - os: windows-2022 + - os: windows-11-arm + llvm_ver: "20251202" # Only ARM64 + flutter_channel: "main" + flutter_version: "7e1c8868" + - os: macos-latest + - os: ubuntu-22.04 + - os: ubuntu-22.04-arm + flutter_channel: "main" + name: Build desktop check (${{ matrix.os }}) + runs-on: ${{ matrix.os }} needs: [test] steps: - uses: actions/checkout@v3 + - name: Enable long paths for flutter main branch checks + run: | + git config --global core.longpaths true + - name: Install llvm-mingw-ucrt-aarch64 (ARM64 only) + if: matrix.os == 'windows-11-arm' + 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: master + channel: ${{ matrix.flutter_channel || 'stable' }} + flutter-version: ${{ matrix.flutter_version || env.FLUTTER_VERSION }} - if: runner.os == 'Windows' run: | go build -tags nosqlite -ldflags="-w -s" -buildmode=c-shared -o ui/flutter/windows/libgopeed.dll github.com/GopeedLab/gopeed/bind/desktop