-
Notifications
You must be signed in to change notification settings - Fork 0
151 lines (129 loc) · 4.46 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
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
# Requirement: CI/CD Pipeline
# Location: 6.5 CI/CD PIPELINE
# GitHub Actions workflow for iOS app build, test, and deployment
name: iOS CI/CD
on:
push:
branches: [ main, develop ]
paths:
- 'src/ios/**'
- '.github/workflows/ios.yml'
pull_request:
branches: [ main, develop ]
paths:
- 'src/ios/**'
- '.github/workflows/ios.yml'
env:
XCODE_VERSION: '14.0'
RUBY_VERSION: '3.0'
DEVELOPER_APP_ID: ${{ secrets.APPLE_DEVELOPER_APP_ID }}
DEVELOPER_APP_IDENTIFIER: ${{ secrets.APPLE_DEVELOPER_APP_IDENTIFIER }}
PROVISIONING_PROFILE_SPECIFIER: ${{ secrets.PROVISIONING_PROFILE_SPECIFIER }}
TEMP_KEYCHAIN_PASSWORD: ${{ secrets.TEMP_KEYCHAIN_PASSWORD }}
APPLE_KEYCHAIN_PASSWORD: ${{ secrets.APPLE_KEYCHAIN_PASSWORD }}
WORKSPACE: Founditure.xcworkspace
SCHEME: Founditure
jobs:
# Requirement: Development Environment Setup
# Location: APPENDICES/A.1 Development Environment Setup
build:
name: Build iOS App
runs-on: macos-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Ruby Environment
uses: actions/setup-ruby@v1
with:
ruby-version: ${{ env.RUBY_VERSION }}
- name: Install Fastlane and CocoaPods
run: |
gem install bundler
bundle install
gem install cocoapods -v 1.12.1
- name: Setup Build Environment
run: |
cd src/ios
bundle exec fastlane setup
- name: Cache CocoaPods Dependencies
uses: actions/cache@v3
with:
path: src/ios/Pods
key: ${{ runner.os }}-pods-${{ hashFiles('src/ios/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-pods-
- name: Install CocoaPods Dependencies
run: |
cd src/ios
pod install
# Requirement: Testing Strategy
# Location: APPENDICES/A.2 Testing Strategy
- name: Run Tests
run: |
cd src/ios
bundle exec fastlane test
- name: Build App (Debug)
run: |
cd src/ios
bundle exec fastlane build configuration:Debug
- name: Upload Build Artifacts
uses: actions/upload-artifact@v3
with:
name: build-artifacts
path: |
src/ios/build/Founditure.ipa
src/ios/build/test_output/reports
src/ios/build/test_output/coverage
retention-days: 14
# Requirement: CI/CD Pipeline
# Location: 6.5 CI/CD PIPELINE
deploy_testflight:
name: Deploy to TestFlight
needs: build
runs-on: macos-latest
if: github.ref == 'refs/heads/main'
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Ruby Environment
uses: actions/setup-ruby@v1
with:
ruby-version: ${{ env.RUBY_VERSION }}
- name: Install Dependencies
run: |
gem install bundler
bundle install
gem install cocoapods -v 1.12.1
- name: Download Build Artifacts
uses: actions/download-artifact@v3
with:
name: build-artifacts
path: src/ios/build
- name: Setup Keychain
run: |
security create-keychain -p ${{ env.TEMP_KEYCHAIN_PASSWORD }} build.keychain
security default-keychain -s build.keychain
security unlock-keychain -p ${{ env.TEMP_KEYCHAIN_PASSWORD }} build.keychain
security set-keychain-settings -t 3600 -l ~/Library/Keychains/build.keychain
- name: Import Certificates
run: |
echo ${{ secrets.APPLE_DISTRIBUTION_CERTIFICATE_BASE64 }} | base64 --decode > distribution.p12
security import distribution.p12 -k build.keychain -P ${{ secrets.APPLE_CERTIFICATE_PASSWORD }} -T /usr/bin/codesign
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k ${{ env.TEMP_KEYCHAIN_PASSWORD }} build.keychain
- name: Deploy to TestFlight
env:
APPLE_ID: ${{ secrets.APPLE_ID }}
TEAM_ID: ${{ secrets.TEAM_ID }}
ITC_TEAM_ID: ${{ secrets.ITC_TEAM_ID }}
BETA_FEEDBACK_EMAIL: ${{ secrets.BETA_FEEDBACK_EMAIL }}
run: |
cd src/ios
bundle exec fastlane beta
- name: Clean Up Keychain
if: always()
run: |
security delete-keychain build.keychain