Created
August 10, 2016 05:54
-
-
Save keeth/b9465512e36580acb52ae800b34455e2 to your computer and use it in GitHub Desktop.
Programmatically/script release an iOS app with Spaceship
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'spaceship' | |
Spaceship::Tunes.login(ENV['FASTLANE_USER'], ENV['FASTLANE_PASSWORD']) | |
app_id = ARGV.shift | |
if app_id.nil? | |
abort('Usage: release.rb com.mycompany.myapp') | |
end | |
app = Spaceship::Tunes::Application.find(app_id) | |
if app.nil? | |
abort("Error: App #{app_id} not found") | |
end | |
version = app.edit_version | |
if version.nil? | |
abort("Error: Could not find an unreleased version of #{app.name}") | |
end | |
unless version.can_send_version_live | |
abort("Error: #{app.name} version #{version.version} is not eligible for release") | |
end | |
version.release! | |
puts "#{app.name} v#{version.version} released! 🎉" |
Author
keeth
commented
Aug 10, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment