-
Notifications
You must be signed in to change notification settings - Fork 0
96 lines (89 loc) · 3.89 KB
/
ios-deployment.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
94
95
96
name: iOS development deployment workflow
on:
push:
branches: [ "release" ]
workflow_dispatch:
inputs:
logLevel:
description: 'Log level'
required: true
default: 'warning'
type: choice
options:
- info
- warning
- debug
print_tags:
description: 'True to print to STDOUT'
required: true
type: boolean
tags:
description: 'Test scenario tags'
required: true
type: string
jobs:
deploy:
name: Build and deploy default scheme using any available iPhone simulator
runs-on: macos-13-xlarge
defaults:
run:
working-directory: ./iOS/Layover
env:
XC_VERSION: ${{ '15.0.1' }}
XC_PROJECT: ${{ 'Layover.xcodeproj' }}
XC_ARCHIVE_PATH: ${{ '.Layover.xcarchive' }}
XC_EXPORT_PATH: ${{ '.artifacts' }}
KEYCHAIN: ${{ 'test.keychain' }}
DECRYPTED_CERTS_FILE_PATH: ${{ '../../.github/secrets/certificate.p12' }}
ENCRYPTED_CERTS_FILE_PATH: ${{ '../../.github/secrets/certificate.p12.gpg' }}
DECRYPTED_PROVISION_FILE_PATH: ${{ '../../.github/secrets/profile.mobileprovision' }}
ENCRYPTED_PROVISION_FILE_PATH: ${{ '../../.github/secrets/profile.mobileprovision.gpg' }}
CERTS_ENCRYPTION_PWD: ${{ secrets.CERTS_ENCRYPTION_PWD }}
PROVISION_ENCRYPTION_PWD: ${{ secrets.PROVISION_ENCRYPTION_PWD }}
CERTS_EXPORT_PWD: ${{ secrets.CERTS_EXPORT_PWD }}
steps:
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '15.0.1'
- name: Checkout
uses: actions/checkout@v3
- name: Set Default Scheme
run: |
scheme_list=$(xcodebuild -list -json | tr -d "\n")
default=$(echo $scheme_list | ruby -e "require 'json'; puts JSON.parse(STDIN.gets)['project']['targets'][0]")
echo $default | cat >default
echo Using default scheme: $default
- 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
- name: Configure Code Signing
run: |
gpg -d -o "$DECRYPTED_CERTS_FILE_PATH" --pinentry-mode=loopback --passphrase "$CERTS_ENCRYPTION_PWD" "$ENCRYPTED_CERTS_FILE_PATH"
gpg -d -o "$DECRYPTED_PROVISION_FILE_PATH" --pinentry-mode=loopback --passphrase "$PROVISION_ENCRYPTION_PWD" "$ENCRYPTED_PROVISION_FILE_PATH"
security import "$DECRYPTED_CERTS_FILE_PATH" -k "$KEYCHAIN" -P "$CERTS_EXPORT_PWD" -A
security set-key-partition-list -S apple-tool:,apple: -s -k "" "$KEYCHAIN"
mkdir -p "$HOME/Library/MobileDevice/Provisioning Profiles"
cd "../../.github/secrets"
echo `ls *.mobileprovision`
for PROVISION in `ls *.mobileprovision`
do
echo Hello, world!
UUID=`/usr/libexec/PlistBuddy -c 'Print :UUID' /dev/stdin <<< $(security cms -D -i ./$PROVISION)`
cp "./$PROVISION" "$HOME/Library/MobileDevice/Provisioning Profiles/$UUID.mobileprovision"
done
- name: Archive
run: |
mkdir artifacts
xcodebuild archive -project Layover.xcodeproj -scheme Layover -destination 'generic/platform=iOS' -configuration Release -archivePath Layover.xcarchive -skipPackagePluginValidation -skipMacroValidation CODE_SIGN_IDENTITY="Apple Development"
- name: Export
run: |
xcodebuild -exportArchive -archivePath Layover.xcarchive -exportOptionsPlist ExportOptions.plist -exportPath "$XC_EXPORT_PATH" -skipPackagePluginValidation -skipMacroValidation
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: Artifacts
path: ./artifacts