Skip to content

Commit e6e1098

Browse files
authored
chore: kickoff release
2 parents eec6a7f + f9b02de commit e6e1098

File tree

53 files changed

+451
-291
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+451
-291
lines changed

.github/composite_actions/get_platform_parameters/action.yml

Lines changed: 65 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,56 +5,99 @@ inputs:
55
required: true
66
type: string
77
xcode_version:
8-
description: 'The version of Xcode. Valid values are 14.3 and 15.0'
9-
required: true
8+
description: "The version of Xcode. Available aliases are 'latest' and 'minimum'"
9+
default: 'latest'
10+
type: string
11+
destination:
12+
description: "The destination associated with the given platform and Xcode version"
13+
default: ''
1014
type: string
15+
1116
outputs:
1217
destination:
1318
description: "The destination associated with the given platform and Xcode version"
14-
value: ${{ steps.platform.outputs.destination }}
19+
value: ${{ steps.get-destination.outputs.destination }}
1520
sdk:
1621
description: "The SDK associated with the given platform"
17-
value: ${{ steps.platform.outputs.sdk }}
22+
value: ${{ steps.get-sdk.outputs.sdk }}
23+
xcode-version:
24+
description: "The Xcode version to build with"
25+
value: ${{ steps.get-xcode-version.outputs.xcode-version }}
26+
1827
runs:
1928
using: "composite"
2029
steps:
21-
- id: platform
30+
- name: Validate platform
2231
run: |
23-
PLATFORM=${{ inputs.platform }}
24-
case $PLATFORM in
32+
INPUT_PLATFORM=${{ inputs.platform }}
33+
case $INPUT_PLATFORM in
2534
iOS|tvOS|watchOS|macOS) ;;
26-
*) echo "Unsupported platform: $PLATFORM"; exit 1 ;;
35+
*) echo "Unsupported platform: $INPUT_PLATFORM"; exit 1 ;;
2736
esac
37+
shell: bash
38+
39+
- id: get-xcode-version
40+
run: |
41+
LATEST_XCODE_VERSION=14.3.1
42+
MINIMUM_XCODE_VERSION=14.0.1
2843
29-
XCODE_VERSION=${{ inputs.xcode_version }}
30-
case $XCODE_VERSION in
31-
14.3|15.0) ;;
32-
*) echo "Unsupported Xcode version: $XCODE_VERSION"; exit 1 ;;
44+
INPUT_XCODE_VERSION=${{ inputs.xcode_version }}
45+
46+
case $INPUT_XCODE_VERSION in
47+
latest)
48+
XCODE_VERSION=$LATEST_XCODE_VERSION ;;
49+
minimum)
50+
XCODE_VERSION=$MINIMUM_XCODE_VERSION ;;
51+
*)
52+
XCODE_VERSION=$INPUT_XCODE_VERSION ;;
3353
esac
54+
echo "xcode-version=$XCODE_VERSION" >> $GITHUB_OUTPUT
55+
56+
shell: bash
57+
58+
- id: get-destination
59+
run: |
60+
INPUT_PLATFORM=${{ inputs.platform }}
61+
INPUT_DESTINATION='${{ inputs.destination }}'
62+
INPUT_XCODE_VERSION=${{ inputs.xcode_version }}
3463
3564
DESTINATION_MAPPING='{
36-
"14.3": {
65+
"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",
69+
"macOS": "platform=macOS,arch=x86_64"
70+
},
71+
"latest": {
3772
"iOS": "platform=iOS Simulator,name=iPhone 14,OS=16.4",
3873
"tvOS": "platform=tvOS Simulator,name=Apple TV 4K (3rd generation),OS=16.4",
3974
"watchOS": "platform=watchOS Simulator,name=Apple Watch Series 8 (45mm),OS=9.4",
4075
"macOS": "platform=macOS,arch=x86_64"
41-
},
42-
"15.0": {
43-
"iOS": "platform=iOS Simulator,name=iPhone 15,OS=latest",
44-
"tvOS": "platform=tvOS Simulator,name=Apple TV 4K (3rd generation),OS=latest",
45-
"watchOS": "platform=watchOS Simulator,name=Apple Watch Series 9 (45mm),OS=latest",
46-
"macOS": "platform=macOS,arch=x86_64"
4776
}
4877
}'
4978
79+
if [ -z "$INPUT_DESTINATION" ]; then
80+
DESTINATION=$(echo $DESTINATION_MAPPING | jq -r ".\"$INPUT_XCODE_VERSION\".$INPUT_PLATFORM")
81+
else
82+
DESTINATION=$INPUT_DESTINATION
83+
fi
84+
85+
if [ -z "$DESTINATION" ]; then
86+
echo "No available destination to build for"
87+
exit 1
88+
fi
89+
echo "destination=$DESTINATION" >> $GITHUB_OUTPUT
90+
shell: bash
91+
92+
- id: get-sdk
93+
run: |
94+
INPUT_PLATFORM=${{ inputs.platform }}
5095
SDK_MAPPING='{
5196
"iOS": "iphonesimulator",
5297
"tvOS": "appletvsimulator",
5398
"watchOS": "watchsimulator",
5499
"macOS": "macosx"
55100
}'
56-
57-
echo "destination=$(echo $DESTINATION_MAPPING | jq -r ."\"$XCODE_VERSION\"".$PLATFORM)" >> $GITHUB_OUTPUT
58-
echo "sdk=$(echo $SDK_MAPPING | jq -r .$PLATFORM)" >> $GITHUB_OUTPUT
101+
echo "sdk=$(echo $SDK_MAPPING | jq -r .$INPUT_PLATFORM)" >> $GITHUB_OUTPUT
59102
shell: bash
60103

