Skip to content

[Tooling] Push Hotfix branch as soon as it's created #11617

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -378,18 +378,22 @@ platform :android do
UI.user_error!("Version #{previous_version} is not tagged! A hotfix branch cannot be created.") unless git_tag_exists(tag: previous_version)

# Create the hotfix branch
UI.message 'Creating hotfix branch...'
UI.message('Creating hotfix branch...')
Fastlane::Helper::GitHelper.create_branch("release/#{new_version}", from: previous_version)
UI.success("Done! New hotfix branch is: #{git_branch}")

# Bump the hotfix version and build code and write it to the `version.properties` file
UI.message 'Bumping hotfix version and build code...'
UI.message('Bumping hotfix version and build code...')
VERSION_FILE.write_version(
version_name: new_version,
version_code: version_code_new
)
commit_version_bump
UI.success("Done! New Release Version: #{release_version_current}. New Build Code: #{build_code_current}")

UI.important('Pushing new hotfix branch to remote...')

push_to_git_remote(tags: false)
end

#####################################################################################
Expand All @@ -412,13 +416,11 @@ platform :android do

hotfix_version = release_version_current

UI.important("Pushing changes to remote and triggering hotfix build for version: #{hotfix_version}")
UI.important("Triggering hotfix build for version: #{hotfix_version}")
unless options[:skip_confirm] || UI.confirm('Do you want to continue?')
UI.user_error!("Terminating as requested. Don't forget to run the remainder of this automation manually.")
end

push_to_git_remote(tags: false)

trigger_release_build(branch_to_build: "release/#{hotfix_version}")

# Retrieve the current non-hotfix release version
Expand Down
Loading