Skip to content

Commit 563f5a9

Browse files
authored
chore: kickoff release
2 parents 6f62290 + 52798cb commit 563f5a9

File tree

156 files changed

+3498
-418
lines changed

Some content is hidden

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

156 files changed

+3498
-418
lines changed

.circleci/config.yml

Lines changed: 37 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ parameters:
1212

1313
orbs:
1414
aws-cli: circleci/[email protected]
15+
ruby: circleci/[email protected]
1516
# Using inline orb for now
1617
getting-started-smoke-test:
1718
orbs:
@@ -96,34 +97,31 @@ orbs:
9697
defaults: &defaults
9798
macos:
9899
xcode: '14.0.0'
99-
working_directory: ~/amplify-swift
100100
environment:
101-
BUNDLE_PATH: vendor/bundle
102-
103-
references:
104-
repo_cache_key: &repo_cache_key v2-repo-{{ .Branch }}-{{ .Revision }}
105-
106-
restore_repo: &restore_repo
107-
restore_cache:
108-
keys:
109-
- *repo_cache_key
110-
- v2-repo-{{ .Branch }}
111-
- v2-repo
101+
BUNDLE_JOBS: 4
102+
BUNDLE_RETRY: 3
112103

113104
commands:
114-
115-
restore_gems:
116-
steps:
117-
- restore_cache:
118-
keys:
119-
- v2-gems-{{ checksum "~/amplify-swift/Gemfile.lock" }}
120-
- v2-gems-
121-
122-
check_bundle:
105+
shallow_checkout:
123106
steps:
124107
- run:
125-
name: Check bundle
126-
command: bundle check --path $BUNDLE_PATH || bundle install --path $BUNDLE_PATH
108+
name: Checkout code shallow and change to working directory
109+
command: |
110+
git clone --depth 1 "$CIRCLE_REPOSITORY_URL" --branch "$CIRCLE_BRANCH" $CIRCLE_WORKING_DIRECTORY
111+
cd $CIRCLE_WORKING_DIRECTORY
112+
113+
if [ -n "$CIRCLE_TAG" ]; then
114+
echo 'Fetch tag'
115+
git fetch --depth 1 --force origin "+refs/tags/${CIRCLE_TAG}:refs/tags/${CIRCLE_TAG}"
116+
elif [[ $(echo $CIRCLE_PULL_REQUEST | grep -E "${CIRCLE_BRANCH}$") ]]; then
117+
echo 'Fetch pull request'
118+
git fetch --depth 1 --force origin "$CIRCLE_BRANCH/head:remotes/origin/$CIRCLE_BRANCH"
119+
else
120+
echo 'Fetch branch'
121+
git fetch --depth 1 --force origin "$CIRCLE_BRANCH:remotes/origin/$CIRCLE_BRANCH"
122+
fi
123+
echo "Checking out the CI HEAD"
124+
git reset --hard "$CIRCLE_SHA1"
127125
128126
make_artifacts_directory:
129127
steps:
@@ -137,44 +135,18 @@ commands:
137135
path: artifacts
138136

139137
jobs:
140-
checkout_code:
141-
<<: *defaults
142-
steps:
143-
- *restore_repo
144-
- checkout
145-
- save_cache:
146-
key: *repo_cache_key
147-
paths:
148-
- ~/amplify-swift
149-
150-
install_gems:
151-
<<: *defaults
152-
steps:
153-
- *restore_repo
154-
- restore_gems
155-
- run:
156-
name: Bundle install
157-
command: bundle check --path $BUNDLE_PATH || bundle install --path $BUNDLE_PATH
158-
environment:
159-
BUNDLE_JOBS: 4
160-
BUNDLE_RETRY: 3
161-
- save_cache:
162-
key: v2-gems-{{ checksum "~/amplify-swift/Gemfile.lock" }}
163-
paths:
164-
- vendor/bundle
165-
166138
build_amplify_ios_spm:
167139
<<: *defaults
168140
steps:
169-
- *restore_repo
141+
- shallow_checkout
170142
- make_artifacts_directory
171143
- run:
172144
name: Build amplify for ios SPM
173145
command: xcodebuild build -scheme Amplify-Package -sdk iphonesimulator -destination "<< pipeline.parameters.ios-destination >>" | tee "artifacts/build-Ampify-for-ios-SPM.log" | xcpretty
174146
build_amplify_macos_spm:
175147
<<: *defaults
176148
steps:
177-
- *restore_repo
149+
- shallow_checkout
178150
- make_artifacts_directory
179151
- run:
180152
name: Build amplify for macos SPM
@@ -194,7 +166,7 @@ jobs:
194166
type: string
195167
description: << parameters.scheme >> unit test
196168
steps:
197-
- *restore_repo
169+
- shallow_checkout
198170
- make_artifacts_directory
199171
- run:
200172
name: Build << parameters.scheme >>
@@ -204,20 +176,19 @@ jobs:
204176
command: xcodebuild test -scheme <<parameters.scheme>> -sdk << parameters.sdk >> -destination "<<parameters.destination>>" | tee "artifacts/test-<< parameters.scheme >>-<< parameters.sdk >>.log" | xcpretty --simple --color --report junit
205177
- run:
206178
name: Upload << parameters.scheme >> coverage report to Codecov
207-
command: bash ~/amplify-swift/build-support/codecov.sh -F << parameters.scheme >>_unit_test -J '^<< parameters.scheme >>$'
179+
command: bash $CIRCLE_WORKING_DIRECTORY/build-support/codecov.sh -F << parameters.scheme >>_unit_test -J '^<< parameters.scheme >>$'
208180
- store_test_results:
209181
path: build/reports
210182
- upload_artifacts
211183

212184
generate_api_docs:
213185
<<: *defaults
214186
steps:
215-
- *restore_repo
216-
- restore_gems
217-
- check_bundle
187+
- shallow_checkout
188+
- ruby/install-deps
218189
- run:
219190
name: Jazzy API doc generation
220-
command: bash ~/amplify-swift/CircleciScripts/jazzy_doc_gen.sh
191+
command: bash $CIRCLE_WORKING_DIRECTORY/CircleciScripts/jazzy_doc_gen.sh
221192

222193
deploy:
223194
<<: *defaults
@@ -230,18 +201,17 @@ jobs:
230201
- add_ssh_keys:
231202
fingerprints:
232203
- '3f:b4:9f:aa:0b:d7:c5:16:fb:44:44:35:cb:a7:70:e0'
233-
- *restore_repo
234-
- restore_gems
235-
- check_bundle
204+
- checkout
205+
- ruby/install-deps
236206
- run:
237207
name: Release Amplify for Swift
238208
command: bundle exec fastlane << parameters.lane >>
239209
no_output_timeout: 60m
240-
210+
241211
fortify_scan:
242212
<<: *defaults
243213
steps:
244-
- *restore_repo
214+
- shallow_checkout
245215
- run:
246216
name: Make source directory
247217
command: |
@@ -269,8 +239,8 @@ jobs:
269239
name: Run Installer
270240
command: |
271241
Fortify_SCA_and_Apps_22.1.1_osx_x64.app/Contents/MacOS/installbuilder.sh --mode unattended --installdir Fortify --InstallSamples 0 --fortify_license_path fortify.license --MigrateSCA 0
272-
export PATH=~/amplify-swift/Fortify/bin:$PATH
273-
echo "export PATH=~/amplify-swift/Fortify/bin:\$PATH" >> "$BASH_ENV"
242+
export PATH=$CIRCLE_WORKING_DIRECTORY/Fortify/bin:$PATH
243+
echo "export PATH=$CIRCLE_WORKING_DIRECTORY/Fortify/bin:\$PATH" >> "$BASH_ENV"
274244
fortifyupdate -acceptKey
275245
sourceanalyzer -version
276246
- run:
@@ -309,21 +279,15 @@ workflows:
309279
not:
310280
equal: [ scheduled_pipeline, << pipeline.trigger_source >> ]
311281
jobs:
312-
- checkout_code
313-
- install_gems:
314-
requires:
315-
- checkout_code
316282
- fortify_scan:
317283
context:
318284
- amplify-swift-aws-s3-download
319-
requires:
320-
- install_gems
321285
- build_amplify_ios_spm:
322286
requires:
323287
- fortify_scan
324288
- build_amplify_macos_spm:
325289
requires:
326-
- fortify_scan
290+
- fortify_scan
327291
- unit_test:
328292
name: ios_unit_test_amplify
329293
scheme: Amplify
@@ -456,7 +420,7 @@ workflows:
456420
filters:
457421
branches:
458422
only:
459-
- main
423+
- main
460424
- deploy:
461425
name: deploy stable
462426
lane: release
@@ -489,4 +453,4 @@ workflows:
489453
- getting-started-smoke-test/ios:
490454
xcode-version: "13.4.1"
491455
simulator-os-version: "15.5"
492-
simulator-device: "iPhone 13 Pro"
456+
simulator-device: "iPhone 13 Pro"

