Skip to content

Commit

Permalink
Bump version to 4.0.0.rc5 and make the release script less human-erro…
Browse files Browse the repository at this point in the history
…r-prone.
  • Loading branch information
FooBarWidget committed Mar 11, 2013
1 parent a93f7c5 commit d886f34
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 67 deletions.
135 changes: 70 additions & 65 deletions build/packaging.rb
Expand Up @@ -23,8 +23,34 @@


task :clobber => 'package:clean' task :clobber => 'package:clean'


desc "Build the gem and tarball" desc "Build, sign & upload gem & tarball"
task 'package' => ['package:gem', 'package:tarball'] task 'package:release' => ['package:gem', 'package:tarball', 'package:sign'] do
require 'phusion_passenger'
basename = "#{PhusionPassenger::PACKAGE_NAME}-#{PhusionPassenger::VERSION_STRING}"
version = PhusionPassenger::VERSION_STRING
tag_prefix = (basename !~ /enterprise/) ? 'release' : 'enterprise'

sh "git tag -s #{tag_prefix}-#{version}"

puts "Proceed with pushing tag to Github and uploading the gem and signatures? [y/n]"
if STDIN.readline == "y\n"
sh "git push origin #{tag_prefix}-#{version}"
if basename !~ /enterprise/
sh "scp pkg/#{basename}.{gem.asc,tar.gz.asc} app@shell.phusion.nl:/u/apps/signatures/phusion-passenger/"
sh "gem push pkg/passenger-#{version}.gem"
puts "--------------"
puts "All done. Please upload pkg/passenger-#{version}.tar.gz " +
"to RubyForge and update the version number in the Phusion Passenger website."
else
dir = "/u/apps/passenger_website/shared"
subdir = string_option('NAME', version)
sh "scp pkg/#{basename}.{gem,tar.gz,gem.asc,tar.gz.asc} app@shell.phusion.nl:#{dir}/"
sh "ssh app@shell.phusion.nl 'mkdir -p \"#{dir}/assets/#{subdir}\" && mv #{dir}/#{basename}.{gem,tar.gz,gem.asc,tar.gz.asc} \"#{dir}/assets/#{subdir}/\"'"
end
else
puts "Did not upload anything."
end
end


task 'package:check' do task 'package:check' do
require 'phusion_passenger' require 'phusion_passenger'
Expand All @@ -35,16 +61,14 @@
end end
end end


desc "Build the gem" task 'package:gem' => Packaging::ASCII_DOCS + ['package:check'] do
task 'package:gem' => [:doc, 'package:check'] do
require 'phusion_passenger' require 'phusion_passenger'
sh "gem build #{PhusionPassenger::PACKAGE_NAME}.gemspec" sh "gem build #{PhusionPassenger::PACKAGE_NAME}.gemspec --sign --key 0x0A212A8C"
sh "mkdir -p pkg" sh "mkdir -p pkg"
sh "mv #{PhusionPassenger::PACKAGE_NAME}-#{PhusionPassenger::VERSION_STRING}.gem pkg/" sh "mv #{PhusionPassenger::PACKAGE_NAME}-#{PhusionPassenger::VERSION_STRING}.gem pkg/"
end end


desc "Build the tarball" task 'package:tarball' => Packaging::ASCII_DOCS + ['package:check'] do
task 'package:tarball' => [:doc, 'package:check'] do
require 'phusion_passenger' require 'phusion_passenger'
require 'fileutils' require 'fileutils'


Expand All @@ -69,11 +93,47 @@
sh "rm -rf pkg/#{basename}" sh "rm -rf pkg/#{basename}"
end end


desc "Remove gem and tarball" task 'package:sign' do
require 'phusion_passenger'

if File.exist?(File.expand_path("~/.gnupg/gpg-agent.conf")) || ENV['GPG_AGENT_INFO']
puts "It looks like you're using gpg-agent, so skipping automatically password caching."
else
begin
require 'highline'
rescue LoadError
abort "Please run `gem install highline` first."
end
h = HighLine.new
password = h.ask("Password for software-signing@phusion.nl GPG key: ") { |q| q.echo = false }
passphrase_opt = "--passphrase-file .gpg-password"
end

begin
if password
File.open(".gpg-password", "w", 0600) do |f|
f.write(password)
end
end
version = PhusionPassenger::VERSION_STRING
["passenger-#{version}.gem",
"passenger-#{version}.tar.gz",
"passenger-enterprise-server-#{version}.gem",
"passenger-enterprise-server-#{version}.tar.gz"].each do |name|
if File.exist?("pkg/#{name}")
sh "gpg --sign --detach-sign #{passphrase_opt} --local-user software-signing@phusion.nl --armor pkg/#{name}"
end
end
ensure
File.unlink('.gpg-password') if File.exist?('.gpg-password')
end
end

