From 9a91dde6ed4b32b21bf82bcef9e6d6f852ada9b2 Mon Sep 17 00:00:00 2001 From: Kieran Date: Sun, 24 Nov 2024 01:12:49 +1100 Subject: [PATCH] remove version --- .../actions/start_new_release_action.rb | 2 +- .../helper/ddg_apple_automation_helper.rb | 7 +++++-- lib/fastlane/plugin/ddg_apple_automation/version.rb | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/fastlane/plugin/ddg_apple_automation/actions/start_new_release_action.rb b/lib/fastlane/plugin/ddg_apple_automation/actions/start_new_release_action.rb index aa13c47..f6eaffa 100644 --- a/lib/fastlane/plugin/ddg_apple_automation/actions/start_new_release_action.rb +++ b/lib/fastlane/plugin/ddg_apple_automation/actions/start_new_release_action.rb @@ -18,7 +18,7 @@ def self.run(params) if params[:is_hotfix] release_branch_name, new_version = Helper::DdgAppleAutomationHelper.prepare_hotfix_branch( - params[:platform], params[:version], other_action, options + params[:github_token], params[:platform], other_action, options ) else release_branch_name, new_version = Helper::DdgAppleAutomationHelper.prepare_release_branch( diff --git a/lib/fastlane/plugin/ddg_apple_automation/helper/ddg_apple_automation_helper.rb b/lib/fastlane/plugin/ddg_apple_automation/helper/ddg_apple_automation_helper.rb index 330c397..9712870 100644 --- a/lib/fastlane/plugin/ddg_apple_automation/helper/ddg_apple_automation_helper.rb +++ b/lib/fastlane/plugin/ddg_apple_automation/helper/ddg_apple_automation_helper.rb @@ -133,8 +133,11 @@ def self.prepare_release_branch(platform, version, other_action) return release_branch_name, new_version end - def self.prepare_hotfix_branch(platform, version, other_action, options) - UI.user_error!("You must provide a version you want to hotfix.") unless version + def self.prepare_hotfix_branch(github_token, platform, other_action, options) + client = Octokit::Client.new(access_token: github_token) + latest_public_release = client.latest_release(Helper::GitHelper.repo_name(platform)) + version = latest_public_release.tag_name + UI.user_error!("Unable to find latest release to hotfix") unless version source_version = validate_version_exists(version) new_version = validate_hotfix_version(source_version) release_branch_name = create_hotfix_branch(platform, source_version, new_version) diff --git a/lib/fastlane/plugin/ddg_apple_automation/version.rb b/lib/fastlane/plugin/ddg_apple_automation/version.rb index f999a04..1bfdfec 100644 --- a/lib/fastlane/plugin/ddg_apple_automation/version.rb +++ b/lib/fastlane/plugin/ddg_apple_automation/version.rb @@ -1,5 +1,5 @@ module Fastlane module DdgAppleAutomation - VERSION = "0.12.0" + VERSION = "0.12.1" end end