-
Notifications
You must be signed in to change notification settings - Fork 30
85 lines (69 loc) · 2.68 KB
/
ios_ci.yml
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
name: iOS Build CI
on:
push:
branches:
- master
- 'debugci/ios_ci/*'
paths-ignore:
- 'landing/**'
- 'web/**'
- 'docs/**'
- 'keyserver/**'
- 'desktop/**'
jobs:
build:
name: Build and archive iOS app
runs-on: macos-14
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Clear unused NDKs
run: |
ls -1 "$ANDROID_SDK_ROOT/ndk" |
awk '{
if (system("git grep " $0 " > /dev/null")) {
system("rm -rf '"$ANDROID_SDK_ROOT/ndk/"'" $0);
}
}'
- name: Delete all iOS simulators
run: xcrun simctl delete all
- name: Delete iOS simulator caches
run: sudo rm -rf ~/Library/Developer/CoreSimulator/Caches/*
- name: Install Developer certificate
env:
BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
run: |
# create variables
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
# import certificate from secrets
echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode -o $CERTIFICATE_PATH
# create temporary keychain
security create-keychain -p "123456" $KEYCHAIN_PATH
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
security unlock-keychain -p "123456" $KEYCHAIN_PATH
# import certificate to keychain
security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
security list-keychain -d user -s $KEYCHAIN_PATH
- name: brew install protobuf
run: brew install protobuf
- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: 3.12
- name: Fix node-gyp
run: python -m pip install packaging setuptools
- name: yarn ci-cleaninstall
run: yarn ci-cleaninstall
- name: Save auth_key to file
working-directory: ./native/ios
env:
AUTH_KEY: ${{secrets.AUTH_KEY}}
run: echo "$AUTH_KEY" > AUTH_KEY.p8
- name: Archive
working-directory: ./native/ios
env:
AUTH_KEY_ID: ${{secrets.AUTH_KEY_ID}}
AUTH_KEY_ISSUER_ID: ${{secrets.AUTH_KEY_ISSUER_ID}}
run: xcodebuild archive -workspace Comm.xcworkspace -scheme Comm -configuration Release -archivePath archives/Comm.xcarchive -destination generic/platform=iOS -allowProvisioningUpdates -authenticationKeyIssuerID "$AUTH_KEY_ISSUER_ID" -authenticationKeyID "$AUTH_KEY_ID" -authenticationKeyPath $PWD/AUTH_KEY.p8