-
Notifications
You must be signed in to change notification settings - Fork 37
/
Fastfile_example
82 lines (70 loc) · 2.04 KB
/
Fastfile_example
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
fastlane_version "2.14.2"
default_platform :ios
platform :ios do
desc "Runs all the tests"
lane :test do
scan
end
desc "Runs all the UI tests"
lane :ui_tests do
scan(scheme: 'UITests')
end
desc "Build and send the release to Crashlytics for internal testing"
lane :release_dev do
ensure_git_status_clean
match(type: 'development')
increment_build_number
increment_version_number
commit_version_bump
custom_overlay
gym(configuration: 'Debug')
crashlytics(notes: release_notes)
reset_git_repo
end
desc "Test, Build and send a release to Testflight"
lane :release_testflight do
gym(configuration: 'Release')
testflight
end
desc "Generate Unit Test Code Coverage"
lane :code_coverage do
scan
xcov(scheme: 'MyScheme', only_project_targets: true)
end
desc "Update the version number for a new sprint"
lane :new_sprint do
ensure_git_status_clean
get_version_number
current_version = lane_context[SharedValues::VERSION_NUMBER]
version_array = current_version.split(".").map(&:to_i)
new_sprint_number = version_array[1] + 1
version_array[1] = new_sprint_number
version_array[2] = 0
new_version = version_array.join(".")
increment_version_number(
version_number: new_version
)
commit_version_bump
end
desc "Install developer certificates and provisioning profiles"
lane :install_certificates do
match(type: 'development')
end
desc "Generate a custom icon overlay"
private_lane :custom_overlay do
git_commit = last_git_commit[:abbreviated_commit_hash]
get_version_number
version_number = lane_context[SharedValues::VERSION_NUMBER]
badge(
shield: "#{version_number}-#{git_commit}-blue",
alpha: true
)
end
desc "Generate release notes"
private_lane :release_notes do
get_version_number
changelog = changelog_from_git_commits
version_number = lane_context[SharedValues::VERSION_NUMBER]
"Release notes #{version_number} Automatic build (Last 5 PR):\n#{changelog}"
end
end