From 4c5b4a1e19b60838a290db3fb3fc673747f7a6ee Mon Sep 17 00:00:00 2001 From: Ian Guedes Maia Date: Sun, 29 Jan 2023 21:04:17 +0100 Subject: [PATCH 1/4] Remove Deliverfile related functionality and references --- .../actions/ios/ios_bump_version_beta.rb | 2 +- .../actions/ios/ios_bump_version_hotfix.rb | 19 +------------ .../actions/ios/ios_bump_version_release.rb | 13 +-------- .../helper/ios/ios_git_helper.rb | 6 +---- .../helper/ios/ios_version_helper.rb | 14 ---------- spec/ios_bump_version_release_spec.rb | 27 ++++--------------- 6 files changed, 9 insertions(+), 72 deletions(-) diff --git a/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_bump_version_beta.rb b/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_bump_version_beta.rb index 3d91cbd07..36016085a 100644 --- a/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_bump_version_beta.rb +++ b/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_bump_version_beta.rb @@ -15,7 +15,7 @@ def self.run(params) Fastlane::Helper::Ios::VersionHelper.update_xc_configs(@new_beta_version, @short_version, @new_internal_version) UI.message 'Done!' - Fastlane::Helper::Ios::GitHelper.commit_version_bump(include_deliverfile: false) + Fastlane::Helper::Ios::GitHelper.commit_version_bump() end ##################################################### diff --git a/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_bump_version_hotfix.rb b/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_bump_version_hotfix.rb index 1774ba4fa..71cabe795 100644 --- a/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_bump_version_hotfix.rb +++ b/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_bump_version_hotfix.rb @@ -9,18 +9,11 @@ def self.run(params) create_config(params[:previous_version], params[:version]) show_config() - update_deliverfile = params[:skip_deliver] == false - if update_deliverfile - UI.message 'Updating Fastlane deliver file...' - Fastlane::Helper::Ios::VersionHelper.update_fastlane_deliver(@new_short_version) - UI.message 'Done!' - end - UI.message 'Updating XcConfig...' Fastlane::Helper::Ios::VersionHelper.update_xc_configs(@new_version, @new_short_version, @new_version_internal) UI.message 'Done!' - Fastlane::Helper::Ios::GitHelper.commit_version_bump(include_deliverfile: update_deliverfile) + Fastlane::Helper::Ios::GitHelper.commit_version_bump() UI.message 'Done.' end @@ -51,16 +44,6 @@ def self.available_options description: 'The version to branch from', is_string: true ), - FastlaneCore::ConfigItem.new( - key: :skip_deliver, - env_name: 'FL_IOS_BUMP_VERSION_HOTFIX_SKIP_DELIVER', - description: 'Skips Deliverfile key update', - is_string: false, # Boolean parameter - optional: true, - # Don't skip the Deliverfile by default. At the time of writing, 2 out of 3 consumers - # still have a Deliverfile. - default_value: false - ), ] end diff --git a/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_bump_version_release.rb b/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_bump_version_release.rb index 986c037f7..0f71931ce 100644 --- a/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_bump_version_release.rb +++ b/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_bump_version_release.rb @@ -21,17 +21,11 @@ def self.run(params) Fastlane::Helper::GitHelper.create_branch(@new_release_branch, from: default_branch) UI.message 'Done!' - UI.message 'Updating Fastlane deliver file...' unless params[:skip_deliver] - Fastlane::Helper::Ios::VersionHelper.update_fastlane_deliver(@new_short_version) unless params[:skip_deliver] - UI.message 'Done!' unless params[:skip_deliver] - UI.message 'Updating XcConfig...' Fastlane::Helper::Ios::VersionHelper.update_xc_configs(@new_version, @new_short_version, @new_version_internal) UI.message 'Done!' - Fastlane::Helper::Ios::GitHelper.commit_version_bump( - include_deliverfile: !params[:skip_deliver] - ) + Fastlane::Helper::Ios::GitHelper.commit_version_bump() UI.message 'Done.' end @@ -50,11 +44,6 @@ def self.details def self.available_options [ - FastlaneCore::ConfigItem.new(key: :skip_deliver, - env_name: 'FL_IOS_CODEFREEZE_BUMP_SKIPDELIVER', - description: 'Skips Deliver key update', - type: Boolean, - default_value: false), FastlaneCore::ConfigItem.new(key: :default_branch, env_name: 'FL_RELEASE_TOOLKIT_DEFAULT_BRANCH', description: 'Default branch of the repository', diff --git a/lib/fastlane/plugin/wpmreleasetoolkit/helper/ios/ios_git_helper.rb b/lib/fastlane/plugin/wpmreleasetoolkit/helper/ios/ios_git_helper.rb index d37dc3310..659ffc27d 100644 --- a/lib/fastlane/plugin/wpmreleasetoolkit/helper/ios/ios_git_helper.rb +++ b/lib/fastlane/plugin/wpmreleasetoolkit/helper/ios/ios_git_helper.rb @@ -8,15 +8,11 @@ module GitHelper # # This typically commits and pushes: # - The files in `./config/*` – especially `Version.*.xcconfig` files - # - The `fastlane/Deliverfile` file (which contains the `app_version` line) # # @env PROJECT_ROOT_FOLDER The path to the git root of the project # - # @param [Bool] include_deliverfile If true (the default), includes the `fastlane/Deliverfile` in files being commited - # - def self.commit_version_bump(include_deliverfile: true) + def self.commit_version_bump files_list = [File.join(get_from_env!(key: 'PROJECT_ROOT_FOLDER'), 'config', '.')] - files_list.append File.join('fastlane', 'Deliverfile') if include_deliverfile Fastlane::Helper::GitHelper.commit(message: 'Bump version number', files: files_list, push: true) end diff --git a/lib/fastlane/plugin/wpmreleasetoolkit/helper/ios/ios_version_helper.rb b/lib/fastlane/plugin/wpmreleasetoolkit/helper/ios/ios_version_helper.rb index dd98e2962..b1d7f2e4a 100644 --- a/lib/fastlane/plugin/wpmreleasetoolkit/helper/ios/ios_version_helper.rb +++ b/lib/fastlane/plugin/wpmreleasetoolkit/helper/ios/ios_version_helper.rb @@ -215,20 +215,6 @@ def self.bump_version_release return verified_version end - # Updates the `app_version` entry in the `Deliverfile` - # - # @param [String] new_version The new value to set the `app_version` entry to. - # @raise [UserError] If the Deliverfile was not found. - # - def self.update_fastlane_deliver(new_version) - fd_file = './fastlane/Deliverfile' - if File.exist?(fd_file) - Action.sh("sed -i '' \"s/app_version.*/app_version \\\"#{new_version}\\\"/\" #{fd_file}") - else - UI.user_error!("Can't find #{fd_file}.") - end - end - # Update the `.xcconfig` files (the public one, and the internal one if it exists) with the new version strings. # # @env PUBLIC_CONFIG_FILE The path to the xcconfig file containing the public version numbers. diff --git a/spec/ios_bump_version_release_spec.rb b/spec/ios_bump_version_release_spec.rb index 421158e5b..10089ba72 100644 --- a/spec/ios_bump_version_release_spec.rb +++ b/spec/ios_bump_version_release_spec.rb @@ -11,34 +11,17 @@ other_action_mock = double() allow(Fastlane::Action).to receive(:other_action).and_return(other_action_mock) allow(other_action_mock).to receive(:ensure_git_branch).with(branch: default_branch) - - allow(Fastlane::Helper::GitHelper).to receive(:checkout_and_pull).with(default_branch) - allow(Fastlane::Helper::GitHelper).to receive(:create_branch).with("release/#{next_version_short}", from: default_branch) - allow(Fastlane::Helper::Ios::VersionHelper).to receive(:read_from_config_file).and_return(version) - allow(Fastlane::Helper::Ios::VersionHelper).to receive(:update_xc_configs).with(next_version, next_version_short, nil) - end - - it 'does the fastlane deliver update' do - skip_deliver = false - - expect(Fastlane::Helper::Ios::VersionHelper).to receive(:update_fastlane_deliver).with(next_version_short) - expect(Fastlane::Helper::Ios::GitHelper).to receive(:commit_version_bump).with(include_deliverfile: !skip_deliver) - - run_described_fastlane_action( - skip_deliver: skip_deliver, - default_branch: default_branch - ) end - it 'skips the fastlane deliver update properly' do - skip_deliver = true + it 'correctly uses the next version, short and long' do + expect(Fastlane::Helper::GitHelper).to receive(:checkout_and_pull).with(default_branch) + expect(Fastlane::Helper::GitHelper).to receive(:create_branch).with("release/#{next_version_short}", from: default_branch) - expect(Fastlane::Helper::Ios::VersionHelper).not_to receive(:update_fastlane_deliver) - expect(Fastlane::Helper::Ios::GitHelper).to receive(:commit_version_bump).with(include_deliverfile: !skip_deliver) + expect(Fastlane::Helper::Ios::VersionHelper).to receive(:update_xc_configs).with(next_version, next_version_short, nil) + expect(Fastlane::Helper::Ios::GitHelper).to receive(:commit_version_bump) run_described_fastlane_action( - skip_deliver: skip_deliver, default_branch: default_branch ) end From 5066134ad0211351252ea51b7262717033f7c5dc Mon Sep 17 00:00:00 2001 From: Ian Guedes Maia Date: Mon, 30 Jan 2023 00:24:41 +0100 Subject: [PATCH 2/4] Update changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e9140abad..1d229c860 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ - Remove the `skip_glotpress` parameter from the `ios_bump_version_release` action [#443] - Add the `public_version_xcconfig_file` parameter to the `ios_get_app_version` action to replace the need for an environment variable [#445] - Remove the `ios_localize_project` and `ios_update_metadata` actions [#447] +- Remove the `skip_deliver` parameter from the `ios_bump_version_hotfix` action +- Remove the `skip_deliver` parameter from the `ios_bump_version_release` action ### New Features From 5a5b09fdb172092dc8de43b5ed2b607c74178107 Mon Sep 17 00:00:00 2001 From: Ian Guedes Maia Date: Fri, 10 Feb 2023 19:41:09 +0100 Subject: [PATCH 3/4] Update CHANGELOG.md Co-authored-by: Olivier Halligon --- CHANGELOG.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d229c860..d27004239 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,8 +9,7 @@ - Remove the `skip_glotpress` parameter from the `ios_bump_version_release` action [#443] - Add the `public_version_xcconfig_file` parameter to the `ios_get_app_version` action to replace the need for an environment variable [#445] - Remove the `ios_localize_project` and `ios_update_metadata` actions [#447] -- Remove the `skip_deliver` parameter from the `ios_bump_version_hotfix` action -- Remove the `skip_deliver` parameter from the `ios_bump_version_release` action +- Remove the `skip_deliver` parameter from `ios_bump_version_hotfix` and `ios_bump_version_release` actions ### New Features From 8eeea6555caae92fd60d9a7ce7a1be4b842e7a08 Mon Sep 17 00:00:00 2001 From: Ian Guedes Maia Date: Fri, 10 Feb 2023 19:52:50 +0100 Subject: [PATCH 4/4] Update PR reference on change log --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d27004239..8dd9924cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ - Remove the `skip_glotpress` parameter from the `ios_bump_version_release` action [#443] - Add the `public_version_xcconfig_file` parameter to the `ios_get_app_version` action to replace the need for an environment variable [#445] - Remove the `ios_localize_project` and `ios_update_metadata` actions [#447] -- Remove the `skip_deliver` parameter from `ios_bump_version_hotfix` and `ios_bump_version_release` actions +- Remove the `skip_deliver` parameter from `ios_bump_version_hotfix` and `ios_bump_version_release` actions [#450] ### New Features