-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathFastfile
120 lines (99 loc) · 3.71 KB
/
Fastfile
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
default_platform(:ios)
platform :ios do
desc "Update version and build number (e.g. add `version:1.2.3` after lane name)"
lane :update do |options|
# Setting build number to amount of all commits in repo
build = sh("git rev-list --all --count").chomp.strip
# Updating build number in all targets
increment_build_number_in_xcodeproj(
build_number: build,
target: 'ForPDA'
)
increment_build_number_in_xcodeproj(
build_number: build,
target: 'ShareExtension'
)
increment_build_number_in_xcodeproj(
build_number: build,
target: 'OpenInAppExtension'
)
# If version is not specified when calling this lane then use current one instead
version = options.fetch(:version, get_version_number_from_xcodeproj)
increment_version_number_in_xcodeproj(
version_number: version,
target: 'ForPDA'
)
increment_version_number_in_xcodeproj(
version_number: version,
target: 'OpenInAppExtension'
)
end
#----------------------------------------------------------------------------------
desc "Push new build to TestFlight (has version option to update marketing version)"
lane :beta do |options|
# Setting build number to amount of all commits in repo
build = sh("git rev-list --all --count").chomp.strip
# Updating build number in all targets
increment_build_number_in_xcodeproj(
build_number: build,
target: 'ForPDA'
)
increment_build_number_in_xcodeproj(
build_number: build,
target: 'OpenInAppExtension'
)
# If version is not specified when calling this lane then use current one instead
version = options.fetch(:version, get_version_number_from_xcodeproj)
increment_version_number_in_xcodeproj(
version_number: version,
target: 'ForPDA'
)
increment_version_number_in_xcodeproj(
version_number: version,
target: 'OpenInAppExtension'
)
output_name = "ForPDA_#{version}"
build_app(
scheme: "ForPDA",
output_directory: "build/",
output_name: output_name,
cloned_source_packages_path: "SourcePackages",
silent: true,
suppress_xcode_output: true,
export_method: "app-store",
export_options: {
provisioningProfiles: {
"com.subvert.forpda" => "com.subvert.forpda AppStore",
"com.subvert.forpda.OpenInAppExtension" => "com.subvert.forpda.OpenInAppExtension AppStore"
}
}
)
swift_file_path = "../Packages/Sources/AnalyticsClient/Secrets.swift"
swift_file_content = File.read(swift_file_path)
sentry_dsym_token = swift_file_content[/let sentryDSYMToken = "(.*?)"/, 1]
sentry_debug_files_upload(
auth_token: sentry_dsym_token,
org_slug: 'forpda',
project_slug: 'apple-ios',
include_sources: true
)
app_store_connect_api_key(
key_id: "X36R58TMRJ",
issuer_id: "814e488e-06ba-40ba-a16c-a63e7164023f",
key_filepath: "Fastlane/AuthKey_X36R58TMRJ.p8"
)
upload_to_testflight
notification(
subtitle: "Uploading Finished!",
message: "Build is on TestFlight",
content_image: "Images/logo.png"
)
end
error do |lane, exception, options|
notification(
subtitle: "Error while executing #{lane}!",
message: "#{exception}",
content_image: "Images/logo.png"
)
end
end