Skip to content

Commit 2b72844

Browse files
authored
chore: kickoff release
2 parents 21aa9b5 + ae59b0a commit 2b72844

File tree

135 files changed

+2171
-2048
lines changed

Some content is hidden

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

135 files changed

+2171
-2048
lines changed

.github/composite_actions/run_xcodebuild/action.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@ inputs:
1919
required: false
2020
type: string
2121
default: 'iphonesimulator'
22+
cloned_source_packages_path:
23+
required: false
24+
type: string
25+
default: ''
26+
derived_data_path:
27+
required: false
28+
type: string
29+
default: ''
2230
disable_package_resolution:
2331
required: false
2432
type: boolean
@@ -36,6 +44,8 @@ runs:
3644
SCHEME: ${{ inputs.scheme }}
3745
PROJECT_PATH: ${{ inputs.project_path }}
3846
XCODE_PATH: ${{ inputs.xcode_path }}
47+
CLONED_SOURCE_PACKAGES_PATH: ${{ inputs.cloned_source_packages_path }}
48+
DERIVED_DATA_PATH: ${{ inputs.derived_data_path }}
3949
run: |
4050
if [ ! -z "$PROJECT_PATH" ]; then
4151
cd $PROJECT_PATH
@@ -46,8 +56,20 @@ runs:
4656
4757
otherFlags="${{ inputs.other_flags }}"
4858
if [ "${{ inputs.disable_package_resolution }}" == "true" ]; then
59+
echo "Disabling Automatic Package Resolution"
4960
otherFlags+=" -disableAutomaticPackageResolution"
5061
fi
62+
63+
if [ ! -z "$DERIVED_DATA_PATH" ]; then
64+
echo "Using custom DerivedData path"
65+
otherFlags+=" -derivedDataPath $DERIVED_DATA_PATH"
66+
fi
67+
68+
if [ ! -z "$CLONED_SOURCE_PACKAGES_PATH" ]; then
69+
echo "Using custom cloned source packages path"
70+
otherFlags+=" -clonedSourcePackagesDirPath $CLONED_SOURCE_PACKAGES_PATH"
71+
fi
72+
5173
xcodebuild -version
5274
xcodebuild build -scheme $SCHEME -sdk '${{ inputs.sdk }}' -destination '${{ inputs.destination }}' $otherFlags | xcpretty --simple --color --report junit && exit ${PIPESTATUS[0]}
5375
shell: bash
Lines changed: 47 additions & 130 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,34 @@
1-
name: Build | Amplify Swift
1+
name: Build Amplify-Package for the given platform
22
on:
33
workflow_call:
44
inputs:
5-
identifier:
6-
required: true
5+
platform:
76
type: string
8-
workflow_dispatch:
9-
push:
10-
branches-ignore:
11-
- main
12-
- release
7+
required: true
138

149
permissions:
15-
contents: read
16-
17-
concurrency:
18-
group: ${{ inputs.identifier || github.workflow }}-${{ github.event.pull_request.number || github.ref }}
19-
cancel-in-progress: ${{ github.ref_name != 'main'}}
10+
contents: read
11+
actions: write
2012

