Skip to content
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

Use built-in command for bumpsnag updates #836

Merged
merged 1 commit into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .github/workflows/update-dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
- name: Install dependencies
run: bundle install

- run: bundle exec rake dependencies:update
- run: bundle exec bumpsnag update-submodule $TARGET_SUBMODULE $TARGET_VERSION

- name: List current branch name
id: current-branch
Expand Down
44 changes: 0 additions & 44 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ require 'fileutils'
require 'tmpdir'
require "json"

unless ENV['GITHUB_ACTIONS'].nil?
require "bumpsnag"
end

HOST_OS = RbConfig::CONFIG['host_os']
def is_mac?; HOST_OS =~ /darwin/i; end
def is_windows?; HOST_OS =~ /mingw|mswin|windows/i; end
Expand Down Expand Up @@ -705,43 +701,3 @@ namespace :test do
end
end
end

namespace :dependencies do
task :update do
target_submodule = ENV['TARGET_SUBMODULE']
target_version = ENV['TARGET_VERSION']

if target_submodule.nil? || target_version.nil?
raise 'Submodule or version targets not provided, exiting'
exit(1)
end

pp "Updating submodule: #{target_submodule} to version: #{target_version}"
updated = Bumpsnag.update_submodule(target_submodule, target_version)

if updated
local_info = Bumpsnag.get_git_info
target_info = Bumpsnag.get_git_info(target_submodule)

target_pr = local_info[:latest_pr] + 1
origin_repo = 'https://github.com/bugsnag/bugsnag-unity'
target_repo = target_info[:origin]

changelog_message = "Update #{target_submodule} to [#{target_version}](#{target_repo}/releases/tag/#{target_version}) [##{target_pr}](#{origin_repo}/pull/#{target_pr})"

Bumpsnag.add_changelog_entry(changelog_message, 'Dependencies')

release_branch = "bumpsnag-#{target_submodule}-#{target_version}"

commit_message = "Update #{target_submodule} to #{target_version} [full ci]"

Bumpsnag.change_branch(release_branch, true)
Bumpsnag.commit_changes(commit_message, [target_submodule, 'CHANGELOG.md'])
Bumpsnag.push_changes(release_branch)

pp 'Update complete'
else
pp "Nothing was updated"
end
end
end