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 @@ -12,7 +12,7 @@ steps:
install_gems

echo '--- :snowflake: Start Code Freeze'
bundle exec fastlane start_code_freeze skip_confirm:true
bundle exec fastlane start_code_freeze version:"${RELEASE_VERSION}" skip_confirm:true
agents:
queue: "tumblr-metal"
retry:
Expand Down
25 changes: 20 additions & 5 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -108,21 +108,38 @@ platform :android do

# This lane executes the steps planned on code freeze, creating a new release branch from the current trunk.
#
# @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_confirm (default: false) If set, will skip the confirmation prompt before running the rest of the lane
#
# @example Running the lane
# bundle exec fastlane start_code_freeze skip_confirm:true
#
lane :start_code_freeze do |skip_confirm: false|
lane :start_code_freeze do |version: nil, skip_confirm: false|
ensure_git_status_clean

# Check out the up-to-date default branch, the designated starting point for the code freeze
Fastlane::Helper::GitHelper.checkout_and_pull(DEFAULT_BRANCH)

# Use provided version from release tool, or fall back to computed version
computed_version = release_version_next
new_version = version || computed_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:
• New release branch from #{DEFAULT_BRANCH}: release/#{release_version_next}
• New release branch from #{DEFAULT_BRANCH}: release/#{new_version}
• Current release version and build code: #{release_version_current} (#{build_code_current}).
• New beta version and build code: #{beta_version_first} (#{build_code_next}).

Expand All @@ -132,7 +149,7 @@ platform :android do
UI.user_error!("Terminating as requested. Don't forget to run the remainder of this automation manually.") unless skip_confirm || UI.confirm('Do you want to continue?')

# Create the release branch
new_release_branch = "release/#{release_version_next}"
new_release_branch = "release/#{new_version}"
ensure_branch_does_not_exist!(new_release_branch)

UI.message 'Creating release branch...'
Expand All @@ -148,8 +165,6 @@ platform :android do
commit_version_bump
UI.success("Done! New Beta Version: #{version_name_current}. New Build Code: #{build_code_current}")

new_version = release_version_current

# Extract dev release notes to `fastlane/metadata/android/en-US/changelogs/default.txt`
extract_release_notes_for_version(
version: new_version,
Expand Down