2113
jobs:
22-
build-amplify-swift-iOS:
14+
build-amplify-swift:
15+
name: Build Amplify-Package | ${{ inputs.platform }}
2316
runs-on: macos-13
24-
timeout-minutes: 20
2517
steps:
26-
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 #v3.5.3
18+
- name: Checkout repository
19+
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 #v3.5.3
2720
with:
2821
persist-credentials: false
29-
- name: Attempt to restore dependencies cache
30-
id: cache-packages
22+
23+
- name: Get build parameters for ${{ inputs.platform }}
24+
id: platform
25+
uses: ./.github/composite_actions/get_platform_parameters
26+
with:
27+
platform: ${{ inputs.platform }}
28+
xcode_version: '14.3'
29+
30+
- name: Attempt to use the dependencies cache
31+
id: dependencies-cache
3132
timeout-minutes: 4
3233
continue-on-error: true
3334
uses: actions/cache/restore@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
@@ -36,131 +37,47 @@ jobs:
3637
key: amplify-packages-${{ hashFiles('Package.resolved') }}
3738
restore-keys: |
3839
amplify-packages-
39-
- name: Build Amplify Swift for iOS
40-
uses: ./.github/composite_actions/run_xcodebuild
41-
with:
42-
scheme: Amplify-Package
43-
destination: 'platform=iOS Simulator,name=iPhone 14,OS=16.4'
44-
xcode_path: '/Applications/Xcode_14.3.app'
45-
disable_package_resolution: ${{ steps.cache-packages.outputs.cache-hit }}
46-
other_flags: '-derivedDataPath Build -clonedSourcePackagesDirPath ~/Library/Developer/Xcode/DerivedData/Amplify'
47-
- name: Save the dependencies cache if necessary
48-
if: steps.cache-packages.outputs.cache-hit != 'true' && github.ref_name == 'main'
49-
uses: actions/cache/save@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
50-
with:
51-
path: ~/Library/Developer/Xcode/DerivedData/Amplify
52-
key: ${{ steps.cache-packages.outputs.cache-primary-key }}
5340
54-
build-amplify-swift-macOS:
55-
runs-on: macos-13
56-
timeout-minutes: 20
57-
steps:
58-
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 #v3.5.3
59-
with:
60-
persist-credentials: false
61-
- name: Attempt to restore dependencies cache
62-
id: cache-packages
41+
- name: Attempt to restore the build cache from main
42+
id: build-cache
6343
timeout-minutes: 4
6444
continue-on-error: true
6545
uses: actions/cache/restore@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
6646
with:
67-
path: ~/Library/Developer/Xcode/DerivedData/Amplify
68-
key: amplify-packages-${{ hashFiles('Package.resolved') }}
69-
restore-keys: |
70-
amplify-packages-
71-
- name: Build Amplify Swift for macOS
72-
uses: ./.github/composite_actions/run_xcodebuild
73-
with:
74-
scheme: Amplify-Package
75-
destination: platform=macOS,arch=x86_64
76-
sdk: macosx
77-
xcode_path: '/Applications/Xcode_14.3.app'
78-
disable_package_resolution: ${{ steps.cache-packages.outputs.cache-hit }}
79-
other_flags: '-derivedDataPath Build -clonedSourcePackagesDirPath ~/Library/Developer/Xcode/DerivedData/Amplify'
80-
- name: Save the dependencies cache if necessary
81-
if: steps.cache-packages.outputs.cache-hit != 'true' && github.ref_name == 'main'
82-
uses: actions/cache/save@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
83-
with:
84-
path: ~/Library/Developer/Xcode/DerivedData/Amplify
85-
key: ${{ steps.cache-packages.outputs.cache-primary-key }}
47+
path: ${{ github.workspace }}/Build
48+
key: Amplify-${{ inputs.platform }}-build-cache
8649