.swiftpm/xcode/xcshareddata/xcschemes/Amplify-Package.xcscheme

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,20 @@
342342
ReferencedContainer = "container:">
343343
</BuildableReference>
344344
</BuildActionEntry>
345+
<BuildActionEntry
346+
buildForTesting = "YES"
347+
buildForRunning = "YES"
348+
buildForProfiling = "YES"
349+
buildForArchiving = "YES"
350+
buildForAnalyzing = "YES">
351+
<BuildableReference
352+
BuildableIdentifier = "primary"
353+
BlueprintIdentifier = "AWSPredictionsPlugin"
354+
BuildableName = "AWSPredictionsPlugin"
355+
BlueprintName = "AWSPredictionsPlugin"
356+
ReferencedContainer = "container:">
357+
</BuildableReference>
358+
</BuildActionEntry>
345359
</BuildActionEntries>
346360
</BuildAction>
347361
<TestAction
@@ -495,6 +509,16 @@
495509
ReferencedContainer = "container:">
496510
</BuildableReference>
497511
</TestableReference>
512+
<TestableReference
513+
skipped = "NO">
514+
<BuildableReference
515+
BuildableIdentifier = "primary"
516+
BlueprintIdentifier = "AWSPredictionsPluginUnitTests"
517+
BuildableName = "AWSPredictionsPluginUnitTests"
518+
BlueprintName = "AWSPredictionsPluginUnitTests"
519+
ReferencedContainer = "container:">
520+
</BuildableReference>
521+
</TestableReference>
498522
</Testables>
499523
</TestAction>
500524
<LaunchAction

Amplify/Categories/Storage/Operation/Request/StorageDownloadDataRequest.swift

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,36 +7,58 @@
77

88
import Foundation
99

10+
/// Represents a request to download an individual object as `Data`, initiated by an implementation of the
11+
/// [StorageCategoryPlugin](x-source-tag://StorageCategoryPlugin) protocol.
12+
///
13+
/// - Tag: StorageDownloadDataRequest
1014
public struct StorageDownloadDataRequest: AmplifyOperationRequest {
15+
1116
/// The unique identifier for the object in storage
17+
///
18+
/// - Tag: StorageDownloadDataRequest.key
1219
public let key: String
1320

1421
/// Options to adjust the behavior of this request, including plugin-options
22+
///
23+
/// - Tag: StorageDownloadDataRequest.options
1524
public let options: Options
1625

26+
/// - Tag: StorageDownloadDataRequest.key
1727
public init(key: String, options: Options) {
1828
self.key = key
1929
self.options = options
2030
}
2131
}
2232

