|
5 | 5 | platform :android do |
6 | 6 | # Creates a new release branch from the current default branch |
7 | 7 | # |
8 | | - # @param [String] version (optional) The version number for the release from the release tool. If not provided, uses the calculated version. |
| 8 | + # @param [String] version (optional) The version to use for the new release version to code freeze for. |
| 9 | + # Typically auto-provided by ReleasesV2. If nil, computes the new version based on current one. |
9 | 10 | # @param [Boolean] skip_prechecks (default: false) If set, will skip prechecks |
10 | 11 | # @param [Boolean] skip_confirm (default: false) If set, will skip the confirmation prompt |
11 | 12 | # |
|
15 | 16 | Fastlane::Helper::GitHelper.checkout_and_pull(DEFAULT_BRANCH) |
16 | 17 |
|
17 | 18 | new_version_with_beta = release_version_for_code_freeze |
18 | | - calculated_version = release_version_next |
| 19 | + computed_version = release_version_next |
19 | 20 | new_build_code = build_code_next |
20 | 21 |
|
21 | | - # Use provided version from release tool, or fall back to calculated version |
22 | | - release_version = version || calculated_version |
23 | | - computed_release_branch_name = release_branch_name(release_version: release_version) |
24 | | - |
25 | | - # Warn if provided version differs from calculated version |
26 | | - if version && version != calculated_version |
27 | | - warning_message = "⚠️ Version mismatch: Release tool version is '#{version}' but calculated version is '#{calculated_version}'. Using '#{version}' from release tool." |
| 22 | + # Use provided version from release tool, or fall back to computed version |
| 23 | + new_version = version || computed_version |
| 24 | + computed_release_branch_name = release_branch_name(release_version: new_version) |
| 25 | + |
| 26 | + # Warn if provided version differs from computed version |
| 27 | + if version && version != computed_version |
| 28 | + warning_message = <<~WARNING |
| 29 | + ⚠️ Version mismatch: The explicitly-provided version was '#{version}' while new computed version would have been '#{computed_version}'. |
| 30 | + If this is unexpected, you might want to investigate the discrepency. |
| 31 | + Continuing with the explicitly-provided verison '#{version}'. |
| 32 | + WARNING |
28 | 33 | UI.important(warning_message) |
29 | 34 | buildkite_annotate(style: 'warning', context: 'start-code-freeze-version-mismatch', message: warning_message) if is_ci |
30 | 35 | end |
|
52 | 57 | version_code: new_build_code |
53 | 58 | ) |
54 | 59 | commit_version_bump |
55 | | - |
56 | | - new_version = release_version_current |
57 | 60 | UI.success("Done! New beta version: #{new_version}. New build code: #{build_code_current}.") |
58 | 61 |
|
59 | 62 | extract_release_notes_for_version( |
|
0 commit comments