87-
build-amplify-swift-tvOS:
88-
runs-on: macos-13
89-
timeout-minutes: 20
90-
steps:
91-
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 #v3.5.3
92-
with:
93-
persist-credentials: false
94-
- name: Attempt to restore dependencies cache
95-
timeout-minutes: 4
96-
id: cache-packages
50+
- name: Build Amplify for Swift
51+
id: build-package
9752
continue-on-error: true
98-
uses: actions/cache/restore@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
99-
with:
100-
path: ~/Library/Developer/Xcode/DerivedData/Amplify
101-
key: amplify-packages-${{ hashFiles('Package.resolved') }}
102-
restore-keys: |
103-
amplify-packages-
104-
- name: Build Amplify Swift for tvOS
10553
uses: ./.github/composite_actions/run_xcodebuild
10654
with:
10755
scheme: Amplify-Package
108-
destination: platform=tvOS Simulator,name=Apple TV 4K (3rd generation),OS=16.4
109-
sdk: appletvsimulator
110-
xcode_path: '/Applications/Xcode_14.3.app'
111-
disable_package_resolution: ${{ steps.cache-packages.outputs.cache-hit }}
112-
other_flags: '-derivedDataPath Build -clonedSourcePackagesDirPath ~/Library/Developer/Xcode/DerivedData/Amplify'
113-
- name: Save the dependencies cache if necessary
114-
if: steps.cache-packages.outputs.cache-hit != 'true' && github.ref_name == 'main'
56+
destination: ${{ steps.platform.outputs.destination }}
57+
sdk: ${{ steps.platform.outputs.sdk }}
58+
xcode_path: /Applications/Xcode_14.3.app
59+
cloned_source_packages_path: ~/Library/Developer/Xcode/DerivedData/Amplify
60+
derived_data_path: ${{ github.workspace }}/Build
61+
disable_package_resolution: ${{ steps.dependencies-cache.outputs.cache-hit }}
62+
63+
- name: Save the dependencies cache in main
64+
if: steps.dependencies-cache.outputs.cache-hit != 'true' && github.ref_name == 'main'
11565
uses: actions/cache/save@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
11666
with:
11767
path: ~/Library/Developer/Xcode/DerivedData/Amplify
118-
key: ${{ steps.cache-packages.outputs.cache-primary-key }}
119-
120-
build-amplify-swift-watchOS:
121-
runs-on: macos-13
122-
timeout-minutes: 20
123-
steps:
124-
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 #v3.5.3
125-
with:
126-
persist-credentials: false
127-
- name: Attempt to restore dependencies cache
128-
id: cache-packages
129-
timeout-minutes: 4
68+
key: ${{ steps.dependencies-cache.outputs.cache-primary-key }}
69+
70+
- name: Delete the old build cache
71+
if: steps.build-cache.outputs.cache-hit && github.ref_name == 'main'
72+
env:
73+
GH_TOKEN: ${{ github.token }}
13074
continue-on-error: true
131-
uses: actions/cache/restore@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
132-
with:
133-
path: ~/Library/Developer/Xcode/DerivedData/Amplify
134-
key: amplify-packages-${{ hashFiles('Package.resolved') }}
135-
restore-keys: |
136-
amplify-packages-
137-
- name: Build Amplify Swift for watchOS
138-
uses: ./.github/composite_actions/run_xcodebuild
139-
with:
140-
scheme: Amplify-Package
141-
destination: platform=watchOS Simulator,name=Apple Watch Series 8 (45mm),OS=9.4
142-
sdk: watchsimulator
143-
xcode_path: '/Applications/Xcode_14.3.app'
144-
disable_package_resolution: ${{ steps.cache-packages.outputs.cache-hit }}
145-
other_flags: '-derivedDataPath Build -clonedSourcePackagesDirPath ~/Library/Developer/Xcode/DerivedData/Amplify'
146-
- name: Save the dependencies cache if necessary
147-
if: steps.cache-packages.outputs.cache-hit != 'true' && github.ref_name == 'main'
75+
run: |
76+
gh cache delete ${{ steps.build-cache.outputs.cache-primary-key }}
77+
78+
- name: Save the build cache
79+
if: github.ref_name == 'main'
14880
uses: actions/cache/save@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
14981
with:
150-
path: ~/Library/Developer/Xcode/DerivedData/Amplify
151-
key: ${{ steps.cache-packages.outputs.cache-primary-key }}
152-
153-
confirm-pass:
154-
runs-on: ubuntu-latest
155-
name: Confirm Passing Build Steps
156-
if: ${{ !cancelled() }}
157-
needs: [
158-
build-amplify-swift-iOS,
159-
build-amplify-swift-macOS,
160-
build-amplify-swift-tvOS,
161-
build-amplify-swift-watchOS
162-
]
163-
env:
164-
EXIT_CODE: ${{ contains(needs.*.result, 'failure') && 1 || 0 }}
165-
steps:
166-
- run: exit $EXIT_CODE
82+
path: ${{ github.workspace }}/Build
83+
key: ${{ steps.build-cache.outputs.cache-primary-key }}
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Build | Amplify Swift
2+
on:
3+
workflow_call:
4+
inputs:
5+
identifier:
6+
required: true
7+
type: string
8+
workflow_dispatch:
9+
inputs:
10+
ios:
11+
description: '📱 iOS'
12+
required: true
13+
default: true
14+
type: boolean
15+
macos:
16+
description: '💻 macOS'
17+
required: true
18+
default: true
19+
type: boolean
20+
tvos:
21+
description: '📺 tvOS'
22+
required: true
23+
default: true
24+
type: boolean
25+
watchos:
26+
description: '⌚️ watchOS'
27+
required: true
28+
default: true
29+
type: boolean
30+
push:
31+
branches-ignore:
32+
- main
33+
- release
34+
35+
permissions:
36+
contents: read
37+
actions: write
38+
39+
concurrency:
40+
group: ${{ inputs.identifier || github.workflow }}-${{ github.event.pull_request.number || github.ref }}
41+
cancel-in-progress: ${{ github.ref_name != 'main'}}
42+
43+
jobs:
44+
build-amplify-swift:
45+
name: Build Amplify Swift for ${{ matrix.platform }}
46+
strategy:
47+
fail-fast: false
48+
matrix:
49+
platform: [iOS, macOS, tvOS, watchOS]
50+
exclude:
51+
- platform: ${{ github.event.inputs.ios == 'false' && 'iOS' || 'None' }}
52+
- platform: ${{ github.event.inputs.macos == 'false' && 'macOS' || 'None' }}
53+
- platform: ${{ github.event.inputs.tvos == 'false' && 'tvOS' || 'None' }}
54+
- platform: ${{ github.event.inputs.watchos == 'false' && 'watchOS' || 'None' }}
55+
uses: ./.github/workflows/build_amplify_swift.yml
56+
with:
57+
platform: ${{ matrix.platform }}
58+
59+
confirm-pass:
60+
runs-on: ubuntu-latest
61+
name: Confirm Passing Build Steps
62+
if: ${{ !cancelled() }}
63+
needs: [ build-amplify-swift ]
64+
env:
65+
EXIT_CODE: ${{ contains(needs.*.result, 'failure') && 1 || 0 }}
66+
steps:
67+
- run: exit $EXIT_CODE

