Skip to content

Commit b1a42b0

Browse files
committed
Follow up to release updates: add hotfix validation and remove unused parameters
1 parent 1d85989 commit b1a42b0

File tree

2 files changed

+19
-13
lines changed

2 files changed

+19
-13
lines changed

fastlane/Fastfile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,6 @@ Dotenv.load(PROJECT_ENV_FILE_PATH)
5151
GITHUB_REPO = 'wordpress-mobile/wordpress-iOS'
5252
DEFAULT_BRANCH = 'trunk'
5353
PUBLIC_CONFIG_FILE = File.join(PROJECT_ROOT_FOLDER, 'config', 'Version.public.xcconfig')
54-
# Unfortunately, ios_current_branch_is_hotfix relies on this ENV var under the hood.
55-
# We can't get rid of it just yet.
56-
ENV['PUBLIC_CONFIG_FILE'] = PUBLIC_CONFIG_FILE
5754
INTERNAL_CONFIG_FILE = File.join(PROJECT_ROOT_FOLDER, 'config', 'Version.internal.xcconfig')
5855
ENV['FASTLANE_WWDR_USE_HTTP1_AND_RETRIES'] = 'true'
5956

@@ -129,6 +126,13 @@ def release_version_next
129126
VERSION_FORMATTER.release_version(next_calculated_release_version)
130127
end
131128

129+
def release_is_hotfix?
130+
# Read the current release version from the .xcconfig file and parse it into an AppVersion object
131+
current_version = VERSION_FORMATTER.parse(VERSION_FILE.read_release_version)
132+
# Calculate and return whether the release version is a hotfix
133+
VERSION_CALCULATOR.release_is_hotfix?(version: current_version)
134+
end
135+
132136
# Returns the current build code of the app
133137
#
134138
def build_code_current

fastlane/lanes/release.rb

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@
232232
UI.user_error!('Aborted by user request') unless skip_user_confirmation || UI.confirm('Do you want to continue?')
233233

234234
generate_strings_file_for_glotpress
235-
download_localized_strings_and_metadata(options)
235+
download_localized_strings_and_metadata
236236
lint_localizations(allow_retry: skip_user_confirmation == false)
237237

238238
bump_build_codes
@@ -381,17 +381,19 @@
381381
end
382382
end
383383

384-
# Finalizes a release at the end of a sprint to submit to the App Store
384+
# Finalizes a release at the end of a sprint to submit to the App Store, triggering the final release build on CI
385385
#
386-
# - Updates store metadata
387-
# - Bumps final version number
388-
# - Removes branch protection and close milestone
389-
# - Triggers the final release on CI
386+
# This lane performs the following actions:
387+
# - Updates store metadata
388+
# - Bumps final version number
389+
# - Removes branch protection and closes milestone
390+
# - Triggers the final release on CI
390391
#
391-
# @option [Boolean] skip_confirm (default: false) If true, avoids any interactive prompt
392+
# @param skip_confirm [Boolean] Whether to skip confirmation prompts
392393
#
393-
desc 'Trigger the final release build on CI'
394-
lane :finalize_release do |options, skip_confirm: false|
394+
lane :finalize_release do |skip_confirm: false|
395+
UI.user_error!('To finalize a hotfix, please use the `finalize_hotfix_release` lane instead') if release_is_hotfix?
396+
395397
ensure_git_branch_is_release_branch!
396398
ensure_git_status_clean
397399

@@ -400,7 +402,7 @@
400402

401403
check_all_translations(interactive: skip_confirm == false)
402404

403-
download_localized_strings_and_metadata(options)
405+
download_localized_strings_and_metadata
404406
lint_localizations(allow_retry: skip_confirm == false)
405407

406408
bump_build_codes

0 commit comments

Comments
 (0)