Skip to content

Commit ffbcff6

Browse files
committed
github: configure build for iOS-Remote
1 parent 3acbf2e commit ffbcff6

File tree

3 files changed

+52
-65
lines changed

3 files changed

+52
-65
lines changed

.github/workflows/build.yml

+26-22
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
strategy:
5454
matrix:
5555
arch: [arm64]
56-
platform: [ios, ios_simulator, ios-tci, macos, visionos, visionos_simulator, visionos-tci]
56+
platform: [ios, ios_simulator, ios-tci, ios_simulator-tci, macos, visionos, visionos_simulator, visionos-tci, visionos_simulator-tci]
5757
include:
5858
# x86_64 supported only for macOS and simulators
5959
- arch: x86_64
@@ -91,7 +91,7 @@ jobs:
9191
if: steps.cache-sysroot.outputs.cache-hit != 'true' || github.event.inputs.rebuild_sysroot == 'true'
9292
run: ./scripts/build_dependencies.sh -p ${{ matrix.platform }} -a ${{ matrix.arch }}
9393
env:
94-
NCPU: ${{ matrix.platform == 'ios-tci' && '2' || '0' }} # limit 2 CPU for TCI build due to memory issues, 0 = unlimited for other builds
94+
NCPU: ${{ endsWith(matrix.platform, '-tci') && '4' || '0' }} # limit 4 CPU for TCI build due to memory issues, 0 = unlimited for other builds
9595
- name: Compress Sysroot
9696
if: steps.cache-sysroot.outputs.cache-hit != 'true' || github.event_name == 'release' || github.event.inputs.test_release == 'true'
9797
run: tar -acf sysroot.tgz sysroot*
@@ -152,14 +152,16 @@ jobs:
152152
needs: [configuration, build-sysroot]
153153
strategy:
154154
matrix:
155-
arch: [arm64]
156-
platform: [ios, ios_simulator, ios-tci, macos, visionos, visionos_simulator, visionos-tci]
157-
include:
158-
# x86_64 supported only for macOS and simulators
159-
- arch: x86_64
160-
platform: macos
161-
- arch: x86_64
162-
platform: ios_simulator
155+
configuration: [
156+
{arch: "arm64", sdk: "iphoneos", platform: "ios", scheme: "iOS"},
157+
{arch: "arm64", sdk: "iphoneos", platform: "ios-tci", scheme: "iOS-SE"},
158+
{arch: "arm64", sdk: "iphoneos", platform: "ios-tci", scheme: "iOS-Remote"},
159+
{arch: "arm64", sdk: "xros", platform: "visionos", scheme: "iOS"},
160+
{arch: "arm64", sdk: "xros", platform: "visionos-tci", scheme: "iOS-SE"},
161+
{arch: "arm64", sdk: "xros", platform: "visionos-tci", scheme: "iOS-Remote"},
162+
{arch: "arm64", sdk: "macosx", platform: "macos", scheme: "macOS"},
163+
{arch: "x86_64", sdk: "macosx", platform: "macos", scheme: "macOS"},
164+
]
163165
steps:
164166
- name: Checkout
165167
uses: actions/checkout@v3
@@ -169,8 +171,8 @@ jobs:
169171
id: cache-sysroot
170172
uses: osy/actions-cache@v3
171173
with:
172-
path: sysroot-${{ matrix.platform }}-${{ matrix.arch }}
173-
key: ${{ matrix.platform }}-${{ matrix.arch }}-${{ hashFiles('scripts/build_dependencies.sh') }}-${{ hashFiles('patches/**') }}
174+
path: sysroot-${{ matrix.configuration.platform }}-${{ matrix.configuration.arch }}
175+
key: ${{ matrix.configuration.platform }}-${{ matrix.configuration.arch }}-${{ hashFiles('scripts/build_dependencies.sh') }}-${{ hashFiles('patches/**') }}
174176
- name: Check Cache
175177
if: steps.cache-sysroot.outputs.cache-hit != 'true'
176178
uses: actions/github-script@v6
@@ -182,12 +184,12 @@ jobs:
182184
[[ "$(xcode-select -p)" == "${{ env.BUILD_XCODE_PATH }}"* ]] || sudo xcode-select -s "${{ env.BUILD_XCODE_PATH }}"
183185
- name: Build UTM
184186
run: |
185-
./scripts/build_utm.sh -p ${{ matrix.platform }} -a ${{ matrix.arch }} -o UTM
187+
./scripts/build_utm.sh -k ${{ matrix.configuration.sdk }} -s ${{ matrix.configuration.scheme }} -a ${{ matrix.configuration.arch }} -o UTM
186188
tar -acf UTM.xcarchive.tgz UTM.xcarchive
187189
- name: Upload UTM
188190
uses: actions/upload-artifact@v3
189191
with:
190-
name: UTM-${{ matrix.platform }}-${{ matrix.arch }}
192+
name: UTM-${{ matrix.configuration.scheme }}-${{ matrix.configuration.platform }}-${{ matrix.configuration.arch }}
191193
path: UTM.xcarchive.tgz
192194
build-universal:
193195
name: Build UTM (Universal Mac)
@@ -215,7 +217,7 @@ jobs:
215217
[[ "$(xcode-select -p)" == "${{ env.BUILD_XCODE_PATH }}"* ]] || sudo xcode-select -s "${{ env.BUILD_XCODE_PATH }}"
216218
- name: Build UTM
217219
run: |
218-
./scripts/build_utm.sh -t "$SIGNING_TEAM_ID" -p macos -a "arm64 x86_64" -o UTM
220+
./scripts/build_utm.sh -t "$SIGNING_TEAM_ID" -k macosx -s macOS -a "arm64 x86_64" -o UTM
219221
tar -acf UTM.xcarchive.tgz UTM.xcarchive
220222
env:
221223
SIGNING_TEAM_ID: ${{ vars.SIGNING_TEAM_ID }}
@@ -231,12 +233,14 @@ jobs:
231233
strategy:
232234
matrix:
233235
configuration: [
234-
{platform: "ios", mode: "ipa", name: "UTM.ipa", path: "UTM.ipa"},
235-
{platform: "ios-tci", mode: "ipa-se", name: "UTM-SE.ipa", path: "UTM SE.ipa"},
236-
{platform: "ios", mode: "ipa-hv", name: "UTM-HV.ipa", path: "UTM.ipa"},
237-
{platform: "ios", mode: "deb", name: "UTM.deb", path: "UTM.deb"},
238-
{platform: "visionos", mode: "ipa", name: "UTM-visionOS.ipa", path: "UTM.ipa"},
239-
{platform: "visionos-tci", mode: "ipa-se", name: "UTM-SE-visionOS.ipa", path: "UTM SE.ipa"}
236+
{platform: "ios", scheme: "iOS", mode: "ipa", name: "UTM.ipa", path: "UTM.ipa"},
237+
{platform: "ios-tci", scheme: "iOS-SE", mode: "ipa-se", name: "UTM-SE.ipa", path: "UTM SE.ipa"},
238+
{platform: "ios", scheme: "iOS", mode: "ipa-hv", name: "UTM-HV.ipa", path: "UTM.ipa"},
239+
{platform: "ios", scheme: "iOS", mode: "deb", name: "UTM.deb", path: "UTM.deb"},
240+
{platform: "visionos", scheme: "iOS", mode: "ipa", name: "UTM-visionOS.ipa", path: "UTM.ipa"},
241+
{platform: "visionos-tci", scheme: "iOS-SE", mode: "ipa-se", name: "UTM-SE-visionOS.ipa", path: "UTM SE.ipa"},
242+
{platform: "ios-tci", scheme: "iOS-Remote", mode: "ipa-remote", name: "UTM-Remote.ipa", path: "UTM Remote.ipa"},
243+
{platform: "visionos-tci", scheme: "iOS-Remote", mode: "ipa-remote", name: "UTM-Remote-visionOS.ipa", path: "UTM Remote.ipa"},
240244
]
241245
if: github.event_name == 'release' || github.event.inputs.test_release == 'true'
242246
steps:
@@ -245,7 +249,7 @@ jobs:
245249
- name: Download Artifact
246250
uses: actions/download-artifact@v3
247251
with:
248-
name: UTM-${{ matrix.configuration.platform }}-arm64
252+
name: UTM-${{ matrix.configuration.scheme }}-${{ matrix.configuration.platform }}-arm64
249253
- name: Install ldid + dpkg
250254
run: brew install ldid dpkg
251255
- name: Fakesign IPA

