Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .buildkite/release-pipelines/start-code-freeze.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ steps:
install_gems

echo '--- :shipit: Start code freeze'
bundle exec fastlane start_code_freeze skip_confirm:true
bundle exec fastlane start_code_freeze version:"${RELEASE_VERSION}" skip_confirm:true
retry:
manual:
# If failed, we prefer retrying via ReleaseV2 rather than Buildkite.
Expand Down
30 changes: 24 additions & 6 deletions fastlane/lanes/release.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,36 @@
# Lanes related to the Release Process (Code Freeze, Betas, Final Build, App Store Submission…)

platform :android do
desc 'Creates a new release branch from the current default branch'
lane :start_code_freeze do |skip_prechecks: false, skip_confirm: false|
# Creates a new release branch from the current default branch
#
# @param [String] version (optional) The version to use for the new release version to code freeze for.
# Typically auto-provided by ReleasesV2. If nil, computes the new version based on current one.
# @param [Boolean] skip_prechecks (default: false) If set, will skip prechecks
# @param [Boolean] skip_confirm (default: false) If set, will skip the confirmation prompt
#
lane :start_code_freeze do |version: nil, skip_prechecks: false, skip_confirm: false|
ensure_git_status_clean unless skip_prechecks || is_ci

Fastlane::Helper::GitHelper.checkout_and_pull(DEFAULT_BRANCH)

new_version_with_beta = release_version_for_code_freeze
new_version_final = release_version_next
computed_version = release_version_next
new_build_code = build_code_next
computed_release_branch_name = release_branch_name(release_version: new_version_final)

# Use provided version from release tool, or fall back to computed version
new_version = version || computed_version
computed_release_branch_name = release_branch_name(release_version: new_version)

# Warn if provided version differs from computed version
if version && version != computed_version
warning_message = <<~WARNING
⚠️ Version mismatch: The explicitly-provided version was '#{version}' while new computed version would have been '#{computed_version}'.
If this is unexpected, you might want to investigate the discrepency.
Continuing with the explicitly-provided verison '#{version}'.
WARNING
UI.important(warning_message)
buildkite_annotate(style: 'warning', context: 'start-code-freeze-version-mismatch', message: warning_message) if is_ci
end

message = <<~MESSAGE
Code Freeze:
Expand All @@ -37,8 +57,6 @@
version_code: new_build_code
)
commit_version_bump

new_version = release_version_current
UI.success("Done! New beta version: #{new_version}. New build code: #{build_code_current}.")

extract_release_notes_for_version(
Expand Down