Skip to content

Commit 73441dc

Browse files
committed
Build iOS app with development profile for debugging.
1 parent 5bfe5e3 commit 73441dc

2 files changed

Lines changed: 35 additions & 1 deletion

File tree

.github/workflows/build-apps.yaml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,10 @@ jobs:
120120
runs-on: macos-15
121121
env:
122122
BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
123+
BUILD_DEV_CERTIFICATE_BASE64: ${{ secrets.BUILD_DEV_CERTIFICATE_BASE64 }}
123124
BUILD_CERTIFICATE_PASSWORD: ${{ secrets.BUILD_CERTIFICATE_PASSWORD }}
124125
BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.BUILD_PROVISION_PROFILE_BASE64 }}
126+
BUILD_DEV_PROVISION_PROFILE_BASE64: ${{ secrets.BUILD_DEV_PROVISION_PROFILE_BASE64 }}
125127
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
126128
steps:
127129
- name: Check out repository
@@ -158,12 +160,16 @@ jobs:
158160
run: |
159161
# create variables
160162
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.cer
163+
DEV_CERTIFICATE_PATH=$RUNNER_TEMP/dev_certificate.cer
161164
PP_PATH=$RUNNER_TEMP/build_pp.mobileprovision
165+
PP_DEV_PATH=$RUNNER_TEMP/dev_pp.mobileprovision
162166
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
163167
164168
# import certificate and provisioning profile from secrets
165169
echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode -o $CERTIFICATE_PATH
170+
echo -n "$BUILD_DEV_CERTIFICATE_BASE64" | base64 --decode -o $DEV_CERTIFICATE_PATH
166171
echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode -o $PP_PATH
172+
echo -n "$BUILD_DEV_PROVISION_PROFILE_BASE64" | base64 --decode -o $PP_DEV_PATH
167173
168174
# create temporary keychain
169175
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
@@ -172,14 +178,28 @@ jobs:
172178
173179
# import certificate to keychain
174180
security import $CERTIFICATE_PATH -P "$BUILD_CERTIFICATE_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
181+
security import $DEV_CERTIFICATE_PATH -P "$BUILD_CERTIFICATE_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
175182
security set-key-partition-list -S apple-tool:,apple: -k "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
176183
security list-keychain -d user -s $KEYCHAIN_PATH
177184
178185
# apply provisioning profile
179186
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
180187
cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles
188+
cp $PP_DEV_PATH ~/Library/MobileDevice/Provisioning\ Profiles
181189
182-
- name: Build iOS app
190+
- name: Build iOS app for debugging
191+
if: ${{ env.KEYCHAIN_PASSWORD != '' }}
192+
run: |
193+
xcodebuild -workspace './ios/App/App.xcworkspace' \
194+
-scheme Tessel -destination generic/platform=iOS \
195+
-archivePath Tessel.xcarchive archive \
196+
-configuration Debug
197+
xcodebuild archive -archivePath Tessel.xcarchive \
198+
-exportArchive -exportOptionsPlist ./ios/debug.plist \
199+
-exportPath output-dev -allowProvisioningUpdates
200+
mv output-dev/Tessel.ipa output-dev/tessel-${{ github.ref_name }}.ipa
201+
202+
- name: Build iOS app for release
183203
if: ${{ env.KEYCHAIN_PASSWORD != '' }}
184204
run: |
185205
xcodebuild -workspace './ios/App/App.xcworkspace' \
@@ -215,6 +235,7 @@ jobs:
215235
name: iOS package
216236
path: |
217237
output/Tessel*.ipa
238+
output-dev/tessel*.ipa
218239
219240
make-release:
220241
name: Make release

ios/debug.plist

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>method</key>
6+
<string>development</string>
7+
<key>provisioningProfiles</key>
8+
<dict>
9+
<key>net.vantulder.tessel</key>
10+
<string>Tessel Development</string>
11+
</dict>
12+
</dict>
13+
</plist>

0 commit comments

Comments
 (0)