scripts/build_utm.sh

+18-41
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@ command -v realpath >/dev/null 2>&1 || realpath() {
77
BASEDIR="$(dirname "$(realpath $0)")"
88

99
usage () {
10-
echo "Usage: $(basename $0) [-t teamid] [-p platform] [-a architecture] [-t targetversion] [-o output]"
10+
echo "Usage: $(basename $0) [-t teamid] [-p platform] [-s scheme] [-a architecture] [-t targetversion] [-o output]"
1111
echo ""
1212
echo " -t teamid Team Identifier for app groups. Optional for iOS. Required for macOS."
13-
echo " -p platform Target platform. Default ios. [ios|ios_simulator|ios-tci|ios_simulator-tci|macos|visionos|visionos_simulator]"
14-
echo " -a architecture Target architecture. Default arm64. [armv7|armv7s|arm64|i386|x86_64]"
13+
echo " -k sdk Target SDK. Default iphoneos. [iphoneos|iphonesimulator|xros|xrsimulator|macosx]"
14+
echo " -s scheme Target scheme. Default iOS/macOS depending on platform. [iOS|iOS-TCI|iOS-Remote|macOS]"
15+
echo " -a architecture Target architecture. Default arm64. [arm64|x86_64]"
1516
echo " -o output Output archive path. Default is current directory."
1617
echo ""
1718
exit 1
@@ -20,9 +21,8 @@ usage () {
2021
PRODUCT_BUNDLE_PREFIX="com.utmapp"
2122
TEAM_IDENTIFIER=
2223
ARCH=arm64
23-
PLATFORM=ios
2424
OUTPUT=$PWD
25-
SDK=
25+
SDK=iphoneos
2626
SCHEME=
2727

2828
while [ "x$1" != "x" ]; do
@@ -35,8 +35,12 @@ while [ "x$1" != "x" ]; do
3535
ARCH=$2
3636
shift
3737
;;
38-
-p )
39-
PLATFORM=$2
38+
-k )
39+
SDK=$2
40+
shift
41+
;;
42+
-s )
43+
SCHEME=$2
4044
shift
4145
;;
4246
-o )
@@ -50,39 +54,14 @@ while [ "x$1" != "x" ]; do
5054
shift
5155
done
5256

