-
Notifications
You must be signed in to change notification settings - Fork 30
93 lines (81 loc) · 3.77 KB
/
iOS.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
86
87
88
89
90
91
92
93
name: NLiteAVDemo - iOS
on:
push:
branches: [ master, develop, feature/feature_iOS ]
pull_request:
branches: [ master ]
jobs:
build_chatroom_objc:
name: Build NEChatroom Objc
runs-on: macos-latest
env:
XC_PROJECT_NAME: ${{ 'NLiteAVDemo' }}
XC_VERSION: ${{ '11.4' }}
XC_SCHEME: ${{ 'NLiteAVDemo' }}
XC_WORKSPACE: ${{ 'NLiteAVDemo.xcworkspace' }}
XC_CONFIGURATION: ${{ 'release' }}
XC_ARCHIVE_DIR: ${{ './product/archive' }}
XC_IPA_DIR: ${{ './product/ipa' }}
XC_EXPORT_OPTIONS_PATH: ${{ './Workflow/ExportOptions.plist' }}
XC_CONFIG_STUB_SCRIPT_PATH: ${{ './Workflow/config_stub.py' }}
ENCRYPTED_CERT_PATH: ${{ './Workflow/cert.p12.gpg' }}
DECRYPTED_CERT_PATH: ${{ './Workflow/cert.p12' }}
ENCRYPTED_PROVISION_PATH: ${{ './Workflow/NELiteAVDemo_Profile_InHouse.mobileprovision.gpg' }}
DECRYPTED_PROVISION_PATH: ${{ './Workflow/NELiteAVDemo_Profile_InHouse.mobileprovision' }}
CERT_ENC_PWD: ${{ secrets.CERT_ENC_PWD }}
CERT_PWD: ${{ secrets.CERT_PWD }}
PROVISION_ENC_PWD: ${{ secrets.PROVISION_ENC_PWD }}
APP_KEY: ${{ secrets.APP_KEY }}
API_BASE_URL: ${{ secrets.API_BASE_URL }}
APNS_CERT_NAME: ${{ secrets.APNS_CERT_NAME }}
KEYCHAIN: ${{ 'temp.keychain' }}
APP_CONFIG_FILE_PATH: ${{ './NLiteAVDemo/AppKey.h' }}
defaults:
run:
shell: bash
working-directory: ./NLiteAVDemo-iOS-ObjC/
steps:
- uses: actions/checkout@v2
- name: Setup Python 3.12.4
uses: actions/setup-python@v2
with:
python-version: '3.12.4'
- name: Config Stub
run:
python $XC_CONFIG_STUB_SCRIPT_PATH $APP_CONFIG_FILE_PATH $APP_KEY $API_BASE_URL $APNS_CERT_NAME
- name: Select Xcode
run:
sudo xcode-select -s /Applications/Xcode_$XC_VERSION.app
- name: Install Dependencies
run: pod install
- name: Configure Keychain
run:
security create-keychain -p "" "$KEYCHAIN";
security list-keychains -s "$KEYCHAIN";
security default-keychain -s "$KEYCHAIN";
security unlock-keychain -p "" "$KEYCHAIN";
security set-keychain-settings;
security list-keychains;
- name: Configure Code Signing
run:
gpg -d -o "$DECRYPTED_CERT_PATH" --pinentry-mode=loopback --passphrase "$CERT_ENC_PWD" "$ENCRYPTED_CERT_PATH";
gpg -d -o "$DECRYPTED_PROVISION_PATH" --pinentry-mode=loopback --passphrase "$PROVISION_ENC_PWD" "$ENCRYPTED_PROVISION_PATH";
security import "$DECRYPTED_CERT_PATH" -k "$KEYCHAIN" -P "$CERT_PWD" -A;
security set-key-partition-list -S apple-tool:,apple:, -s -k "" "$KEYCHAIN";
mkdir -p "$HOME/Library/MobileDevice/Provisioning Profiles";
UUID=$(/usr/libexec/PlistBuddy -c "Print :UUID" /dev/stdin <<< $(security cms -D -i $DECRYPTED_PROVISION_PATH));
cp "$DECRYPTED_PROVISION_PATH" "$HOME/Library/MobileDevice/Provisioning Profiles/$UUID.mobileprovision";
- name: Archive
run:
mkdir -p $XC_ARCHIVE_DIR;
UUID=$(/usr/libexec/PlistBuddy -c "Print :UUID" /dev/stdin <<< $(security cms -D -i $DECRYPTED_PROVISION_PATH));
xcodebuild archive -workspace $XC_WORKSPACE -scheme $XC_SCHEME -configuration release -archivePath $XC_ARCHIVE_DIR/$XC_PROJECT_NAME.xcarchive CODE_SIGN_IDENTITY="iPhone Distribution" PROVISIONING_PROFILE_SPECIFIER=$UUID;
- name: Export IPA
run:
mkdir -p $XC_IPA_DIR;
xcodebuild -exportArchive -archivePath $XC_ARCHIVE_DIR/$XC_PROJECT_NAME.xcarchive -exportPath $XC_IPA_DIR -exportOptionsPlist $XC_EXPORT_OPTIONS_PATH;
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: NLiteAVDemo-iOS-ObjC
path: ./NLiteAVDemo-iOS-ObjC/product/ipa/NLiteAVDemo-iOS-ObjC.ipa