Files
iDescriptor/.github/workflows/build-windows.yml
T
2025-11-13 20:56:44 +00:00

221 lines
7.4 KiB
YAML

name: Build Windows
on:
workflow_dispatch:
env:
QT_VERSION: "6.8.0"
GO_VERSION: "1.23.0"
LIBPLIST_VER: "2.7.0"
LIBTATSU_VER: "1.0.5"
LIBIMOBILEDEVICE_GLUE_VER: "1.3.2"
LIBIMOBILEDEVICE_VER: "1.4.0"
LIBIRECOVERY_VER: "1.3.1"
LIBUSBMUXD_VER: "2.1.1"
jobs:
build-windows:
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: "recursive"
token: ${{ secrets.PAT }}
- name: Setup MSYS2
uses: msys2/setup-msys2@v2
with:
msystem: mingw64
release: false
update: false
install: >-
coreutils
base-devel
git
mingw-w64-x86_64-gcc
make
libtool
autoconf
automake-wrapper
mingw-w64-x86_64-cmake
mingw-w64-x86_64-pugixml
mingw-w64-x86_64-libusb
mingw-w64-x86_64-qrencode
mingw-w64-x86_64-curl
mingw-w64-x86_64-openssl
mingw-w64-x86_64-libzip
mingw-w64-x86_64-libheif
mingw-w64-x86_64-go
p7zip
- name: Install GStreamer 1.26.5 from archive
run: |
pacman -U --noconfirm --needed --overwrite '*' \
https://repo.msys2.org/mingw/mingw64/mingw-w64-x86_64-gstreamer-1.26.5-1-any.pkg.tar.zst \
https://repo.msys2.org/mingw/mingw64/mingw-w64-x86_64-gst-plugins-base-1.26.5-1-any.pkg.tar.zst \
https://repo.msys2.org/mingw/mingw64/mingw-w64-x86_64-gst-plugins-good-1.26.5-1-any.pkg.tar.zst \
https://repo.msys2.org/mingw/mingw64/mingw-w64-x86_64-gst-plugins-bad-1.26.5-1-any.pkg.tar.zst \
https://repo.msys2.org/mingw/mingw64/mingw-w64-x86_64-gst-plugins-ugly-1.26.5-1-any.pkg.tar.zst \
https://repo.msys2.org/mingw/mingw64/mingw-w64-x86_64-gst-libav-1.26.5-1-any.pkg.tar.zst
- uses: actions/setup-dotnet@v5
with:
dotnet-version: "8.0.x"
- name: Install WiX Toolset and Extensions
shell: pwsh
run: |
dotnet tool install --global wix --version 4.0.5
wix extension add --global WixToolset.UI.wixext/4.0.5
- name: Set PKG_CONFIG environment variable
run: echo "PKG_CONFIG_EXECUTABLE=C:/msys64/mingw64/bin/pkg-config.exe" >> $GITHUB_ENV
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: ${{ env.QT_VERSION }}
modules: "qtmultimedia qtlocation qtpositioning qtserialport"
arch: win64_mingw
- name: Install WinFsp
shell: pwsh
run: |
choco install winfsp -y
- name: Download and Extract Bonjour SDK
run: |
wget "https://github.com/tempx-x/bonjour-sdk/raw/refs/heads/main/bonjoursdksetup.exe" -O bonjour-sdk.exe
EXPECTED_HASH="4ff2aae8205aec31b06743782cfcadce"
ACTUAL_HASH=$(md5sum bonjour-sdk.exe | awk '{print $1}')
echo "Expected MD5: $EXPECTED_HASH"
echo "Actual MD5: $ACTUAL_HASH"
if [ "$ACTUAL_HASH" != "$EXPECTED_HASH" ]; then
echo "::error::Checksum mismatch!"
exit 1
fi
echo "Checksum verified. Extracting installer..."
7z x bonjour-sdk.exe -oBonjourInstaller
- name: Install Bonjour Runtime
shell: powershell
run: |
$currentPath = Get-Location
$msiFilePath = Join-Path -Path $currentPath -ChildPath "BonjourInstaller\Bonjour64.msi"
$msiexecArguments = "/i `"$msiFilePath`" /qn"
Write-Host "Installing Bonjour Runtime..."
Start-Process msiexec -ArgumentList $msiexecArguments -NoNewWindow -Wait
- name: Install Bonjour SDK
shell: powershell
run: |
$currentPath = Get-Location
$msiFilePath = Join-Path -Path $currentPath -ChildPath "BonjourInstaller\BonjourSDK64.msi"
$msiexecArguments = "/i `"$msiFilePath`" /qn"
Write-Host "Installing Bonjour SDK..."
Start-Process msiexec -ArgumentList $msiexecArguments -NoNewWindow -Wait
"BONJOUR_SDK_HOME=C:/Program Files/Bonjour SDK" | Out-File -FilePath $env:GITHUB_ENV -Append
- name: Compile additional dependencies
run: |
git clone https://github.com/lxqt/lxqt-build-tools.git
pushd lxqt-build-tools
mkdir build && cd build
cmake .. -DCMAKE_PREFIX_PATH="$Qt6_DIR"
cmake --install . --prefix "C:\lxqt"
popd
git clone https://github.com/uncor3/qtermwidget.git
pushd qtermwidget
mkdir build && cd build
cmake .. -DCMAKE_PREFIX_PATH="$Qt6_DIR;C:\lxqt" -DCMAKE_INSTALL_PREFIX="C:\lxqt"
cmake --build . --parallel
cmake --install .
popd
- name: Build libimobiledevice suite (versioned tarballs)
run: |
set -euo pipefail
workspace="$PWD"
tmp="$PWD/_tmp_libs"
mkdir -p "$tmp"
cd "$tmp"
base_url="https://github.com/libimobiledevice"
libs=( "libplist" "libtatsu" "libimobiledevice-glue" "libusbmuxd" "libimobiledevice" "libirecovery" )
for name in "${libs[@]}"; do
ver_var=$(echo "${name^^}_VER" | sed 's/-/_/g')
ver="${!ver_var:-}"
if [ -z "$ver" ]; then
echo "Version for $name not set (env var $ver_var)"
exit 1
fi
archive="${name}-${ver}.tar.bz2"
url="${base_url}/${name}/releases/download/${ver}/${archive}"
echo "=== Processing $name $ver ==="
echo "URL: $url"
curl -L -o "$archive" "$url"
echo "Extracting $archive"
tar xjf "$archive"
srcdir="${name}-${ver}"
pushd "$srcdir"
./configure --without-cython
make -j"$(nproc)"
make install
popd
echo "Installed $name $ver"
done
# cleanup
cd "$workspace"
rm -rf "$tmp"
- name: Configure CMake
run: |
cmake -B build -S . -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$Qt6_DIR" -DDEPLOY=OFF
- name: Build with CMake
run: cmake --build build --config Release
- name: Install & CPack
id: cpack_step # Add an ID to this step
working-directory: build
shell: pwsh
run: |
cmake --install .
cpack .
# Find the generated files and set them as outputs
$msiFile = Get-ChildItem -Path "artifacts/*.msi" | Select-Object -First 1
$zipFile = Get-ChildItem -Path "artifacts/*.zip" | Select-Object -First 1
echo "msi_name=$($msiFile.Name)" >> $env:GITHUB_OUTPUT
echo "msi_path=$($msiFile.FullName)" >> $env:GITHUB_OUTPUT
echo "zip_name=$($zipFile.Name)" >> $env:GITHUB_OUTPUT
echo "zip_path=$($zipFile.FullName)" >> $env:GITHUB_OUTPUT
- name: Upload Installer Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ steps.cpack_step.outputs.msi_name }}
path: ${{ steps.cpack_step.outputs.msi_path }}
- name: Upload Portable ZIP Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ steps.cpack_step.outputs.zip_name }}
path: ${{ steps.cpack_step.outputs.zip_path }}