This repository was archived by the owner on Sep 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 78
/
Copy pathFastfile
98 lines (81 loc) · 2.53 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
fastlane_version "1.86.0"
lane :release do |options|
if options[:skip_branch_check] != true
ensure_git_branch(branch: "master")
end
if options[:allow_dirty_branch] != true
ensure_git_status_clean
else
UI.message "Skipping the 'git status clean' check!".yellow
end
git_pull
runalltests
unless is_ci
notification(
title: "R.swift.Library release",
message: "💡 Needs your attention."
)
end
currentVersion = version_get_podspec()
UI.message "Current R.swift.Library podspec version is #{currentVersion}"
bumpType = prompt(text: "What kind of release is this? (major/minor/patch/custom)".green, boolean: false, ci_input: "")
isPrerelease = false
case bumpType
when "major", "minor", "patch"
version_bump_podspec(bump_type: bumpType)
when "custom"
newVersion = prompt(text: "What is the new custom version number?".green, boolean: false, ci_input: "")
version_bump_podspec(version_number: newVersion)
isPrerelease = prompt(text: "Is this a prerelease version?".green, boolean: true, ci_input: "")
else
raise "Invalid release type: #{bumpType}".red
end
changelog = prompt(text: "Please provide release notes:".green, boolean: false, ci_input: "", multi_line_end_keyword: "FIN")
newVersion = version_get_podspec()
unless prompt(text: "#{newVersion} has been prepped for release. If you have any additional changes you would like to make, please do those before continuing. Would you like to commit, tag, push and release #{newVersion} including all uncommitted changes?".green, boolean: true, ci_input:"y")
raise "Aborted by user".red
end
git_commit(
path: ".",
message: "Preparing for the #{newVersion} release"
)
push_to_git_remote
af_create_github_release(
owner: "mac-cain13",
repository: "r.swift.library",
tag_name: "v#{newVersion}",
target_commitish: "master",
name: "#{newVersion}",
body: "#{changelog}",
prerelease: isPrerelease
)
pod_push
unless is_ci
notification(
title: "R.swift.Library release",
message: "🎉 Version #{newVersion} is released."
)
end
end
lane :runalltests do
scan(
project: "R.swift.Library.xcodeproj",
scheme: "Rswift-iOS",
device: "iPhone 8",
clean: true
)
scan(
project: "R.swift.Library.xcodeproj",
scheme: "Rswift-tvOS",
device: "Apple TV 4K",
clean: true
)
end
error do |lane, exception|
unless is_ci
notification(
title: "R.swift.Library #{lane}",
message: "❌ Failed with an exception."
)
end
end