.github/composite_actions/run_xcodebuild_test/action.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@ inputs:
1212
required: false
1313
type: string
1414
destination:
15-
required: false
15+
required: true
1616
type: string
17-
default: 'platform=iOS Simulator,name=iPhone 13,OS=latest'
1817
sdk:
1918
required: false
2019
type: string

.github/workflows/build_amplify_swift.yml

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,26 @@ on:
66
type: string
77
required: true
88

9+
xcode-version:
10+
type: string
11+
default: 'latest'
12+
13+
os-runner:
14+
type: string
15+
default: 'macos-13'
16+
17+
cacheable:
18+
type: boolean
19+
default: true
20+
921
permissions:
1022
contents: read
1123
actions: write
1224

1325
jobs:
1426
build-amplify-swift:
1527
name: Build Amplify-Package | ${{ inputs.platform }}
16-
runs-on: macos-13
28+
runs-on: ${{ inputs.os-runner }}
1729
steps:
1830
- name: Checkout repository
1931
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
@@ -25,12 +37,13 @@ jobs:
2537
uses: ./.github/composite_actions/get_platform_parameters
2638
with:
2739
platform: ${{ inputs.platform }}
28-
xcode_version: '14.3'
29-
40+
xcode_version: ${{ inputs.xcode-version }}
41+
3042
- name: Attempt to use the dependencies cache
3143
id: dependencies-cache
44+
if: inputs.cacheable
3245
timeout-minutes: 4
33-
continue-on-error: true
46+
continue-on-error: ${{ inputs.cacheable }}
3447
uses: actions/cache/restore@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
3548
with:
3649
path: ~/Library/Developer/Xcode/DerivedData/Amplify
@@ -40,43 +53,44 @@ jobs:
4053
4154
- name: Attempt to restore the build cache from main
4255
id: build-cache
56+
if: inputs.cacheable
4357
timeout-minutes: 4
44-
continue-on-error: true
58+
continue-on-error: ${{ inputs.cacheable }}
4559
uses: actions/cache/restore@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
4660
with:
4761
path: ${{ github.workspace }}/Build
4862
key: Amplify-${{ inputs.platform }}-build-cache
4963

5064
- name: Build Amplify for Swift
5165
id: build-package
52-
continue-on-error: true
66+
continue-on-error: ${{ inputs.cacheable }}
5367
uses: ./.github/composite_actions/run_xcodebuild
5468
with:
5569
scheme: Amplify-Package
5670
destination: ${{ steps.platform.outputs.destination }}
5771
sdk: ${{ steps.platform.outputs.sdk }}
58-
xcode_path: /Applications/Xcode_14.3.app
72+
xcode_path: /Applications/Xcode_${{ steps.platform.outputs.xcode-version }}.app
5973
cloned_source_packages_path: ~/Library/Developer/Xcode/DerivedData/Amplify
6074
derived_data_path: ${{ github.workspace }}/Build
6175
disable_package_resolution: ${{ steps.dependencies-cache.outputs.cache-hit }}
6276

