From afbd3e0967cf339da28b9f204a400579452b14ca Mon Sep 17 00:00:00 2001 From: Alex Moinet Date: Mon, 16 Sep 2024 09:45:20 +0100 Subject: [PATCH] Use built-in command for bumpsnag updates --- .github/workflows/update-dependencies.yml | 2 +- Rakefile | 44 ----------------------- 2 files changed, 1 insertion(+), 45 deletions(-) diff --git a/.github/workflows/update-dependencies.yml b/.github/workflows/update-dependencies.yml index 75d1f8bf1..a9343f6fa 100644 --- a/.github/workflows/update-dependencies.yml +++ b/.github/workflows/update-dependencies.yml @@ -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 diff --git a/Rakefile b/Rakefile index 456c7a2fb..e6b87e0f0 100644 --- a/Rakefile +++ b/Rakefile @@ -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 @@ -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