mirror of
https://github.com/iDescriptor/iDescriptor.git
synced 2026-06-21 19:35:49 +08:00
234 lines
7.5 KiB
YAML
234 lines
7.5 KiB
YAML
name: Build iDescriptor
|
|
|
|
on:
|
|
push:
|
|
branches: ['main']
|
|
pull_request:
|
|
branches: ['main']
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build:
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-22.04, windows-2022]
|
|
# os: [ubuntu-latest, macos-latest, windows-latest]
|
|
runs-on: ${{ matrix.os }}
|
|
defaults:
|
|
run:
|
|
shell: ${{ matrix.os == 'windows-2022' && 'msys2 {0}' || 'bash' }}
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
submodules: 'recursive'
|
|
token: ${{ secrets.PAT }}
|
|
|
|
- name: Setup MSYS2 (Windows)
|
|
if: runner.os == 'Windows'
|
|
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-qt6-base
|
|
mingw-w64-x86_64-qt6-svg
|
|
mingw-w64-x86_64-qt6-multimedia
|
|
mingw-w64-x86_64-qt6-location
|
|
mingw-w64-x86_64-qt6-positioning
|
|
mingw-w64-x86_64-qt6-serialport
|
|
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
|
|
p7zip
|
|
|
|
- name: Download and Install Bonjour SDK (Windows)
|
|
if: runner.os == 'Windows'
|
|
run: |
|
|
# Download the SDK installer
|
|
wget "https://gsf-fl.softonic.com/b18/d44/cbdcd43ad683cf6760d45ce891c3035044/bonjoursdksetup.exe?Expires=1757906571&Signature=af8dfce8a002130f34c0e93e17b8dd96d547ff69&url=https://bonjour.en.softonic.com/&Filename=bonjoursdksetup.exe" -O bonjour-sdk.exe
|
|
|
|
# Compare checksum to verify download
|
|
# This hash was obtained from Apple's official Bonjour SDK download page
|
|
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..."
|
|
# Extract the .exe to get the .msi files
|
|
7z x bonjour-sdk.exe -oBonjourInstaller
|
|
|
|
# Install the Bonjour Runtime first, silently (/qn)
|
|
echo "Installing Bonjour Runtime..."
|
|
msiexec /i "$(pwd)/BonjourInstaller/Bonjour64.msi" /qn
|
|
|
|
# Install the Bonjour SDK, silently (/qn)
|
|
echo "Installing Bonjour SDK..."
|
|
msiexec /i "$(pwd)/BonjourInstaller/BonjourSDK64.msi" /qn
|
|
|
|
# Set the environment variable for CMake to find the SDK
|
|
echo "BONJOUR_SDK_HOME=C:/Program Files/Bonjour SDK" >> $GITHUB_ENV
|
|
|
|
- name: Install Qt (Linux)
|
|
if: runner.os == 'Linux'
|
|
uses: jurplel/install-qt-action@v3
|
|
with:
|
|
version: '6.7.2'
|
|
modules: 'qtmultimedia qtlocation qtpositioning qtserialport'
|
|
|
|
- name: Set up Go (Linux)
|
|
if: runner.os == 'Linux' || runner.os == 'Windows'
|
|
uses: actions/setup-go@v6
|
|
with:
|
|
go-version: '^1.23.0'
|
|
|
|
- name: Install Linux dependencies (apt)
|
|
if: runner.os == 'Linux'
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y \
|
|
build-essential \
|
|
autoconf \
|
|
automake \
|
|
checkinstall \
|
|
git \
|
|
pkg-config \
|
|
libpugixml-dev \
|
|
libusb-1.0-0-dev \
|
|
libqrencode-dev \
|
|
libirecovery-1.0-dev \
|
|
libcurl4-openssl-dev \
|
|
libusbmuxd-dev \
|
|
libssl-dev \
|
|
libtool-bin \
|
|
libreadline-dev \
|
|
libavahi-compat-libdnssd-dev \
|
|
libavcodec-dev \
|
|
libavutil-dev \
|
|
libswscale-dev \
|
|
libgstreamer1.0-dev \
|
|
libgstreamer-plugins-base1.0-dev \
|
|
libfuse2 \
|
|
libunwind-dev \
|
|
libxcb-cursor0 \
|
|
libxkbcommon-x11-0 \
|
|
|
|
- name: Build libimobiledevice suite (Linux)
|
|
if: runner.os == 'Linux'
|
|
run: |
|
|
# List of repositories to build in order (dependencies first)
|
|
repos=("libplist" "libtatsu" "libimobiledevice-glue" "libimobiledevice" "libirecovery")
|
|
|
|
for repo in "${repos[@]}"; do
|
|
echo "Building $repo..."
|
|
|
|
git clone --depth=1 --recursive "https://github.com/libimobiledevice/$repo"
|
|
pushd "$repo"
|
|
./autogen.sh
|
|
sudo make install
|
|
popd
|
|
|
|
echo "Built $repo successfully."
|
|
done
|
|
|
|
- name: Build libimobiledevice suite (Windows)
|
|
if: runner.os == 'Windows'
|
|
run: |
|
|
echo "target_triplet=`gcc -dumpmachine`" >> $GITHUB_ENV
|
|
git config --global core.autocrlf false
|
|
|
|
# List of repositories to build in order (dependencies first)
|
|
repos=("libplist" "libimobiledevice-glue" "libusbmuxd" "libtatsu" "libimobiledevice" "libirecovery")
|
|
|
|
for repo in "${repos[@]}"; do
|
|
echo "Building $repo..."
|
|
|
|
git clone --depth=1 --recursive "https://github.com/libimobiledevice/$repo"
|
|
pushd "$repo"
|
|
./autogen.sh CC=gcc CXX=g++ --enable-debug --without-cython
|
|
make -j install
|
|
popd
|
|
echo "Built $repo successfully."
|
|
done
|
|
|
|
- name: Update linker cache
|
|
if: runner.os == 'Linux'
|
|
run: sudo ldconfig
|
|
|
|
- name: Configure CMake (Linux)
|
|
if: runner.os == 'Linux'
|
|
run: |
|
|
cmake -B build -S . -DCMAKE_BUILD_TYPE=Release -DRUN_CLANG_TIDY=OFF
|
|
|
|
- name: Configure CMake (Windows)
|
|
if: runner.os == 'Windows'
|
|
run: |
|
|
cmake -B build -S . -DCMAKE_BUILD_TYPE=Release
|
|
|
|
- name: Build with CMake
|
|
run: cmake --build build --config Release
|
|
|
|
- name: Prepare for AppImage
|
|
if: runner.os == 'Linux'
|
|
run: |
|
|
cp icons/icon.png build/iDescriptor.png
|
|
|
|
# Create a .desktop file required for the AppImage
|
|
cat <<EOF > build/iDescriptor.desktop
|
|
[Desktop Entry]
|
|
Name=iDescriptor
|
|
Exec=iDescriptor
|
|
Icon=iDescriptor
|
|
Type=Application
|
|
Categories=Utility;
|
|
EOF
|
|
|
|
- name: Install linuxdeployqt
|
|
if: runner.os == 'Linux'
|
|
run: |
|
|
wget -c -nv "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage"
|
|
chmod a+x linuxdeployqt-continuous-x86_64.AppImage
|
|
|
|
- name: Build AppImage
|
|
if: runner.os == 'Linux'
|
|
working-directory: ./build
|
|
run: |
|
|
export VERSION=1.0.0
|
|
# Include the Go library as an additional executable/library
|
|
../linuxdeployqt-continuous-x86_64.AppImage iDescriptor -appimage
|
|
|
|
- name: Upload Artifact (Linux)
|
|
if: runner.os == 'Linux'
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: iDescriptor-AppImage
|
|
path: build/iDescriptor-*.AppImage
|
|
|
|
- name: Upload Artifact (Windows)
|
|
if: runner.os == 'Windows'
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: iDescriptor-Windows
|
|
path: build/Release/iDescriptor.exe
|