From a6108b79302af5983f29275f3a85122c35aa11d5 Mon Sep 17 00:00:00 2001 From: ksagameng Date: Sun, 2 Nov 2025 21:47:14 +0300 Subject: [PATCH] ci: Add iOS builds --- .github/workflows/c-cpp.yml | 3 +++ scripts/gha/build_ios.sh | 20 ++++++++++++++++++++ scripts/gha/deps_ios.sh | 13 +++++++++++++ 3 files changed, 36 insertions(+) create mode 100755 scripts/gha/build_ios.sh create mode 100644 scripts/gha/deps_ios.sh diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 1bd4a399..56e11cc1 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -66,6 +66,9 @@ jobs: - os: macos-14 # arm64 as per github documentation targetos: apple targetarch: arm64 + - os: macos-latest + targetos: ios + targetarch: arm64 - os: macos-13 # x86 as per github documentation (will they fix it before they deprecate this version?..) targetos: apple targetarch: amd64 diff --git a/scripts/gha/build_ios.sh b/scripts/gha/build_ios.sh new file mode 100755 index 00000000..7a51fc00 --- /dev/null +++ b/scripts/gha/build_ios.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +. scripts/lib.sh + +cd $GITHUB_WORKSPACE || die + +./waf configure --enable-utils --enable-lto --ios build install --destdir=build/ios || die_configure + +cp -vr /Library/Frameworks/SDL2.framework ./build + +pushd hlsdk || die +cmake -DCMAKE_SYSTEM_NAME=iOS -DGAMEDIR=$(realpath ../build/ios) -DCMAKE_BUILD_TYPE=Debug -B build -S . +cmake --build build --target install || die +popd + +./scripts/ios/createipa.sh + +mkdir -p artifacts/ +mv "build/xash3d.ipa" "build/xash3d-fwgs-ios-arm64.ipa" +cp "build/xash3d-fwgs-ios-arm64.ipa" artifacts diff --git a/scripts/gha/deps_ios.sh b/scripts/gha/deps_ios.sh new file mode 100644 index 00000000..9d94c71a --- /dev/null +++ b/scripts/gha/deps_ios.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +cd $GITHUB_WORKSPACE + +git clone https://github.com/libsdl-org/SDL -b SDL2 + +cd SDL/Xcode/SDL +xcodebuild -scheme xcFramework-iOS -target xcFramework-iOS build -configuration Release +sudo cp -vr Products/SDL2.xcframework/ios-arm64/SDL2.framework /Library/Frameworks + +cd $GITHUB_WORKSPACE + +git clone https://github.com/FWGS/hlsdk-portable hlsdk --depth=1