-
Notifications
You must be signed in to change notification settings - Fork 0
135 lines (109 loc) · 4.49 KB
/
build.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
name: Build App
on:
push:
branches: [ develop, master, feature/* ]
pull_request:
branches: [ develop, master, feature/* ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
permissions:
id-token: write
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: macos-13
env:
FASTLANE_XCODEBUILD_SETTINGS_TIMEOUT: 60
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Select Xcode Version
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '14.2'
# Required for KotlinMultiplatform
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version-file: ".java-version"
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Cache Cocoapods
uses: actions/cache@v4
with:
path: ~/.cocoapods/repos
key: ${{ runner.os }}-cocoapods-${{ github.sha }}
restore-keys: ${{ runner.os }}-cocoapods-
- name: Cache Konan
uses: actions/cache@v4
with:
path: ~/.konan
key: ${{ runner.os }}-konan-${{ github.sha }}
restore-keys: ${{ runner.os }}-konan-
- name: Pod install
run: bundle exec pod install --repo-update
- name: Run UITests
run: bundle exec fastlane cru_shared_lane_run_tests scheme:GodTools-UITests
- name: Run Tests and Generate Code Coverage Report (.xcresult)
run: bundle exec fastlane cru_shared_lane_run_tests output_directory:fastlane_scan_output_directory result_bundle:true
- name: Upload Xcode Code Coverage Report to CodeCov
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
xcode: true
xcode_archive_path: /Users/runner/work/godtools-swift/godtools-swift/fastlane_scan_output_directory/GodTools-Production.xcresult
- name: Configure AWS credentials
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_IAM_ONESKY_ROLE_ARN }}
aws-region: us-east-1
- name: Import OneSky Keys
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
uses: dkershner6/aws-ssm-getparameters-action@v2
with:
parameterPairs: |
/shared/onesky/PUBLIC_KEY = ONESKY_PUBLIC_KEY,
/shared/onesky/SECRET_KEY = ONESKY_SECRET_KEY
- name: Download And Commit Latest OneSky Localizations
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
run: bundle exec fastlane cru_shared_lane_download_and_commit_latest_one_sky_localizations
- name: Import App Store Connect API Key
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
env:
APP_STORE_CONNECT_API_JSON_PAYLOAD: ${{ secrets.APP_STORE_CONNECT_API_JSON_PAYLOAD }}
run: echo $APP_STORE_CONNECT_API_JSON_PAYLOAD > fastlane/AppleAppStoreApi.json
- name: Increment Xcode Project Build Number
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
run: bundle exec fastlane cru_shared_lane_increment_xcode_project_build_number
- name: Build And Deploy For TestFlight Release
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
env:
MATCH_GIT_BASIC_AUTHORIZATION_PAT: ${{ secrets.MATCH_GIT_BASIC_AUTHORIZATION_PAT }}
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
run: bundle exec fastlane cru_shared_lane_build_and_deploy_for_testflight_release is_running_in_ci:true
- name: Push Commits To Remote
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
run: git push
- name: Archive XCode Logs
if: always()
uses: actions/upload-artifact@v4
with:
name: xcode-logs
path: "/Users/runner/Library/Developer/Xcode/DerivedData/Logs/godtools-*/**"
- name: Archive Fastlane Gym Logs
if: always()
uses: actions/upload-artifact@v4
with:
name: fastlane-gym-logs
path: "/Users/runner/Library/Logs/gym/godtools-*/**"