diff --git a/.buildkite/release-pipelines/start-code-freeze.yml b/.buildkite/release-pipelines/start-code-freeze.yml index 719ea6e35..0fb2911aa 100644 --- a/.buildkite/release-pipelines/start-code-freeze.yml +++ b/.buildkite/release-pipelines/start-code-freeze.yml @@ -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. diff --git a/fastlane/lanes/release.rb b/fastlane/lanes/release.rb index 33f915704..aaa72881a 100644 --- a/fastlane/lanes/release.rb +++ b/fastlane/lanes/release.rb @@ -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: @@ -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(