Skip to content

Commit bc9af29

Browse files
authored
Merge pull request #119 from wordpress-mobile/add-ios-code-freeze-split
Add ios code freeze split
2 parents 2add3b2 + 53662ac commit bc9af29

File tree

2 files changed

+130
-0
lines changed

2 files changed

+130
-0
lines changed
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
module Fastlane
2+
module Actions
3+
class IosCheckBetaDepsAction < Action
4+
def self.run(params)
5+
require_relative '../../helper/ios/ios_version_helper.rb'
6+
require_relative '../../helper/ios/ios_git_helper.rb'
7+
8+
beta_pods = []
9+
File.open(params[:podfile]).each do | li |
10+
beta_pods << li if (li.match('^\s*\t*pod.*beta'))
11+
end
12+
13+
if beta_pods.count == 0
14+
UI.message("No beta pods found. You can continue with the code freeze.")
15+
else
16+
message = "The following pods are still in beta:\n"
17+
beta_pods.each do | bpod |
18+
message << "#{bpod}\n"
19+
end
20+
message << "Please update to the released version before continuing with the code freeze."
21+
end
22+
UI.important(message)
23+
end
24+
25+
#####################################################
26+
# @!group Documentation
27+
#####################################################
28+
29+
def self.description
30+
"Runs some prechecks before finalizing a release"
31+
end
32+
33+
def self.details
34+
"Runs some prechecks before finalizing a release"
35+
end
36+
37+
def self.available_options
38+
[
39+
FastlaneCore::ConfigItem.new(key: :podfile,
40+
env_name: "FL_IOS_CHECKBETADEPS_PODFILE",
41+
description: "Path to the Podfile to analyse",
42+
is_string: true),
43+
]
44+
end
45+
46+
def self.output
47+
48+
end
49+
50+
def self.return_value
51+
""
52+
end
53+
54+
def self.authors
55+
["loremattei"]
56+
end
57+
58+
def self.is_supported?(platform)
59+
platform == :ios
60+
end
61+
end
62+
end
63+
end
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
module Fastlane
2+
module Actions
3+
class IosCompletecodefreezePrechecksAction < Action
4+
def self.run(params)
5+
UI.message "Skip confirm: #{params[:skip_confirm]}"
6+
7+
require_relative '../../helper/ios/ios_version_helper.rb'
8+
require_relative '../../helper/ios/ios_git_helper.rb'
9+
10+
UI.user_error!("This is not a release branch. Abort.") unless other_action.git_branch.start_with?("release/")
11+
12+
version = Fastlane::Helpers::IosVersionHelper::get_public_version
13+
message = "Completing code freeze for: #{version}\n"
14+
if (!params[:skip_confirm])
15+
if (!UI.confirm("#{message}Do you want to continue?"))
16+
UI.user_error!("Aborted by user request")
17+
end
18+
else
19+
UI.message(message)
20+
end
21+
22+
# Check local repo status
23+
other_action.ensure_git_status_clean()
24+
25+
version
26+
end
27+
28+
#####################################################
29+
# @!group Documentation
30+
#####################################################
31+
32+
def self.description
33+
"Runs some prechecks before finalizing a code freeze"
34+
end
35+
36+
def self.details
37+
"Runs some prechecks before finalizing a code freeze"
38+
end
39+
40+
def self.available_options
41+
[
42+
FastlaneCore::ConfigItem.new(key: :skip_confirm,
43+
env_name: "FL_IOS_COMPLETECODEFREEZE_PRECHECKS_SKIPCONFIRM",
44+
description: "Skips confirmation",
45+
is_string: false, # true: verifies the input is a string, false: every kind of value
46+
default_value: false) # the default value if the user didn't provide one
47+
]
48+
end
49+
50+
def self.output
51+
52+
end
53+
54+
def self.return_value
55+
56+
end
57+
58+
def self.authors
59+
["loremattei"]
60+
end
61+
62+
def self.is_supported?(platform)
63+
platform == :ios
64+
end
65+
end
66+
end
67+
end

0 commit comments

Comments
 (0)