|
14 | 14 | # Typically auto-provided by ReleasesV2. If nil, computes the new version based on current one. |
15 | 15 | # |
16 | 16 | lane :code_freeze do |skip_confirm: false, version: nil| |
17 | | - ensure_git_status_clean |
| 17 | + # ensure_git_status_clean |
18 | 18 |
|
19 | 19 | # Check out the up-to-date default branch, the designated starting point for the code freeze |
20 | | - Fastlane::Helper::GitHelper.checkout_and_pull(DEFAULT_BRANCH) |
21 | | - |
22 | | - # Use provided version from release tool, or fall back to computed version |
23 | | - computed_version = release_version_next |
24 | | - provided_version = version |
25 | | - new_version = provided_version || computed_version |
26 | | - |
27 | | - # Fail if provided version differs from computed version |
28 | | - if provided_version && provided_version != computed_version |
29 | | - error_message = <<~ERROR |
30 | | - ❌ Version mismatch detected! |
31 | | -
|
32 | | - The explicitly-provided version from the release tool is '#{provided_version}' but the computed version from the codebase is '#{computed_version}'. |
| 20 | + # Fastlane::Helper::GitHelper.checkout_and_pull(DEFAULT_BRANCH) |
33 | 21 |
|
34 | | - This mismatch must be resolved before proceeding with the code freeze. Please investigate and ensure the versions are aligned. |
35 | | - ERROR |
36 | | - buildkite_annotate(style: 'error', context: 'code-freeze-version-mismatch', message: error_message) if is_ci |
37 | | - UI.user_error!(error_message) |
38 | | - end |
| 22 | + # If a new version is passed, use it as source of truth from now on |
| 23 | + new_version = version || release_version_next |
| 24 | + release_branch_name = compute_release_branch_name(options: { version: new_version, skip_confirm: skip_confirm }, version: new_version) |
| 25 | + new_build_code = build_code_code_freeze(version_short: new_version) |
39 | 26 |
|
40 | | - release_branch_name = compute_release_branch_name(options: { version: version, skip_confirm: skip_confirm }, version: new_version) |
41 | 27 | ensure_branch_does_not_exist!(release_branch_name) |
42 | 28 |
|
43 | 29 | # The `release_version_next` is used as the `new internal release version` value because the external and internal |
44 | 30 | # release versions are always the same. |
45 | 31 | message = <<~MESSAGE |
46 | 32 | Code Freeze: |
47 | | - • New release branch from #{DEFAULT_BRANCH}: #{release_branch_name} |
48 | | -
|
49 | 33 | • Current release version and build code: #{release_version_current} (#{build_code_current}). |
50 | | - • New release version and build code: #{new_version} (#{build_code_code_freeze}). |
| 34 | + • New release branch from #{DEFAULT_BRANCH}: #{release_branch_name} |
| 35 | + • New release version and build code: #{new_version} (#{new_build_code}). |
51 | 36 | MESSAGE |
52 | 37 |
|
53 | 38 | UI.important(message) |
|
61 | 46 | # Bump the release version and build code and write it to the `xcconfig` file |
62 | 47 | UI.message 'Bumping release version and build code...' |
63 | 48 | PUBLIC_VERSION_FILE.write( |
64 | | - version_short: release_version_next, |
65 | | - version_long: build_code_code_freeze |
| 49 | + version_short: new_version, |
| 50 | + version_long: new_build_code |
66 | 51 | ) |
67 | 52 | UI.success "Done! New Release Version: #{release_version_current}. New Build Code: #{build_code_current}" |
68 | 53 |
|
|
0 commit comments