desc "Remove gem, tarball and signatures"
task 'package:clean' do task 'package:clean' do
require 'phusion_passenger' require 'phusion_passenger'
sh "rm -f #{PhusionPassenger::PACKAGE_NAME}-#{PhusionPassenger::VERSION_STRING}.gem" basename = "#{PhusionPassenger::PACKAGE_NAME}-#{PhusionPassenger::VERSION_STRING}"
sh "rm -f #{PhusionPassenger::PACKAGE_NAME}-#{PhusionPassenger::VERSION_STRING}.tar.gz" sh "rm -f pkg/#{basename}.{gem,gem.asc,tar.gz,tar.gz.asc}"
end end


desc "Create a fakeroot, useful for building native packages" desc "Create a fakeroot, useful for building native packages"
Expand Down Expand Up @@ -158,58 +218,3 @@


sh "debuild" sh "debuild"
end end

desc "Sign all packaged files"
task 'package:sign' => 'package:check' do
require 'phusion_passenger'
begin
require 'highline'
rescue LoadError
abort "Please run `gem install highline` first."
end
h = HighLine.new
password = h.ask("Password for software-signing@phusion.nl GPG key: ") { |q| q.echo = false }
begin
File.open(".gpg-password", "w", 0600) do |f|
f.write(password)
end
version = PhusionPassenger::VERSION_STRING
["passenger-#{version}.gem",
"passenger-#{version}.tar.gz",
"passenger-enterprise-server-#{version}.gem",
"passenger-enterprise-server-#{version}.tar.gz"].each do |name|
if File.exist?("pkg/#{name}")
sh "gpg --sign --detach-sign --passphrase-file .gpg-password --local-user software-signing@phusion.nl --armor pkg/#{name}"
end
end
ensure
File.unlink('.gpg-password') if File.exist?('.gpg-password')
end
end

desc "Upload packages and signatures"
task 'package:upload' => ['package', 'package:sign'] do
require 'phusion_passenger'
version = PhusionPassenger::VERSION_STRING

signatures = []
["passenger-#{version}.gem.asc",
"passenger-#{version}.tar.gz.asc",
"passenger-enterprise-server-#{version}.gem.asc",
"passenger-enterprise-server-#{version}.tar.gz.asc"].each do |name|
if File.exist?("pkg/#{name}")
signatures << "pkg/#{name}"
end
end
sh "scp #{signatures.join(' ')} app@shell.phusion.nl:/u/apps/signatures/phusion-passenger/"

if File.exist?("pkg/passenger-#{version}.gem")
sh "gem push pkg/passenger-#{version}.gem"
end

if File.exist?("pkg/passenger-#{version}.tar.gz")
puts "--------------"
puts "All done. Please upload pkg/passenger-#{version}.tar.gz " +
"to RubyForge and update the version number in the Phusion Passenger website."
end
end
2 changes: 1 addition & 1 deletion ext/common/Constants.h
Expand Up @@ -26,7 +26,7 @@
#define _PASSENGER_CONSTANTS_H_ #define _PASSENGER_CONSTANTS_H_


/* Don't forget to update lib/phusion_passenger.rb too. */ /* Don't forget to update lib/phusion_passenger.rb too. */
#define PASSENGER_VERSION "4.0.0.rc4" #define PASSENGER_VERSION "4.0.0.rc5"


#define FEEDBACK_FD 3 #define FEEDBACK_FD 3


Expand Down
2 changes: 1 addition & 1 deletion lib/phusion_passenger.rb
Expand Up @@ -31,7 +31,7 @@ module PhusionPassenger
PACKAGE_NAME = 'passenger' PACKAGE_NAME = 'passenger'


# Phusion Passenger version number. Don't forget to edit ext/common/Constants.h too. # Phusion Passenger version number. Don't forget to edit ext/common/Constants.h too.
VERSION_STRING = '4.0.0.rc4' VERSION_STRING = '4.0.0.rc5'


PREFERRED_NGINX_VERSION = '1.2.7' PREFERRED_NGINX_VERSION = '1.2.7'
PREFERRED_PCRE_VERSION = '8.31' PREFERRED_PCRE_VERSION = '8.31'
Expand Down

0 comments on commit d886f34

Please sign in to comment.