diff --git a/betabuilder.gemspec b/betabuilder.gemspec index 609e718..74195d0 100644 --- a/betabuilder.gemspec +++ b/betabuilder.gemspec @@ -23,17 +23,17 @@ Gem::Specification.new do |s| s.add_runtime_dependency(%q, ["~> 2.0.0"]) s.add_runtime_dependency(%q, ["~> 2.3.1"]) s.add_runtime_dependency(%q, ["~> 1.6.1"]) - s.add_runtime_dependency(%q, ["~> 1.4.6"]) + s.add_runtime_dependency(%q) else s.add_dependency(%q, ["~> 2.0.0"]) s.add_dependency(%q, ["~> 2.3.1"]) s.add_dependency(%q, ["~> 1.6.1"]) - s.add_dependency(%q, ["~> 1.4.6"]) + s.add_dependency(%q) end else s.add_dependency(%q, ["~> 2.0.0"]) s.add_dependency(%q, ["~> 2.3.1"]) s.add_dependency(%q, ["~> 1.6.1"]) - s.add_dependency(%q, ["~> 1.4.6"]) + s.add_dependency(%q) end end diff --git a/lib/beta_builder.rb b/lib/beta_builder.rb index 878a6a7..34aa8bc 100644 --- a/lib/beta_builder.rb +++ b/lib/beta_builder.rb @@ -32,7 +32,7 @@ def initialize(namespace = :beta, &block) def xcodebuild(*args) # we're using tee as we still want to see our build output on screen - system("#{@configuration.xcodebuild_path} #{args.join(" ")} | tee build.output") + system("#{@configuration.xcodebuild_path} #{args.join(" ")} | tee build.output; [ $PIPESTATUS -eq 0 ] || exit $PIPESTATUS") end class Configuration < OpenStruct diff --git a/lib/beta_builder/deployment_strategies/testflight.rb b/lib/beta_builder/deployment_strategies/testflight.rb index 41250aa..73c3b96 100644 --- a/lib/beta_builder/deployment_strategies/testflight.rb +++ b/lib/beta_builder/deployment_strategies/testflight.rb @@ -7,7 +7,7 @@ module BetaBuilder module DeploymentStrategies class TestFlight < Strategy ENDPOINT = "https://testflightapp.com/api/builds.json" - + def extended_configuration_for_strategy proc do def generate_release_notes(&block) @@ -15,13 +15,24 @@ def generate_release_notes(&block) end end end - + + def compress_generate_dsym + puts `zip -r -9 #{dsym_zip_path} #{@configuration.built_app_dsym_path}` + end + + def dsym_zip_path + puts "Compressing dsym file in #{@configuration.built_app_path}" + @configuration.built_app_dsym_path + ".zip" + end + def deploy release_notes = get_notes + compress_generate_dsym payload = { :api_token => @configuration.api_token, :team_token => @configuration.team_token, :file => File.new(@configuration.ipa_path, 'rb'), + :dsym => File.new(dsym_zip_path, 'rb'), :notes => release_notes, :distribution_lists => (@configuration.distribution_lists || []).join(","), :notify => @configuration.notify || false, @@ -32,32 +43,32 @@ def deploy puts "ipa path: #{@configuration.ipa_path}" puts "release notes: #{release_notes}" end - - if @configuration.dry_run + + if @configuration.dry_run puts '** Dry Run - No action here! **' return end - + begin response = RestClient.post(ENDPOINT, payload, :accept => :json) rescue => e response = e.response end - + if (response.code == 201) || (response.code == 200) puts "Upload complete." else puts "Upload failed. (#{response})" end end - + private - + def get_notes notes = @configuration.release_notes_text notes || get_notes_using_editor || get_notes_using_prompt end - + def get_notes_using_editor return unless (editor = ENV["EDITOR"]) @@ -70,12 +81,12 @@ def get_notes_using_editor rm_rf(dir) end end - + def get_notes_using_prompt puts "Enter the release notes for this build (hit enter twice when done):\n" @configuration.release_notes = gets_until_match(/\n{2}$/).strip end - + def gets_until_match(pattern, string = "") if (string += STDIN.gets) =~ pattern string