Files
iDescriptor/.github/workflows/build.yml
T
2025-09-14 02:50:28 +00:00

198 lines
5.9 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: >-
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
- 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