Skip to content

Commit bb7f747

Browse files
authored
chore: Adding workflow to build Amplify for minimum Xcode (#3633)
1 parent da563be commit bb7f747

File tree

5 files changed

+256
-25
lines changed

5 files changed

+256
-25
lines changed

.github/composite_actions/get_platform_parameters/action.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,22 @@ runs:
3939
- id: get-xcode-version
4040
run: |
4141
LATEST_XCODE_VERSION=14.3.1
42-
MINIMUM_XCODE_VERSION=14.0.1
42+
MINIMUM_XCODE_VERSION_IOS_MAC=14.1.0
43+
MINIMUM_XCODE_VERSION_WATCH_TV=14.3.1
4344
4445
INPUT_XCODE_VERSION=${{ inputs.xcode_version }}
4546
4647
case $INPUT_XCODE_VERSION in
4748
latest)
4849
XCODE_VERSION=$LATEST_XCODE_VERSION ;;
4950
minimum)
50-
XCODE_VERSION=$MINIMUM_XCODE_VERSION ;;
51+
INPUT_PLATFORM=${{ inputs.platform }}
52+
case $INPUT_PLATFORM in
53+
iOS|macOS)
54+
XCODE_VERSION=$MINIMUM_XCODE_VERSION_IOS_MAC ;;
55+
tvOS|watchOS)
56+
XCODE_VERSION=$MINIMUM_XCODE_VERSION_WATCH_TV ;;
57+
esac ;;
5158
*)
5259
XCODE_VERSION=$INPUT_XCODE_VERSION ;;
5360
esac
@@ -63,9 +70,9 @@ runs:
6370
6471
DESTINATION_MAPPING='{
6572
"minimum": {
66-
"iOS": "platform=iOS Simulator,name=iPhone 14,OS=16.0",
67-
"tvOS": "platform=tvOS Simulator,name=Apple TV 4K (2nd generation),OS=16.0",
68-
"watchOS": "platform=watchOS Simulator,name=Apple Watch Series 8 (45mm),OS=9.0",
73+
"iOS": "platform=iOS Simulator,name=iPhone 14,OS=16.1",
74+
"tvOS": "platform=tvOS Simulator,name=Apple TV 4K (2nd generation),OS=16.1",
75+
"watchOS": "platform=watchOS Simulator,name=Apple Watch Series 8 (45mm),OS=9.1",
6976
"macOS": "platform=macOS,arch=x86_64"
7077
},
7178
"latest": {

.github/workflows/build_amplify_swift_platforms.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,9 @@ jobs:
5252
- platform: ${{ github.event.inputs.macos == 'false' && 'macOS' || 'None' }}
5353
- platform: ${{ github.event.inputs.tvos == 'false' && 'tvOS' || 'None' }}
5454
- platform: ${{ github.event.inputs.watchos == 'false' && 'watchOS' || 'None' }}
55-
uses: ./.github/workflows/build_amplify_swift.yml
55+
uses: ./.github/workflows/build_scheme.yml
5656
with:
57+
scheme: Amplify-Package
5758
platform: ${{ matrix.platform }}
5859

5960
confirm-pass:

.github/workflows/build_minimum_supported_swift_platforms.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,21 @@
1-
name: Build with Minimum Supported Xcode Versions
1+
name: Build with minimum Xcode version | Amplify Swift
22
on:
33
workflow_dispatch:
4+
pull_request:
5+
branches:
6+
- main
7+
push:
8+
branches:
9+
- main
410

511
permissions:
612
contents: read
713
actions: write
814

15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
17+
cancel-in-progress: ${{ github.ref_name != 'main'}}
18+
919
jobs:
1020
build-amplify-with-minimum-supported-xcode:
1121
name: Build Amplify Swift for ${{ matrix.platform }}
@@ -14,12 +24,13 @@ jobs:
1424
matrix:
1525
platform: [iOS, macOS, tvOS, watchOS]
1626

17-
uses: ./.github/workflows/build_amplify_swift.yml
27+
uses: ./.github/workflows/build_scheme.yml
1828
with:
19-
os-runner: macos-12
29+
scheme: Amplify-Build
30+
os-runner: ${{ (matrix.platform == 'tvOS' || matrix.platform == 'watchOS') && 'macos-13' || 'macos-12' }}
2031
xcode-version: 'minimum'
2132
platform: ${{ matrix.platform }}
22-
cacheable: false
33+
save_build_cache: false
2334

2435
confirm-pass:
2536
runs-on: ubuntu-latest

.github/workflows/build_amplify_swift.yml renamed to .github/workflows/build_scheme.yml

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
name: Build Amplify-Package for the given platform
1+
name: Build scheme for the given platform and other parameters
22
on:
33
workflow_call:
44
inputs:
5+
scheme:
6+
type: string
7+
required: true
8+
59
platform:
610
type: string
711
required: true
@@ -14,7 +18,7 @@ on:
1418
type: string
1519
default: 'macos-13'
1620

17-
cacheable:
21+
save_build_cache:
1822
type: boolean
1923
default: true
2024

@@ -23,8 +27,8 @@ permissions:
2327
actions: write
2428

2529
jobs:
26-
build-amplify-swift:
27-
name: Build Amplify-Package | ${{ inputs.platform }}
30+
build-scheme:
31+
name: Build ${{ inputs.scheme }} | ${{ inputs.platform }}
2832
runs-on: ${{ inputs.os-runner }}
2933
steps:
3034
- name: Checkout repository
@@ -41,9 +45,8 @@ jobs:
4145

4246
- name: Attempt to use the dependencies cache
4347
id: dependencies-cache
44-
if: inputs.cacheable
4548
timeout-minutes: 4
46-
continue-on-error: ${{ inputs.cacheable }}
49+
continue-on-error: true
4750
uses: actions/cache/restore@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
4851
with:
4952
path: ~/Library/Developer/Xcode/DerivedData/Amplify
@@ -53,20 +56,18 @@ jobs:
5356
5457
- name: Attempt to restore the build cache from main
5558
id: build-cache
56-
if: inputs.cacheable
5759
timeout-minutes: 4
58-
continue-on-error: ${{ inputs.cacheable }}
60+
continue-on-error: true
5961
uses: actions/cache/restore@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
6062
with:
6163
path: ${{ github.workspace }}/Build
6264
key: Amplify-${{ inputs.platform }}-build-cache
6365

64-
- name: Build Amplify for Swift
66+
- name: Build ${{ inputs.scheme }}
6567
id: build-package
66-
continue-on-error: ${{ inputs.cacheable }}
6768
uses: ./.github/composite_actions/run_xcodebuild
6869
with:
69-
scheme: Amplify-Package
70+
scheme: ${{ inputs.scheme }}
7071
destination: ${{ steps.platform.outputs.destination }}
7172
sdk: ${{ steps.platform.outputs.sdk }}
7273
xcode_path: /Applications/Xcode_${{ steps.platform.outputs.xcode-version }}.app
@@ -75,22 +76,22 @@ jobs:
7576
disable_package_resolution: ${{ steps.dependencies-cache.outputs.cache-hit }}
7677

7778
- name: Save the dependencies cache in main
78-
if: inputs.cacheable && steps.dependencies-cache.outputs.cache-hit != 'true' && github.ref_name == 'main'
79+
if: inputs.save_build_cache && steps.dependencies-cache.outputs.cache-hit != 'true' && github.ref_name == 'main'
7980
uses: actions/cache/save@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
8081
with:
8182
path: ~/Library/Developer/Xcode/DerivedData/Amplify
8283
key: ${{ steps.dependencies-cache.outputs.cache-primary-key }}
8384

8485
- name: Delete the old build cache
85-
if: inputs.cacheable && steps.build-cache.outputs.cache-hit && github.ref_name == 'main'
86+
if: inputs.save_build_cache && steps.build-cache.outputs.cache-hit && github.ref_name == 'main'
8687
env:
8788
GH_TOKEN: ${{ github.token }}
88-
continue-on-error: ${{ inputs.cacheable }}
89+
continue-on-error: true
8990
run: |
9091
gh cache delete ${{ steps.build-cache.outputs.cache-primary-key }}
9192
9293
- name: Save the build cache
93-
if: inputs.cacheable && github.ref_name == 'main'
94+
if: inputs.save_build_cache && github.ref_name == 'main'
9495
uses: actions/cache/save@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
9596
with:
9697
path: ${{ github.workspace }}/Build
Lines changed: 211 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,211 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "1530"
4+
version = "1.7">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES">
8+
<BuildActionEntries>
9+
<BuildActionEntry
10+
buildForTesting = "NO"
11+
buildForRunning = "YES"
12+
buildForProfiling = "NO"
13+
buildForArchiving = "NO"
14+
buildForAnalyzing = "YES">
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "Amplify"
18+
BuildableName = "Amplify"
19+
BlueprintName = "Amplify"
20+
ReferencedContainer = "container:">
21+
</BuildableReference>
22+
</BuildActionEntry>
23+
<BuildActionEntry
24+
buildForTesting = "NO"
25+
buildForRunning = "YES"
26+
buildForProfiling = "NO"
27+
buildForArchiving = "NO"
28+
buildForAnalyzing = "YES">
29+
<BuildableReference
30+
BuildableIdentifier = "primary"
31+
BlueprintIdentifier = "AWSCognitoAuthPlugin"
32+
BuildableName = "AWSCognitoAuthPlugin"
33+
BlueprintName = "AWSCognitoAuthPlugin"
34+
ReferencedContainer = "container:">
35+
</BuildableReference>
36+
</BuildActionEntry>
37+
<BuildActionEntry
38+
buildForTesting = "NO"
39+
buildForRunning = "YES"
40+
buildForProfiling = "NO"
41+
buildForArchiving = "NO"
42+
buildForAnalyzing = "YES">
43+
<BuildableReference
44+
BuildableIdentifier = "primary"
45+
BlueprintIdentifier = "AWSDataStorePlugin"
46+
BuildableName = "AWSDataStorePlugin"
47+
BlueprintName = "AWSDataStorePlugin"
48+
ReferencedContainer = "container:">
49+
</BuildableReference>
50+
</BuildActionEntry>
51+
<BuildActionEntry
52+
buildForTesting = "NO"
53+
buildForRunning = "YES"
54+
buildForProfiling = "NO"
55+
buildForArchiving = "NO"
56+
buildForAnalyzing = "YES">
57+
<BuildableReference
58+
BuildableIdentifier = "primary"
59+
BlueprintIdentifier = "AWSCloudWatchLoggingPlugin"
60+
BuildableName = "AWSCloudWatchLoggingPlugin"
61+
BlueprintName = "AWSCloudWatchLoggingPlugin"
62+
ReferencedContainer = "container:">
63+
</BuildableReference>
64+
</BuildActionEntry>
65+
<BuildActionEntry
66+
buildForTesting = "NO"
67+
buildForRunning = "YES"
68+
buildForProfiling = "NO"
69+
buildForArchiving = "NO"
70+
buildForAnalyzing = "YES">
71+
<BuildableReference
72+
BuildableIdentifier = "primary"
73+
BlueprintIdentifier = "CoreMLPredictionsPlugin"
74+
BuildableName = "CoreMLPredictionsPlugin"
75+
BlueprintName = "CoreMLPredictionsPlugin"
76+
ReferencedContainer = "container:">
77+
</BuildableReference>
78+
</BuildActionEntry>
79+
<BuildActionEntry
80+
buildForTesting = "NO"
81+
buildForRunning = "YES"
82+
buildForProfiling = "NO"
83+
buildForArchiving = "NO"
84+
buildForAnalyzing = "YES">
85+
<BuildableReference
86+
BuildableIdentifier = "primary"
87+
BlueprintIdentifier = "AWSS3StoragePlugin"
88+
BuildableName = "AWSS3StoragePlugin"
89+
BlueprintName = "AWSS3StoragePlugin"
90+
ReferencedContainer = "container:">
91+
</BuildableReference>
92+
</BuildActionEntry>
93+
<BuildActionEntry
94+
buildForTesting = "NO"
95+
buildForRunning = "YES"
96+
buildForProfiling = "NO"
97+
buildForArchiving = "NO"
98+
buildForAnalyzing = "YES">
99+
<BuildableReference
100+
BuildableIdentifier = "primary"
101+
BlueprintIdentifier = "AWSPredictionsPlugin"
102+
BuildableName = "AWSPredictionsPlugin"
103+
BlueprintName = "AWSPredictionsPlugin"
104+
ReferencedContainer = "container:">
105+
</BuildableReference>
106+
</BuildActionEntry>
107+
<BuildActionEntry
108+
buildForTesting = "NO"
109+
buildForRunning = "YES"
110+
buildForProfiling = "NO"
111+
buildForArchiving = "NO"
112+
buildForAnalyzing = "YES">
113+
<BuildableReference
114+
BuildableIdentifier = "primary"
115+
BlueprintIdentifier = "AWSPinpointPushNotificationsPlugin"
116+
BuildableName = "AWSPinpointPushNotificationsPlugin"
117+
BlueprintName = "AWSPinpointPushNotificationsPlugin"
118+
ReferencedContainer = "container:">
119+
</BuildableReference>
120+
</BuildActionEntry>
121+
<BuildActionEntry
122+
buildForTesting = "NO"
123+
buildForRunning = "YES"
124+
buildForProfiling = "NO"
125+
buildForArchiving = "NO"
126+
buildForAnalyzing = "YES">
127+
<BuildableReference
128+
BuildableIdentifier = "primary"
129+
BlueprintIdentifier = "AWSPinpointAnalyticsPlugin"
130+
BuildableName = "AWSPinpointAnalyticsPlugin"
131+
BlueprintName = "AWSPinpointAnalyticsPlugin"
132+
ReferencedContainer = "container:">
133+
</BuildableReference>
134+
</BuildActionEntry>
135+
<BuildActionEntry
136+
buildForTesting = "NO"
137+
buildForRunning = "YES"
138+
buildForProfiling = "NO"
139+
buildForArchiving = "NO"
140+
buildForAnalyzing = "YES">
141+
<BuildableReference
142+
BuildableIdentifier = "primary"
143+
BlueprintIdentifier = "AWSAPIPlugin"
144+
BuildableName = "AWSAPIPlugin"
145+
BlueprintName = "AWSAPIPlugin"
146+
ReferencedContainer = "container:">
147+
</BuildableReference>
148+
</BuildActionEntry>
149+
<BuildActionEntry
150+
buildForTesting = "NO"
151+
buildForRunning = "YES"
152+
buildForProfiling = "NO"
153+
buildForArchiving = "NO"
154+
buildForAnalyzing = "YES">
155+
<BuildableReference
156+
BuildableIdentifier = "primary"
157+
BlueprintIdentifier = "AWSLocationGeoPlugin"
158+
BuildableName = "AWSLocationGeoPlugin"
159+
BlueprintName = "AWSLocationGeoPlugin"
160+
ReferencedContainer = "container:">
161+
</BuildableReference>
162+
</BuildActionEntry>
163+
<BuildActionEntry
164+
buildForTesting = "NO"
165+
buildForRunning = "YES"
166+
buildForProfiling = "NO"
167+
buildForArchiving = "NO"
168+
buildForAnalyzing = "YES">
169+
<BuildableReference
170+
BuildableIdentifier = "primary"
171+
BlueprintIdentifier = "AWSPluginsCore"
172+
BuildableName = "AWSPluginsCore"
173+
BlueprintName = "AWSPluginsCore"
174+
ReferencedContainer = "container:">
175+
</BuildableReference>
176+
</BuildActionEntry>
177+
</BuildActionEntries>
178+
</BuildAction>
179+
<TestAction
180+
buildConfiguration = "Debug"
181+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
182+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
183+
shouldUseLaunchSchemeArgsEnv = "YES"
184+
shouldAutocreateTestPlan = "YES">
185+
</TestAction>
186+
<LaunchAction
187+
buildConfiguration = "Debug"
188+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
189+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
190+
launchStyle = "0"
191+
useCustomWorkingDirectory = "NO"
192+
ignoresPersistentStateOnLaunch = "NO"
193+
debugDocumentVersioning = "YES"
194+
debugServiceExtension = "internal"
195+
allowLocationSimulation = "YES">
196+
</LaunchAction>
197+
<ProfileAction
198+
buildConfiguration = "Release"
199+
shouldUseLaunchSchemeArgsEnv = "YES"
200+
savedToolIdentifier = ""
201+
useCustomWorkingDirectory = "NO"
202+
debugDocumentVersioning = "YES">
203+
</ProfileAction>
204+
<AnalyzeAction
205+
buildConfiguration = "Debug">
206+
</AnalyzeAction>
207+
<ArchiveAction
208+
buildConfiguration = "Release"
209+
revealArchiveInOrganizer = "YES">
210+
</ArchiveAction>
211+
</Scheme>

0 commit comments

Comments
 (0)