53-
case $PLATFORM in
54-
*-tci )
55-
SCHEME="iOS-TCI"
56-
;;
57-
ios* | visionos* )
58-
SCHEME="iOS"
59-
;;
57+
case $SDK in
6058
macos )
6159
SCHEME="macOS"
6260
;;
6361
* )
64-
usage
65-
;;
66-
esac
67-
68-
case $PLATFORM in
69-
visionos_simulator* )
70-
SDK=xrsimulator
71-
;;
72-
visionos* )
73-
SDK=xros
74-
;;
75-
ios_simulator* )
76-
SDK=iphonesimulator
77-
;;
78-
ios* )
79-
SDK=iphoneos
80-
;;
81-
macos )
82-
SDK=macosx
83-
;;
84-
* )
85-
usage
62+
if [ -z "$SCHEME" ]; then
63+
SCHEME="iOS"
64+
fi
8665
;;
8766
esac
8867

@@ -94,8 +73,7 @@ fi
9473
xcodebuild archive -archivePath "$OUTPUT" -scheme "$SCHEME" -sdk "$SDK" $ARCH_ARGS -configuration Release CODE_SIGNING_ALLOWED=NO $TEAM_IDENTIFIER_PREFIX
9574
BUILT_PATH=$(find $OUTPUT.xcarchive -name '*.app' -type d | head -1)
9675
# Only retain the target architecture to address < iOS 15 crash & save disk space
97-
case $PLATFORM in
98-
ios | ios-tci )
76+
if [ "$SDK" == "iphoneos" ]; then
9977
find "$BUILT_PATH" -type f -path '*/Frameworks/*.dylib' | while read FILE; do
10078
if [[ $(lipo -info "$FILE") =~ "Architectures in the fat file" ]]; then
10179
lipo -thin $ARCH "$FILE" -output "$FILE"
@@ -107,10 +85,9 @@ ios | ios-tci )
10785
lipo -thin $ARCH "$FILE" -output "$FILE"
10886
fi
10987
done
110-
;;
111-
esac
88+
fi
11289
find "$BUILT_PATH" -type d -path '*/Frameworks/*.framework' -exec codesign --force --sign - --timestamp=none \{\} \;
113-
if [ "$PLATFORM" == "macos" ]; then
90+
if [ "$SDK" == "macosx" ]; then
11491
# always build with vm entitlements, package_mac.sh can strip it later
11592
# this way we can import into Xcode and re-sign from there
11693
UTM_ENTITLEMENTS="/tmp/utm.$$.entitlements"

scripts/package.sh

+8-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ usage() {
1212
echo " MODE is one of:"
1313
echo " deb (Cydia DEB)"
1414
echo " ipa (unsigned IPA of full build with all entitlements)"
15-
echo " ipa-se (unsigned IPA of TCI build)"
15+
echo " ipa-se (unsigned IPA of SE build)"
16+
echo " ipa-remote (unsigned IPA of Remote build)"
1617
echo " ipa-hv (unsigned IPA of full build without JIT entitlement)"
1718
echo " ipa-signed (developer signed IPA with valid PROFILE_NAME and TEAM_ID)"
1819
echo " inputXcarchive is path to UTM.xcarchive"
@@ -42,6 +43,11 @@ ipa-se )
4243
BUNDLE_ID="com.utmapp.UTM-SE"
4344
INPUT_APP="$INPUT/Products/Applications/UTM SE.app"
4445
;;
46+
ipa-remote )
47+
NAME="UTM Remote"
48+
BUNDLE_ID="com.utmapp.UTM-Remote"
49+
INPUT_APP="$INPUT/Products/Applications/UTM Remote.app"
50+
;;
4551
* )
4652
usage
4753
;;
@@ -298,7 +304,7 @@ EOL
298304
create_fake_ipa "$NAME" "$BUNDLE_ID" "$INPUT" "$OUTPUT" "$FAKEENT"
299305
rm "$FAKEENT"
300306
;;
301-
ipa-se )
307+
ipa-se | ipa-remote )
302308
FAKEENT="/tmp/fakeent.$$.plist"
303309
cat >"$FAKEENT" <<EOL
304310
<?xml version="1.0" encoding="UTF-8"?>

0 commit comments

Comments
 (0)