6377
- name: Save the dependencies cache in main
64-
if: steps.dependencies-cache.outputs.cache-hit != 'true' && github.ref_name == 'main'
78+
if: inputs.cacheable && steps.dependencies-cache.outputs.cache-hit != 'true' && github.ref_name == 'main'
6579
uses: actions/cache/save@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
6680
with:
6781
path: ~/Library/Developer/Xcode/DerivedData/Amplify
6882
key: ${{ steps.dependencies-cache.outputs.cache-primary-key }}
69-
83+
7084
- name: Delete the old build cache
71-
if: steps.build-cache.outputs.cache-hit && github.ref_name == 'main'
85+
if: inputs.cacheable && steps.build-cache.outputs.cache-hit && github.ref_name == 'main'
7286
env:
7387
GH_TOKEN: ${{ github.token }}
74-
continue-on-error: true
88+
continue-on-error: ${{ inputs.cacheable }}
7589
run: |
7690
gh cache delete ${{ steps.build-cache.outputs.cache-primary-key }}
7791
7892
- name: Save the build cache
79-
if: github.ref_name == 'main'
93+
if: inputs.cacheable && github.ref_name == 'main'
8094
uses: actions/cache/save@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
8195
with:
8296
path: ${{ github.workspace }}/Build
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Build with Minimum Supported Xcode Versions
2+
on:
3+
workflow_dispatch:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: read
10+
actions: write
11+
12+
jobs:
13+
build-amplify-with-minimum-supported-xcode:
14+
name: Build Amplify Swift for ${{ matrix.platform }}
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
platform: [iOS, macOS, tvOS, watchOS]
19+
20+
uses: ./.github/workflows/build_amplify_swift.yml
21+
with:
22+
os-runner: macos-12
23+
xcode-version: 'minimum'
24+
platform: ${{ matrix.platform }}
25+
cacheable: false
26+
27+
confirm-pass:
28+
runs-on: ubuntu-latest
29+
name: Confirm Passing Build Steps
30+
if: ${{ !cancelled() }}
31+
needs: [ build-amplify-with-minimum-supported-xcode ]
32+
env:
33+
EXIT_CODE: ${{ contains(needs.*.result, 'failure') && 1 || 0 }}
34+
steps:
35+
- run: exit $EXIT_CODE

.github/workflows/integ_test_analytics.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ jobs:
3939
scheme: ${{ matrix.platform == 'watchOS' && 'AWSPinpointAnalyticsPluginIntegrationTestsWatch' || 'AWSPinpointAnalyticsPluginIntegrationTests' }}
4040
platform: ${{ matrix.platform }}
4141
project_path: ./AmplifyPlugins/Analytics/Tests/AnalyticsHostApp
42-
xcode_version: '14.3'
4342
resource_subfolder: analytics
4443
timeout-minutes: 30
4544
secrets: inherit

.github/workflows/integ_test_api_functional.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ jobs:
3939
scheme: ${{ matrix.platform == 'watchOS' && 'AWSAPIPluginFunctionalTestsWatch' || 'AWSAPIPluginFunctionalTests' }}
4040
platform: ${{ matrix.platform }}
4141
project_path: ./AmplifyPlugins/API/Tests/APIHostApp
42-
xcode_version: '14.3'
4342
resource_subfolder: api
4443
timeout-minutes: 45
4544
secrets: inherit

.github/workflows/integ_test_api_graphql_auth_directive.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ jobs:
3333
scheme: AWSAPIPluginGraphQLAuthDirectiveTests
3434
platform: ${{ matrix.platform }}
3535
project_path: ./AmplifyPlugins/API/Tests/APIHostApp
36-
xcode_version: '14.3'
3736
resource_subfolder: api
3837
timeout-minutes: 45
3938
secrets: inherit

.github/workflows/integ_test_api_graphql_iam.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ jobs:
3333
scheme: AWSAPIPluginGraphQLIAMTests
3434
platform: ${{ matrix.platform }}
3535
project_path: ./AmplifyPlugins/API/Tests/APIHostApp
36-
xcode_version: '14.3'
3736
resource_subfolder: api
3837
timeout-minutes: 45
3938
secrets: inherit

.github/workflows/integ_test_api_graphql_lambda_auth.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ jobs:
3939
scheme: ${{ matrix.platform == 'watchOS' && 'AWSAPIPluginGraphQLLambdaAuthTestsWatch' || 'AWSAPIPluginGraphQLLambdaAuthTests' }}
4040
platform: ${{ matrix.platform }}
4141
project_path: ./AmplifyPlugins/API/Tests/APIHostApp
42-
xcode_version: '14.3'
4342
resource_subfolder: api
4443
timeout-minutes: 45
4544
secrets: inherit

.github/workflows/integ_test_api_graphql_lazy_load.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ jobs:
3333
scheme: AWSAPIPluginLazyLoadTests
3434
platform: ${{ matrix.platform }}
3535
project_path: ./AmplifyPlugins/API/Tests/APIHostApp
36-
xcode_version: '14.3'
3736
resource_subfolder: api
3837
timeout-minutes: 45
3938
secrets: inherit

0 commit comments

Comments
 (0)