This repository has been archived by the owner on Dec 29, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 48
/
Fastfile
100 lines (93 loc) · 2.45 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
fastlane_version "2.120.0"
default_platform :ios
platform :ios do
desc "Release a new version of KITPROJECT"
lane :release do |options|
# Ensure Git status is clean
ensure_git_status_clean
# Ensure Git branch is master
ensure_git_branch(branch: 'master')
# Perform Dependency-Manager compatibility tests
compatibilityTests
# Perform Tests
tests
# Retrieve Version from options
version = options[:version]
# Increment Version
increment(version: version)
# Add Git Tag
add_git_tag(tag: version)
# Push Git Tag
push_git_tags()
# Push Git commit
push_to_git_remote()
# Pod push / Pod trunk
pod_push()
end
desc "Increment Version"
lane :increment do |options|
# Retrieve Version from options
version = options[:version]
# Set Podspec version
version_bump_podspec(
path: "KITPROJECT.podspec",
version_number: version
)
# Set Framework plist version
set_info_plist_value(
path: "Configs/KITPROJECT.plist",
key: "CFBundleShortVersionString",
value: version
)
# Set Framework Tests plist version
set_info_plist_value(
path: "Configs/KITPROJECTTests.plist",
key: "CFBundleShortVersionString",
value: version
)
# Set Example plist version
set_info_plist_value(
path: "Example/Resources/Info.plist",
key: "CFBundleShortVersionString",
value: version
)
# Commit modified files
git_commit(
path: [
"KITPROJECT.podspec",
"Configs/KITPROJECT.plist",
"Configs/KITPROJECTTests.plist",
"Example/Resources/Info.plist"
],
message: "KITPROJECT Version #{version} 🚀"
)
end
desc "Runs tests"
lane :tests do
# Perform iOS Tests
scan(
project: "KITPROJECT.xcodeproj",
scheme: "KITPROJECT-iOS",
clean: true
)
# Perform tvOS Tests
scan(
project: "KITPROJECT.xcodeproj",
scheme: "KITPROJECT-tvOS",
clean: true
)
# Perform macOS Tests
spm(command: "test")
# Delete SPM build artifacts
spm(command: "clean")
end
desc "Run Dependency-Manager compatibility tests"
lane :compatibilityTests do
# Pod lib lint to ensure CocoaPods compatibility
pod_lib_lint(allow_warnings: true)
# SPM Build to ensure Swift Package Manager compatibility
spm(command: "build")
# Delete SPM build artifacts
spm(command: "clean")
end
end