-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFastfile
More file actions
94 lines (81 loc) · 3.02 KB
/
Copy pathFastfile
File metadata and controls
94 lines (81 loc) · 3.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# This file contains the fastlane.tools configuration
# You can find the documentation at https://docs.fastlane.tools
#
# For a list of all available actions, check out
#
# https://docs.fastlane.tools/actions
#
# For a list of all available plugins, check out
#
# https://docs.fastlane.tools/plugins/available-plugins
#
# Uncomment the line if you want fastlane to automatically update itself
#update_fastlane
default_platform(:ios)
require 'shellwords'
require 'fileutils'
UITESTS_SCHEME_FOR_SCREENSHOTS = "WorkoutAppUITests"
# Кеш-директория: хранение в постоянном месте, чтобы __FILE__ и autoload
# в fastlane_common.rb работали корректно. Temp-директория не подходит —
# после её удаления require ломается.
SHARED_CACHE_DIR = File.expand_path("~/.cache/ios-fastlane-secrets")
def load_common_module
repo = "git@github.com:easydev991/ios-fastlane-secrets.git"
cache = SHARED_CACHE_DIR
FileUtils.mkdir_p(cache)
if File.directory?(File.join(cache, ".git"))
begin
sh("git -C #{Shellwords.escape(cache)} pull --ff-only")
rescue
UI.important("git pull failed, re-cloning ios-fastlane-secrets...")
FileUtils.rm_rf(cache)
sh("git clone --depth 1 #{repo} #{Shellwords.escape(cache)}")
end
else
FileUtils.rm_rf(cache) if File.exist?(cache)
sh("git clone --depth 1 #{repo} #{Shellwords.escape(cache)}")
end
common_path = File.join(cache, "fastlane_common.rb")
UI.user_error!("fastlane_common.rb не найден в ios-fastlane-secrets") unless File.exist?(common_path)
require common_path
end
load_common_module
platform :ios do
desc "Сгенерировать новые локализованные скриншоты"
lane :screenshots do
capture_screenshots(scheme: UITESTS_SCHEME_FOR_SCREENSHOTS)
end
desc "Загрузить существующие скриншоты в App Store Connect"
lane :upload_screenshots do
upload_to_app_store(
api_key: asc_key,
skip_metadata: true,
skip_screenshots: false,
force: true,
submit_for_review: false,
reject_if_possible: false,
overwrite_screenshots: true,
run_precheck_before_submit: false,
skip_binary_upload: true,
automatic_release: false
)
end
desc "Получить следующий номер сборки для отправки"
lane :get_next_build_number do
compute_next_build_number(
app_identifier: "com.oleg991.SW-Parks",
xcodeproj: "SwiftUI-WorkoutApp.xcodeproj"
)
end
desc "Собрать и отправить сборку в TestFlight"
lane :build_and_upload do
build_and_upload_app(
app_identifier: "com.oleg991.SW-Parks",
scheme: "SwiftUI-WorkoutApp",
xcodeproj: "SwiftUI-WorkoutApp.xcodeproj",
xcodeproj_for_version: "SwiftUI-WorkoutApp.xcodeproj",
gsp_path: File.expand_path("../SwiftUI-WorkoutApp/GoogleService-Info.plist", __dir__),
output_name: "SwiftUI-WorkoutApp"
)
end
end