Skip to content

Instantly share code, notes, and snippets.

@keeth
Created Aug 10, 2016
Embed
What would you like to do?
Programmatically/script release an iOS app with Spaceship
#!/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! 🎉"
@keeth
Copy link
Author

keeth commented Aug 10, 2016

gem install spaceship
FASTLANE_USER=my-apple-id@example.com ./release.rb com.mycompany.myapp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment