-
Notifications
You must be signed in to change notification settings - Fork 0
162 lines (141 loc) · 5.63 KB
/
simulator-build.yml
File metadata and controls
162 lines (141 loc) · 5.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
name: ProSign iOS Simulator Build
on:
workflow_dispatch:
permissions:
contents: write
jobs:
build:
runs-on: macos-15
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: true
- name: Show Xcode Version
run: |
echo "=== xcodebuild -version ==="
xcodebuild -version || true
echo "=== sw_vers ==="
sw_vers || true
- name: Install Build Tools
run: |
# jq
if ! command -v jq >/dev/null 2>&1; then
echo "jq not found — attempting to install via brew"
if command -v brew >/dev/null 2>&1; then
brew install jq || true
fi
fi
# yq
if ! command -v yq >/dev/null 2>&1; then
echo "yq not found — attempting to install via brew"
if command -v brew >/dev/null 2>&1; then
brew install yq || true
fi
fi
# gh (GitHub CLI)
if ! command -v gh >/dev/null 2>&1; then
echo "gh not found — attempting to install via brew"
if command -v brew >/dev/null 2>&1; then
brew install gh || true
fi
fi
# xcodegen
if ! command -v xcodegen >/dev/null 2>&1; then
echo "xcodegen not found — attempting to install via brew"
if command -v brew >/dev/null 2>&1; then
brew install xcodegen || true
fi
fi
# Fallback: official gh installer script (works across platforms)
if ! command -v gh >/dev/null 2>&1; then
echo "gh still not found — attempting official installer script"
curl -fsSL https://cli.github.com/install.sh | sh || true
fi
echo "Tool versions (if installed):"
echo "jq: $(jq --version 2>/dev/null || echo 'not installed')"
echo "yq: $(yq --version 2>/dev/null || echo 'not installed')"
echo "gh: $(gh --version 2>/dev/null || echo 'not installed')"
echo "xcodegen: $(xcodegen --version 2>/dev/null || echo 'not installed')"
shell: bash
- name: Check Project Files
run: |
echo "Workspace files:"
ls -la || true
echo "project.yml (first 200 lines):"
sed -n '1,200p' project.yml || true
- name: Generate Xcode Project
run: |
set -e
xcodegen generate --spec project.yml
echo "Generated project at: $(pwd)/prosign.xcodeproj"
echo "project.pbxproj header (first 60 lines):"
sed -n '1,60p' prosign.xcodeproj/project.pbxproj || true
- name: Resolve Swift Packages
run: |
set -e
echo "Resolving Swift package dependencies for ProSign..."
xcodebuild -resolvePackageDependencies -project prosign.xcodeproj -scheme prosign -configuration Release
- name: Build simulator (iphonesimulator) and package simulator .ipa (if possible)
id: build_sim
run: |
set -e
echo "Starting simulator build (won't fail the entire job if it fails)."
SIM_DERIVED="$PWD/build/sim_derived"
rm -rf "$SIM_DERIVED"
set +e
xcodebuild clean build \
-project prosign.xcodeproj \
-scheme prosign \
-configuration Release \
-sdk iphonesimulator \
-derivedDataPath "$SIM_DERIVED" \
CODE_SIGNING_ALLOWED=NO CODE_SIGN_IDENTITY=""
rc=$?
set -e
if [ $rc -ne 0 ]; then
echo "Warning: simulator build failed (exit $rc). Will attempt to recover packaging if a simulator .app exists."
fi
POSSIBLE_APPS=(
"$SIM_DERIVED/Build/Products/Release-iphonesimulator/prosign.app"
"$SIM_DERIVED/Build/Products/Debug-iphonesimulator/prosign.app"
"$PWD/build/Build/Products/Release-iphonesimulator/prosign.app"
"$PWD/build/Release-iphonesimulator/prosign.app"
)
FOUND_APP=""
for p in "${POSSIBLE_APPS[@]}"; do
if [ -d "$p" ]; then
FOUND_APP="$p"
break
fi
done
if [ -z "$FOUND_APP" ]; then
echo "Simulator .app not found in expected locations. Listing $SIM_DERIVED contents for debug:"
ls -la "$SIM_DERIVED" || true
echo "Skipping simulator .ipa packaging."
exit 0
fi
echo "Found simulator .app at: $FOUND_APP"
SIM_IPA="build/com.prostoreios.prosign-unsigned-iossimulator.ipa"
mkdir -p build/Payload-sim
rm -rf build/Payload-sim/* || true
cp -R "$FOUND_APP" build/Payload-sim/
(cd build && zip -r "$(basename "$SIM_IPA")" Payload-sim) || exit 1
echo "Created simulator ipa: $SIM_IPA"
ls -la "$SIM_IPA" || true
- name: Set simulator artifact path output
id: set_sim_art
run: |
IPA="build/com.prostoreios.prosign-unsigned-iossimulator.ipa"
if [ -f "$IPA" ]; then
echo "ipa_path=$IPA" >> $GITHUB_OUTPUT
else
echo "ipa_path=" >> $GITHUB_OUTPUT
fi
- name: Upload Simulator IPA artifact
if: steps.set_sim_art.outputs.ipa_path != ''
uses: actions/upload-artifact@v4
with:
name: com.prostoreios.prosign-unsigned-iossimulator.ipa
path: ${{ steps.set_sim_art.outputs.ipa_path }}