Skip to content

Commit

Permalink
Remove unused publish Rake namespace (#941)
Browse files Browse the repository at this point in the history
Removing the old publish Rake tasks namespace.
We now use mono for publishing so this is no longer needed.
  • Loading branch information
tombruijn committed Apr 4, 2023
1 parent 1cba9d2 commit 5673a2c
Showing 1 changed file with 0 additions and 84 deletions.
84 changes: 0 additions & 84 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -253,90 +253,6 @@ namespace :build do
end
end

namespace :publish do
# rubocop:disable Lint/ConstantDefinitionInBlock
VERSION_FILE = "lib/appsignal/version.rb"
CHANGELOG_FILE = "CHANGELOG.md"
# rubocop:enable Lint/ConstantDefinitionInBlock

def changes
git_status_to_array(`git status -s -u`)
end

def git_status_to_array(changes)
changes.split("\n").each { |change| change.gsub!(/^.. /, "") }
end

def current_branch
`git rev-parse --abbrev-ref HEAD`.chomp
end

task :check_requirements do
unless changes.empty?
puts "ERROR: There should be no uncommitted file changes."
exit 1
end
unless ENV["EDITOR"]
puts "ERROR: $EDITOR environment variable should be set."
exit 1
end
end

task :configure_version do
puts "\n# Configuring new gem version"

system "$EDITOR #{VERSION_FILE}"
unless changes.member?(VERSION_FILE)
puts "ERROR: Please actually change the gem version in: #{VERSION_FILE}"
exit 1
end

puts "\n# Updating the changelog"
system "$EDITOR #{CHANGELOG_FILE}"
end

task :push_gem_packages do
puts "\n# Pushing gem packages"
Dir.chdir("#{File.dirname(__FILE__)}/pkg") do
Dir["*.gem"].each do |gem_package|
puts "## Publishing gem package: #{gem_package}"
result = system "gem push #{gem_package}"
raise "Failed to Push gem" unless result
end
end
end

task :tag_and_push_version do
# Make sure to load the new version number
Appsignal.send(:remove_const, :VERSION)
load File.expand_path(VERSION_FILE)
version = "v#{Appsignal::VERSION}"

begin
puts `git commit -am 'Bump to #{version} [ci skip]'`
puts "# Creating tag #{version}"
puts `git tag #{version}`
puts `git push origin #{version}`
puts `git push origin #{current_branch}`
rescue
puts "ERROR: Tag '#{version}' already exists"
exit 1
end
end

task :build => "build:clean" do
# Shell out to build so the new version is loaded in the gemspec.
`rake build:all`
end
end
task :publish => [
"publish:check_requirements",
"publish:configure_version",
"publish:build",
"publish:push_gem_packages",
"publish:tag_and_push_version"
]

desc "Install the AppSignal gem, extension and all possible dependencies."
task :install => "extension:install" do
Bundler.with_clean_env do
Expand Down

0 comments on commit 5673a2c

Please sign in to comment.