2333
public extension StorageDownloadDataRequest {
34+
2435
/// Options to adjust the behavior of this request, including plugin-options
36+
///
37+
/// - Tag: StorageDownloadDataRequestOptions
2538
struct Options {
39+
2640
/// Access level of the storage system. Defaults to `public`
41+
///
42+
/// - Tag: StorageDownloadDataRequestOptions.accessLevel
2743
public let accessLevel: StorageAccessLevel
2844

2945
/// Target user to apply the action on.
46+
///
47+
/// - Tag: StorageDownloadDataRequestOptions.targetIdentityId
3048
public let targetIdentityId: String?
3149

3250
/// Extra plugin specific options, only used in special circumstances when the existing options do not provide
3351
/// a way to utilize the underlying storage system's functionality. See plugin documentation for expected
3452
/// key/values
53+
///
54+
/// - Tag: StorageDownloadDataRequestOptions.pluginOptions
3555
public let pluginOptions: Any?
3656

3757
// TODO: transferAcceleration should be in pluginOptions
3858
// https://docs.aws.amazon.com/AmazonS3/latest/dev/transfer-acceleration.html
3959

60+
///
61+
/// - Tag: StorageDownloadDataRequestOptions.init
4062
public init(accessLevel: StorageAccessLevel = .guest,
4163
targetIdentityId: String? = nil,
4264
pluginOptions: Any? = nil) {

Amplify/Categories/Storage/Operation/Request/StorageDownloadFileRequest.swift

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,28 @@
77

88
import Foundation
99

10+
/// Represents a request to download an individual object as a file, initiated by an implementation of the
11+
/// [StorageCategoryPlugin](x-source-tag://StorageCategoryPlugin) protocol.
12+
///
13+
/// - Tag: StorageDownloadFileRequest
1014
public struct StorageDownloadFileRequest: AmplifyOperationRequest {
15+
1116
/// The unique identifier for the object in storage
17+
///
18+
/// - Tag: StorageDownloadFileRequest.key
1219
public let key: String
1320

1421
/// The local file to download the object to
22+
///
23+
/// - Tag: StorageDownloadFileRequest.local
1524
public let local: URL
1625

1726
/// Options to adjust the behavior of this request, including plugin options
27+
///
28+
/// - Tag: StorageDownloadFileRequest.options
1829
public let options: Options
1930

31+
/// - Tag: StorageDownloadFileRequest.init
2032
public init(key: String, local: URL, options: Options) {
2133
self.key = key
2234
self.local = local
@@ -25,19 +37,30 @@ public struct StorageDownloadFileRequest: AmplifyOperationRequest {
2537
}
2638

2739
public extension StorageDownloadFileRequest {
40+
2841
/// Options to adjust the behavior of this request, including plugin-options
42+
///
43+
/// - Tag: StorageDownloadFileRequestOptions
2944
struct Options {
45+
3046
/// Access level of the storage system. Defaults to `public`
47+
///
48+
/// - Tag: StorageDownloadFileRequestOptions.accessLevel
3149
public let accessLevel: StorageAccessLevel
3250

3351
/// Target user to apply the action on.
52+
///
53+
/// - Tag: StorageDownloadFileRequestOptions.targetIdentityId
3454
public let targetIdentityId: String?
3555

3656
/// Extra plugin specific options, only used in special circumstances when the existing options do not provide
3757
/// a way to utilize the underlying storage system's functionality. See plugin documentation for expected
3858
/// key/values
59+
///
60+
/// - Tag: StorageDownloadFileRequestOptions.pluginOptions
3961
public let pluginOptions: Any?
4062

63+
/// - Tag: StorageDownloadFileRequestOptions.init
4164
public init(accessLevel: StorageAccessLevel = .guest,
4265
targetIdentityId: String? = nil,
4366
pluginOptions: Any? = nil) {

0 commit comments

Comments
 (0)