xcode_fastlane 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 46465f027d4abedde9492947d81e3e558bd0db63543d953e8ef9ded3cee05a27
4
+ data.tar.gz: db0715165c9e2725625da2890f0913f18f6aece35c1d79d3e1ec73c509d308e2
5
+ SHA512:
6
+ metadata.gz: 90142dc93204308e199f962d2c9104b815d10ae6ac106c865e70ebccd00a23864647f06b384e2c23bfdfd9ab78fbb74e2ad2f05f7223aa56a4e8cee1effc4792
7
+ data.tar.gz: 1ad7d9f8460e7fbc4d618548b69ccb408a486367fed6d867f0e11deb9a2e39471ac5743928bd7c1de0e42e12944510f6725ca955ac28f63baa5757adcbfe0d67
data/.cz.yaml ADDED
@@ -0,0 +1,10 @@
1
+ ---
2
+ commitizen:
3
+ change_type_map:
4
+ feat: Features
5
+ fix: Bug fixes
6
+ name: cz_conventional_commits
7
+ tag_format: $version
8
+ update_changelog_on_bump: true
9
+ version_provider: commitizen-ruby
10
+ version_scheme: semver
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,430 @@
1
+ ---
2
+ require:
3
+ - rubocop-rake
4
+ - rubocop-rspec
5
+
6
+ AllCops:
7
+ TargetRubyVersion: 3
8
+ Exclude:
9
+ - fastlane/**/*
10
+ - templates/**/*
11
+
12
+ Capybara:
13
+ Enabled: false
14
+
15
+ FactoryBot:
16
+ Enabled: false
17
+
18
+ Gemspec/DeprecatedAttributeAssignment:
19
+ Enabled: true
20
+
21
+ Gemspec/DevelopmentDependencies:
22
+ Enabled: true
23
+
24
+ Gemspec/RequireMFA:
25
+ Enabled: true
26
+
27
+ Layout/LineContinuationLeadingSpace:
28
+ Enabled: true
29
+
30
+ Layout/LineContinuationSpacing:
31
+ Enabled: true
32
+
33
+ Layout/LineEndStringConcatenationIndentation:
34
+ Enabled: true
35
+
36
+ Layout/SpaceBeforeBrackets:
37
+ Enabled: true
38
+
39
+ Lint/AmbiguousAssignment:
40
+ Enabled: true
41
+
42
+ Lint/AmbiguousOperatorPrecedence:
43
+ Enabled: true
44
+
45
+ Lint/AmbiguousRange:
46
+ Enabled: true
47
+
48
+ Lint/ConstantOverwrittenInRescue:
49
+ Enabled: true
50
+
51
+ Lint/DeprecatedConstants:
52
+ Enabled: true
53
+
54
+ Lint/DuplicateBranch:
55
+ Enabled: true
56
+
57
+ Lint/DuplicateMagicComment:
58
+ Enabled: true
59
+
60
+ Lint/DuplicateMatchPattern:
61
+ Enabled: true
62
+
63
+ Lint/DuplicateRegexpCharacterClassElement:
64
+ Enabled: true
65
+
66
+ Lint/EmptyBlock:
67
+ Enabled: true
68
+
69
+ Lint/EmptyClass:
70
+ Enabled: true
71
+
72
+ Lint/EmptyInPattern:
73
+ Enabled: true
74
+
75
+ Lint/IncompatibleIoSelectWithFiberScheduler:
76
+ Enabled: true
77
+
78
+ Lint/ItWithoutArgumentsInBlock:
79
+ Enabled: true
80
+
81
+ Lint/LambdaWithoutLiteralBlock:
82
+ Enabled: true
83
+
84
+ Lint/LiteralAssignmentInCondition:
85
+ Enabled: true
86
+
87
+ Lint/MixedCaseRange:
88
+ Enabled: true
89
+
90
+ Lint/NoReturnInBeginEndBlocks:
91
+ Enabled: true
92
+
93
+ Lint/NonAtomicFileOperation:
94
+ Enabled: true
95
+
96
+ Lint/NumberedParameterAssignment:
97
+ Enabled: true
98
+
99
+ Lint/OrAssignmentToConstant:
100
+ Enabled: true
101
+
102
+ Lint/RedundantDirGlobSort:
103
+ Enabled: true
104
+
105
+ Lint/RedundantRegexpQuantifiers:
106
+ Enabled: true
107
+
108
+ Lint/RefinementImportMethods:
109
+ Enabled: true
110
+
111
+ Lint/RequireRangeParentheses:
112
+ Enabled: true
113
+
114
+ Lint/RequireRelativeSelfPath:
115
+ Enabled: true
116
+
117
+ Lint/SymbolConversion:
118
+ Enabled: true
119
+
120
+ Lint/ToEnumArguments:
121
+ Enabled: true
122
+
123
+ Lint/TripleQuotes:
124
+ Enabled: true
125
+
126
+ Lint/UnexpectedBlockArity:
127
+ Enabled: true
128
+
129
+ Lint/UnmodifiedReduceAccumulator:
130
+ Enabled: true
131
+
132
+ Lint/UselessRescue:
133
+ Enabled: true
134
+
135
+ Lint/UselessRuby2Keywords:
136
+ Enabled: true
137
+
138
+ Metrics/CollectionLiteralLength:
139
+ Enabled: true
140
+
141
+ Naming/BlockForwarding:
142
+ Enabled: true
143
+
144
+ RSpec/BeEmpty:
145
+ Enabled: true
146
+
147
+ RSpec/BeEq:
148
+ Enabled: true
149
+
150
+ RSpec/BeNil:
151
+ Enabled: true
152
+
153
+ RSpec/ChangeByZero:
154
+ Enabled: true
155
+
156
+ RSpec/ContainExactly:
157
+ Enabled: true
158
+
159
+ RSpec/DuplicatedMetadata:
160
+ Enabled: true
161
+
162
+ RSpec/EmptyMetadata:
163
+ Enabled: true
164
+
165
+ RSpec/EmptyOutput:
166
+ Enabled: true
167
+
168
+ RSpec/Eq:
169
+ Enabled: true
170
+
171
+ RSpec/ExcessiveDocstringSpacing:
172
+ Enabled: true
173
+
174
+ RSpec/IdenticalEqualityAssertion:
175
+ Enabled: true
176
+
177
+ RSpec/IndexedLet:
178
+ Enabled: true
179
+
180
+ RSpec/IsExpectedSpecify:
181
+ Enabled: true
182
+
183
+ RSpec/MatchArray:
184
+ Enabled: true
185
+
186
+ RSpec/MetadataStyle:
187
+ Enabled: true
188
+
189
+ RSpec/NoExpectationExample:
190
+ Enabled: true
191
+
192
+ RSpec/PendingWithoutReason:
193
+ Enabled: true
194
+
195
+ RSpec/ReceiveMessages:
196
+ Enabled: true
197
+
198
+ RSpec/RedundantAround:
199
+ Enabled: true
200
+
201
+ RSpec/RedundantPredicateMatcher:
202
+ Enabled: true
203
+
204
+ RSpec/RemoveConst:
205
+ Enabled: true
206
+
207
+ RSpec/RepeatedSubjectCall:
208
+ Enabled: true
209
+
210
+ RSpec/SkipBlockInsideExample:
211
+ Enabled: true
212
+
213
+ RSpec/SortMetadata:
214
+ Enabled: true
215
+
216
+ RSpec/SpecFilePathFormat:
217
+ Enabled: true
218
+
219
+ RSpec/SpecFilePathSuffix:
220
+ Enabled: true
221
+
222
+ RSpec/SubjectDeclaration:
223
+ Enabled: true
224
+
225
+ RSpec/UndescriptiveLiteralsDescription:
226
+ Enabled: true
227
+
228
+ RSpec/VerifiedDoubleReference:
229
+ Enabled: true
230
+
231
+ RSpecRails/AvoidSetupHook:
232
+ Enabled: true
233
+
234
+ RSpecRails/HaveHttpStatus:
235
+ Enabled: true
236
+
237
+ RSpecRails/InferredSpecType:
238
+ Enabled: true
239
+
240
+ RSpecRails/MinitestAssertions:
241
+ Enabled: true
242
+
243
+ RSpecRails/NegationBeValid:
244
+ Enabled: true
245
+
246
+ RSpecRails/TravelAround:
247
+ Enabled: true
248
+
249
+ Security/CompoundHash:
250
+ Enabled: true
251
+
252
+ Security/IoMethods:
253
+ Enabled: true
254
+
255
+ Style/ArgumentsForwarding:
256
+ Enabled: true
257
+
258
+ Style/ArrayIntersect:
259
+ Enabled: true
260
+
261
+ Style/CollectionCompact:
262
+ Enabled: true
263
+
264
+ Style/ComparableClamp:
265
+ Enabled: true
266
+
267
+ Style/ConcatArrayLiterals:
268
+ Enabled: true
269
+
270
+ Style/DataInheritance:
271
+ Enabled: true
272
+
273
+ Style/DirEmpty:
274
+ Enabled: true
275
+
276
+ Style/DocumentDynamicEvalDefinition:
277
+ Enabled: true
278
+
279
+ Style/EmptyHeredoc:
280
+ Enabled: true
281
+
282
+ Style/EndlessMethod:
283
+ Enabled: true
284
+
285
+ Style/EnvHome:
286
+ Enabled: true
287
+
288
+ Style/ExactRegexpMatch:
289
+ Enabled: true
290
+
291
+ Style/FetchEnvVar:
292
+ Enabled: true
293
+
294
+ Style/FileEmpty:
295
+ Enabled: true
296
+
297
+ Style/FileRead:
298
+ Enabled: true
299
+
300
+ Style/FileWrite:
301
+ Enabled: true
302
+
303
+ Style/HashConversion:
304
+ Enabled: true
305
+
306
+ Style/HashExcept:
307
+ Enabled: true
308
+
309
+ Style/IfWithBooleanLiteralBranches:
310
+ Enabled: true
311
+
312
+ Style/InPatternThen:
313
+ Enabled: true
314
+
315
+ Style/MagicCommentFormat:
316
+ Enabled: true
317
+
318
+ Style/MapCompactWithConditionalBlock:
319
+ Enabled: true
320
+
321
+ Style/MapIntoArray:
322
+ Enabled: true
323
+
324
+ Style/MapToHash:
325
+ Enabled: true
326
+
327
+ Style/MapToSet:
328
+ Enabled: true
329
+
330
+ Style/MinMaxComparison:
331
+ Enabled: true
332
+
333
+ Style/MultilineInPatternThen:
334
+ Enabled: true
335
+
336
+ Style/NegatedIfElseCondition:
337
+ Enabled: true
338
+
339
+ Style/NestedFileDirname:
340
+ Enabled: true
341
+
342
+ Style/NilLambda:
343
+ Enabled: true
344
+
345
+ Style/NumberedParameters:
346
+ Enabled: true
347
+
348
+ Style/NumberedParametersLimit:
349
+ Enabled: true
350
+
351
+ Style/ObjectThen:
352
+ Enabled: true
353
+
354
+ Style/OpenStructUse:
355
+ Enabled: true
356
+
357
+ Style/OperatorMethodCall:
358
+ Enabled: true
359
+
360
+ Style/QuotedSymbols:
361
+ Enabled: true
362
+
363
+ Style/RedundantArgument:
364
+ Enabled: true
365
+
366
+ Style/RedundantArrayConstructor:
367
+ Enabled: true
368
+
369
+ Style/RedundantConstantBase:
370
+ Enabled: true
371
+
372
+ Style/RedundantCurrentDirectoryInPath:
373
+ Enabled: true
374
+
375
+ Style/RedundantDoubleSplatHashBraces:
376
+ Enabled: true
377
+
378
+ Style/RedundantEach:
379
+ Enabled: true
380
+
381
+ Style/RedundantFilterChain:
382
+ Enabled: true
383
+
384
+ Style/RedundantHeredocDelimiterQuotes:
385
+ Enabled: true
386
+
387
+ Style/RedundantInitialize:
388
+ Enabled: true
389
+
390
+ Style/RedundantLineContinuation:
391
+ Enabled: true
392
+
393
+ Style/RedundantRegexpArgument:
394
+ Enabled: true
395
+
396
+ Style/RedundantRegexpConstructor:
397
+ Enabled: true
398
+
399
+ Style/RedundantSelfAssignmentBranch:
400
+ Enabled: true
401
+
402
+ Style/RedundantStringEscape:
403
+ Enabled: true
404
+
405
+ Style/ReturnNilInPredicateMethodDefinition:
406
+ Enabled: true
407
+
408
+ Style/SelectByRegexp:
409
+ Enabled: true
410
+
411
+ Style/SingleLineDoEndBlock:
412
+ Enabled: true
413
+
414
+ Style/StringChars:
415
+ Enabled: true
416
+
417
+ Style/StringLiterals:
418
+ EnforcedStyle: double_quotes
419
+
420
+ Style/StringLiteralsInInterpolation:
421
+ EnforcedStyle: double_quotes
422
+
423
+ Style/SuperWithArgsParentheses:
424
+ Enabled: true
425
+
426
+ Style/SwapValues:
427
+ Enabled: true
428
+
429
+ Style/YAMLFileRead:
430
+ Enabled: true
data/CHANGELOG.md ADDED
@@ -0,0 +1,7 @@
1
+ ## 1.0.0 (2024-05-14)
2
+
3
+ ### Features
4
+
5
+ - add creatiion of ci scripts for Xcode Cloud
6
+ - add helper methods for Appfile
7
+ - add script to initialize a new project
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2024 Karsten Silkenbäumer
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,34 @@
1
+ # Xcode Fastlane
2
+
3
+ Provides tools to easily manage `fastlane` for screenshot and metadata uploads,
4
+ when building on Xcode Cloud.
5
+
6
+ ## Installation
7
+
8
+ In order to run this command globally to initialize a project, install the gem globally.
9
+
10
+ ```shell
11
+ gem install xcode_fastlane
12
+ ```
13
+
14
+ ## Usage
15
+
16
+ First, initialize your xcode project directory.
17
+
18
+ ```shell
19
+ xcode_fastlane init
20
+ bundle install
21
+ ```
22
+
23
+ This will create a new `Gemfile`, `.gitignore`, the `fastlane` folder, and `ci_scripts` folder.
24
+
25
+ Next, adapt the files in the `fastlane` folder according to your needs and check the contents of the ci scripts.
26
+
27
+ ## Xcode Cloud Workflow Setup
28
+
29
+ - Create a new workflow
30
+ - Choose archive
31
+ - Add to environment variables all variables mentioned in the `Appfile` with proper values.
32
+ - You may want to run `bundle exec fastlane deliver` with proper values in order to download the existing metadata.
33
+
34
+ Now when this workflow runs, the screenshots will be generated and uploaded together with the metadata to AppStore Connect.
data/Rakefile ADDED
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rspec/core/rake_task"
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ require "rubocop/rake_task"
9
+
10
+ RuboCop::RakeTask.new
11
+
12
+ task default: %i[spec rubocop]
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ $LOAD_PATH.unshift(File.join(File.dirname(File.dirname(__FILE__))), "lib")
5
+ require "xcode_fastlane/cli"
6
+ XcodeFastlane::CLI.start(ARGV)
data/fastlane/Fastfile ADDED
@@ -0,0 +1,97 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Opt out from sending usage data
4
+ opt_out_usage
5
+
6
+ default_platform(:ios)
7
+
8
+ platform :ios do
9
+ # https://www.runway.team/blog/how-to-set-up-a-ci-cd-pipeline-for-your-ios-app-fastlane-github-actions
10
+ desc "Load AppStore Connect API Key information to use in subsequent lanes"
11
+ lane :load_api_key do
12
+ app_store_connect_api_key(
13
+ key_id: ENV.fetch("APPSTORE_CONNECT_API_KEY_ID", nil),
14
+ issuer_id: ENV.fetch("APPSTORE_CONNECT_API_KEY_ISSUER_ID", nil),
15
+ key_content: ENV.fetch("APPSTORE_CONNECT_API_KEY_P8", nil),
16
+ is_key_content_base64: true,
17
+ in_house: false # detecting this via AppStore Connect private key not currently supported
18
+ )
19
+ end
20
+
21
+ desc "Register app on Apple Developer Portal and AppStore Connect"
22
+ lane :register do
23
+ create_app_online( # produce
24
+ language: "en-US",
25
+ # com.example.AppName => com.example.apps.AppName.ios
26
+ sku: CredentialsManager::AppfileConfig.try_fetch_value(:app_identifier)
27
+ .split(".").insert(2, "apps").append("ios").join("."),
28
+ enable_services: {}
29
+ )
30
+ end
31
+
32
+ desc "Generate and upload new localized screenshots and metadata"
33
+ desc "Params: send_success: boolean, indicating whether to send a success message via slack"
34
+ lane :upload_appstore_data do |options|
35
+ capture_screenshots(scheme: ENV.fetch("IOS_SCHEME", nil))
36
+ load_api_key
37
+ register
38
+ upload_to_app_store( # deliver
39
+ skip_binary_upload: true,
40
+ skip_screenshots: false,
41
+ skip_metadata: false,
42
+ skip_app_version_update: false,
43
+ overwrite_screenshots: true,
44
+ force: true,
45
+ # Precheck cannot check In-app purchases with the App Store Connect API Key (yet).
46
+ precheck_include_in_app_purchases: false,
47
+ app_review_information: {
48
+ first_name: ENV.fetch("FASTLANE_REVIEW_FIRSTNAME", nil),
49
+ last_name: ENV.fetch("FASTLANE_REVIEW_LASTNAME", nil),
50
+ phone_number: ENV.fetch("FASTLANE_REVIEW_PHONE", nil),
51
+ email_address: ENV.fetch("FASTLANE_REVIEW_EMAIL", nil)
52
+ }
53
+ )
54
+ rescue StandardError => e
55
+ on_error(e)
56
+ raise
57
+ else
58
+ on_success("Data uploaded to AppStore Connect") if options[:send_success]
59
+ end
60
+ end
61
+
62
+ def on_success(message, **_props)
63
+ return unless ENV["FASTLANE_SLACK_URL"]
64
+
65
+ slack(
66
+ message: message,
67
+ success: true,
68
+ slack_url: ENV.fetch("FASTLANE_SLACK_URL", nil),
69
+ payload: {
70
+ "CI Build Number" => ENV.fetch("CI_BUILD_NUMBER", nil),
71
+ "CI Workflow" => ENV.fetch("CI_WORKFLOW", nil)
72
+ }
73
+ )
74
+ end
75
+
76
+ def on_error(exception)
77
+ return unless ENV["FASTLANE_SLACK_URL"]
78
+
79
+ slack(
80
+ message: "Build failed",
81
+ success: false,
82
+ slack_url: ENV.fetch("FASTLANE_SLACK_URL", nil),
83
+ payload: {
84
+ "CI Build Number" => ENV.fetch("CI_BUILD_NUMBER", nil),
85
+ "CI Workflow" => ENV.fetch("CI_WORKFLOW", nil)
86
+ },
87
+ attachment_properties: {
88
+ fields: [
89
+ {
90
+ title: "Error message",
91
+ value: exception.to_s,
92
+ short: false
93
+ }
94
+ ]
95
+ }
96
+ )
97
+ end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "thor"
4
+
5
+ module XcodeFastlane
6
+ # Command line interface for the thor tool.
7
+ class CLI < Thor
8
+ include Thor::Actions
9
+
10
+ def self.source_root
11
+ File.join(File.dirname(File.dirname(__FILE__)), "templates")
12
+ end
13
+
14
+ desc "init", "Initialize fastlane setup"
15
+ def init
16
+ copy_file ".gitignore"
17
+ copy_file "Gemfile"
18
+ copy_file "fastlane/Appfile"
19
+ copy_file "fastlane/Deliverfile"
20
+ copy_file "fastlane/Fastfile"
21
+ copy_file "fastlane/Snapfile"
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module XcodeFastlane
4
+ VERSION = "1.0.0"
5
+ end
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "xcode_fastlane/version"
4
+ require "xcodeproj"
5
+
6
+ # Main module for helper methods and CLI.
7
+ module XcodeFastlane
8
+ # Loads and returns the Xcode project file.
9
+ def self.project
10
+ @project ||= Xcodeproj::Project.open(Pathname.glob("../*.xcodeproj").first)
11
+ end
12
+
13
+ # Returns product bundle identifier for the given target or the first one found, if target_name is nil.
14
+ #
15
+ # Arguments:
16
+ # target_name: (String) The name of the target to fetch identifier from. Defaults to first target.
17
+ def self.product_bundle_id(target_name = nil)
18
+ scheme = project.native_targets.find { |target| !target_name || target.name == target_name }
19
+ build_configuration = scheme.build_configurations.first
20
+ build_configuration.build_settings["PRODUCT_BUNDLE_IDENTIFIER"]
21
+ end
22
+
23
+ # Returns the product name, retrieved from the application path.
24
+ def self.product_name
25
+ product = project.products.select { |p| p.explicit_file_type == "wrapper.application" }.first
26
+ product.path.split(".").first
27
+ end
28
+ end
@@ -0,0 +1,9 @@
1
+ module XcodeFastlane
2
+ VERSION: String
3
+
4
+ def self.project: () -> Xcodeproj
5
+
6
+ def self.product_bundle_id: (?String) -> String
7
+
8
+ def self.product_name: () -> String
9
+ end
@@ -0,0 +1,11 @@
1
+ # fastlane specific
2
+ **/fastlane/report.xml
3
+
4
+ # deliver temporary files
5
+ **/fastlane/Preview.html
6
+
7
+ # snapshot generated screenshots
8
+ **/fastlane/screenshots
9
+
10
+ # scan temporary files
11
+ **/fastlane/test_output
data/templates/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "fastlane"
6
+ gem "fastlane_files", git: "https://github.com/kassi/fastlane-files"
@@ -0,0 +1,20 @@
1
+ #!/bin/zsh
2
+
3
+ # Only run when the archive workflow runs.
4
+ # Adapt to your needs.
5
+ if [[ ! "$CI_XCODEBUILD_ACTION" = "archive" ]]; then exit 0; fi
6
+
7
+ set -euo pipefail
8
+ # set -e # Exit immediately on error
9
+ # set -u # Exit on undefined variables
10
+ # set -x # Print commands and their arguments as they are executed
11
+ # set -o pipefail # Exit on failures in piped commands.
12
+
13
+ brew install ruby
14
+
15
+ RUBY_PATH=$(brew --prefix ruby)/bin
16
+ export PATH="$RUBY_PATH:$PATH"
17
+ sed -i '' "s#PATH=:#PATH=:$RUBY_PATH:# " ~/zshrc
18
+
19
+ gem install bundler
20
+ bundle install
@@ -0,0 +1,11 @@
1
+ #!/bin/zsh
2
+
3
+ # Only run when the archive workflow runs.
4
+ # Adapt to your needs.
5
+ if [[ ! "$CI_XCODEBUILD_ACTION" = "archive" ]]; then exit 0; fi
6
+
7
+ RUBY_PATH=$(brew --prefix ruby)/bin
8
+ export PATH="$RUBY_PATH:$PATH"
9
+
10
+ cd ..
11
+ bundle exec fastlane upload_appstore_data
@@ -0,0 +1,35 @@
1
+ require "xcode_fastlane"
2
+
3
+ mandatory_environment = %w[
4
+ APPSTORE_CONNECT_API_KEY_ID
5
+ APPSTORE_CONNECT_API_KEY_ISSUER_ID
6
+ APPSTORE_CONNECT_API_KEY_P8
7
+ FASTLANE_REVIEW_EMAIL
8
+ FASTLANE_REVIEW_FIRSTNAME
9
+ FASTLANE_REVIEW_LASTNAME
10
+ FASTLANE_REVIEW_PHONE
11
+ FASTLANE_USER
12
+ ]
13
+ # Optional:
14
+ # FASTLANE_SLACK_URL
15
+ if ENV["CI"]
16
+ mandatory_environment += %w[
17
+ CI_BUILD_NUMBER
18
+ CI_BUNDLE_ID
19
+ CI_PRODUCT
20
+ CI_WORKFLOW
21
+ CI_XCODE_SCHEME
22
+ ]
23
+ end
24
+ mandatory_environment.each do |var|
25
+ ENV[var] or abort "Missing environment variable: #{var}"
26
+ end
27
+
28
+ app_identifier(ENV["CI_BUNDLE_ID"] || XcodeFastlane.product_bundle_id)
29
+ ENV["PRODUCT_NAME"] = ENV["CI_PRODUCT"] || XcodeFastlane.product_name
30
+ ENV["APP_NAME"] = ENV["PRODUCT_NAME"]
31
+ ENV["IOS_IPA_OUTPUT_NAME"] = ENV["PRODUCT_NAME"]
32
+ ENV["IOS_SCHEME"] = ENV["CI_XCODE_SCHEME"] || XcodeFastlane.product_name
33
+
34
+ # For more information about the Appfile, see:
35
+ # https://docs.fastlane.tools/advanced/#appfile
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ # The Deliverfile allows you to store various App Store Connect metadata
4
+ # For more information, check out the docs
5
+ # https://docs.fastlane.tools/actions/deliver/
6
+ username(ENV.fetch("FASTLANE_USER", nil))
7
+ languages(%w[en-US de-DE])
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ import_from_git(
4
+ url: "git@github.com:kassi/fastlane-files.git",
5
+ path: "shared/Fastfile"
6
+ )
@@ -0,0 +1,38 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Uncomment the lines below you want to change by removing the # in the beginning
4
+
5
+ # A list of devices you want to take the screenshots from
6
+ devices([
7
+ # "iPhone 8",
8
+ # "iPhone 8 Plus",
9
+ "iPhone SE (3rd generation)",
10
+ "iPhone 15 Pro Max"
11
+ # "iPhone X",
12
+ # "iPad Pro (12.9-inch)",
13
+ # "iPad Pro (9.7-inch)",
14
+ # "Apple TV 1080p",
15
+ # "Apple Watch Series 6 - 44mm"
16
+ ])
17
+
18
+ languages([
19
+ "en-US",
20
+ "de-DE"
21
+ # "it-IT",
22
+ # ["pt", "pt_BR"] # Portuguese with Brazilian locale
23
+ ])
24
+
25
+ # Where should the resulting screenshots be stored?
26
+ # output_directory("./screenshots")
27
+
28
+ # remove the '#' to clear all previously generated screenshots before creating new ones
29
+ clear_previous_screenshots(true)
30
+
31
+ # Remove the '#' to set the status bar to 9:41 AM, and show full battery and reception. See also override_status_bar_arguments for custom options.
32
+ override_status_bar(true)
33
+ localize_simulator(true)
34
+ # Arguments to pass to the app on launch. See https://docs.fastlane.tools/actions/snapshot/#launch-arguments
35
+ # launch_arguments(["-favColor red"])
36
+
37
+ # For more information about all available options run
38
+ # fastlane action snapshot
metadata ADDED
@@ -0,0 +1,98 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: xcode_fastlane
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Karsten Silkenbäumer
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2024-05-14 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: thor
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.3'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.3'
27
+ - !ruby/object:Gem::Dependency
28
+ name: xcodeproj
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.24'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.24'
41
+ description: Provides init script, templates and functions to be used within fastlane
42
+ files.
43
+ email:
44
+ - 993392+kassi@users.noreply.github.com
45
+ executables:
46
+ - xcode_fastlane
47
+ extensions: []
48
+ extra_rdoc_files: []
49
+ files:
50
+ - ".cz.yaml"
51
+ - ".rspec"
52
+ - ".rubocop.yml"
53
+ - CHANGELOG.md
54
+ - LICENSE.txt
55
+ - README.md
56
+ - Rakefile
57
+ - exe/xcode_fastlane
58
+ - fastlane/Fastfile
59
+ - lib/xcode_fastlane.rb
60
+ - lib/xcode_fastlane/cli.rb
61
+ - lib/xcode_fastlane/version.rb
62
+ - sig/xcode_fastlane.rbs
63
+ - templates/.gitignore
64
+ - templates/Gemfile
65
+ - templates/ci_scripts/ci_post_clone.sh
66
+ - templates/ci_scripts/ci_post_xcodebuild.sh
67
+ - templates/fastlane/Appfile
68
+ - templates/fastlane/Deliverfile
69
+ - templates/fastlane/Fastfile
70
+ - templates/fastlane/Snapfile
71
+ homepage: https://github.com/kassi/xcode_fastlane
72
+ licenses:
73
+ - MIT
74
+ metadata:
75
+ homepage_uri: https://github.com/kassi/xcode_fastlane
76
+ source_code_uri: https://github.com/kassi/xcode_fastlane
77
+ changelog_uri: https://github.com/kassi/xcode_fastlane/CHANGELOG.md
78
+ rubygems_mfa_required: 'true'
79
+ post_install_message:
80
+ rdoc_options: []
81
+ require_paths:
82
+ - lib
83
+ required_ruby_version: !ruby/object:Gem::Requirement
84
+ requirements:
85
+ - - ">="
86
+ - !ruby/object:Gem::Version
87
+ version: 3.0.0
88
+ required_rubygems_version: !ruby/object:Gem::Requirement
89
+ requirements:
90
+ - - ">="
91
+ - !ruby/object:Gem::Version
92
+ version: '0'
93
+ requirements: []
94
+ rubygems_version: 3.5.10
95
+ signing_key:
96
+ specification_version: 4
97
+ summary: Easy fastlane setup for xcode projects using Xcode Cloud builds.
98
+ test_files: []