.github/workflows/deploy_package.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ permissions:
1616
jobs:
1717
build-amplify-swift:
1818
name: Build Amplify package
19-
uses: ./.github/workflows/build_amplify_swift.yml
19+
uses: ./.github/workflows/build_amplify_swift_platforms.yml
2020
with:
2121
identifier: 'workflow-call-build-amplify-swift'
2222

.github/workflows/integ_test_analytics.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,13 @@ jobs:
3131
matrix:
3232
platform: [iOS, tvOS, watchOS]
3333
exclude:
34-
- platform: ${{ github.event.inputs.ios == 'false' && 'iOS' || 'Dummy' }}
35-
- platform: ${{ github.event.inputs.tvos == 'false' && 'tvOS' || 'Dummy' }}
36-
- platform: ${{ github.event.inputs.watchos == 'false' && 'watchOS' || 'Dummy' }}
34+
- platform: ${{ github.event.inputs.ios == 'false' && 'iOS' || 'None' }}
35+
- platform: ${{ github.event.inputs.tvos == 'false' && 'tvOS' || 'None' }}
36+
- platform: ${{ github.event.inputs.watchos == 'false' && 'watchOS' || 'None' }}
3737
uses: ./.github/workflows/run_integration_tests.yml
3838
with:
3939
scheme: ${{ matrix.platform == 'watchOS' && 'AWSPinpointAnalyticsPluginIntegrationTestsWatch' || 'AWSPinpointAnalyticsPluginIntegrationTests' }}
4040
platform: ${{ matrix.platform }}
41-
build_cache_key: AWSPinpointAnalyticsPlugin-${{ matrix.platform }}-latest-build-main
4241
project_path: ./AmplifyPlugins/Analytics/Tests/AnalyticsHostApp
4342
xcode_version: '14.3'
4443
resource_subfolder: analytics

.github/workflows/integ_test_api_functional.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,13 @@ jobs:
3131
matrix:
3232
platform: [iOS, tvOS, watchOS]
3333
exclude:
34-
- platform: ${{ github.event.inputs.ios == 'false' && 'iOS' || 'Dummy' }}
35-
- platform: ${{ github.event.inputs.tvos == 'false' && 'tvOS' || 'Dummy' }}
36-
- platform: ${{ github.event.inputs.watchos == 'false' && 'watchOS' || 'Dummy' }}
34+
- platform: ${{ github.event.inputs.ios == 'false' && 'iOS' || 'None' }}
35+
- platform: ${{ github.event.inputs.tvos == 'false' && 'tvOS' || 'None' }}
36+
- platform: ${{ github.event.inputs.watchos == 'false' && 'watchOS' || 'None' }}
3737
uses: ./.github/workflows/run_integration_tests.yml
3838
with:
3939
scheme: ${{ matrix.platform == 'watchOS' && 'AWSAPIPluginFunctionalTestsWatch' || 'AWSAPIPluginFunctionalTests' }}
4040
platform: ${{ matrix.platform }}
41-
build_cache_key: AWSAPIPlugin-${{ matrix.platform }}-latest-build-main
4241
project_path: ./AmplifyPlugins/API/Tests/APIHostApp
4342
xcode_version: '14.3'
4443
resource_subfolder: api

.github/workflows/integ_test_api_graphql_auth_directive.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,12 @@ jobs:
2626
matrix:
2727
platform: [iOS, tvOS, watchOS]
2828
exclude:
29-
- platform: ${{ github.event.inputs.ios == 'false' && 'iOS' || 'Dummy' }}
30-
- platform: ${{ github.event.inputs.tvos == 'false' && 'tvOS' || 'Dummy' }}
29+
- platform: ${{ github.event.inputs.ios == 'false' && 'iOS' || 'None' }}
30+
- platform: ${{ github.event.inputs.tvos == 'false' && 'tvOS' || 'None' }}
3131
uses: ./.github/workflows/run_integration_tests.yml
3232
with:
3333
scheme: AWSAPIPluginGraphQLAuthDirectiveTests
3434
platform: ${{ matrix.platform }}
35-
build_cache_key: AWSAPIPlugin-${{ matrix.platform }}-latest-build-main
3635
project_path: ./AmplifyPlugins/API/Tests/APIHostApp
3736
xcode_version: '14.3'
3837
resource_subfolder: api

0 commit comments

Comments
 (0)