Sha256: 159af9f18e6f645fa77bf7a82ae9cba9a50bba7a758521d5fcb73143980e780e
Contents?: true
Size: 1.19 KB
Versions: 8
Compression:
Stored size: 1.19 KB
Contents
task :publish do NAME = 'appsignal' VERSION_FILE = 'lib/appsignal/version.rb' raise '$EDITOR should be set' unless ENV['EDITOR'] def build_and_push_gem puts '# Building gem' puts `gem build #{NAME}.gemspec` puts '# Publishing Gem' puts `gem push #{NAME}-#{gem_version}.gem` end def create_and_push_tag 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 master` rescue raise "Tag: '#{version}' already exists" end end def changes git_status_to_array(`git status -s -u `) end def gem_version Appsignal::VERSION end def version @version ||= 'v' << gem_version end def git_status_to_array(changes) changes.split("\n").each { |change| change.gsub!(/^.. /,'') } end raise "Branch should hold no uncommitted file change)" unless changes.empty? system("$EDITOR #{VERSION_FILE}") if changes.member?(VERSION_FILE) load File.expand_path(VERSION_FILE) build_and_push_gem create_and_push_tag else raise "Actually change the version in: #{VERSION_FILE}" end end
Version data entries
8 entries across 8 versions & 1 rubygems