Class: Deliver::Runner
- Inherits:
-
Object
- Object
- Deliver::Runner
- Defined in:
- lib/deliver/runner.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(options, skip_auto_detection = {}) ⇒ Runner
constructor
A new instance of Runner.
- #login ⇒ Object
- #run ⇒ Object
- #submit_for_review ⇒ Object
-
#upload_binary ⇒ Object
Upload the binary to iTunes Connect.
-
#upload_metadata ⇒ Object
Upload all metadata, screenshots, pricing information, etc.
-
#verify_version ⇒ Object
Make sure the version on iTunes Connect matches the one in the ipa If not, the new version will automatically be created.
Constructor Details
#initialize(options, skip_auto_detection = {}) ⇒ Runner
Returns a new instance of Runner.
5 6 7 8 9 10 |
# File 'lib/deliver/runner.rb', line 5 def initialize(, skip_auto_detection = {}) self. = login Deliver::DetectValues.new.run!(self., skip_auto_detection) FastlaneCore::PrintTable.print_values(config: , hide_keys: [:app], mask_keys: ['app_review_information.demo_password'], title: "deliver #{Deliver::VERSION} Summary") end |
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
3 4 5 |
# File 'lib/deliver/runner.rb', line 3 def @options end |
Instance Method Details
#login ⇒ Object
12 13 14 15 16 17 |
# File 'lib/deliver/runner.rb', line 12 def login UI.("Login to iTunes Connect (#{[:username]})") Spaceship::Tunes.login([:username]) Spaceship::Tunes.select_team UI.("Login successful") end |
#run ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/deliver/runner.rb', line 19 def run verify_version if [:app_version].to_s.length > 0 has_binary = ([:ipa] || [:pkg]) if ![:skip_binary_upload] && ![:build_number] && has_binary upload_binary end UI.success("Finished the upload to iTunes Connect") submit_for_review if [:submit_for_review] end |
#submit_for_review ⇒ Object
87 88 89 |
# File 'lib/deliver/runner.rb', line 87 def submit_for_review SubmitForReview.new.submit!() end |
#upload_binary ⇒ Object
Upload the binary to iTunes Connect
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/deliver/runner.rb', line 66 def upload_binary UI.("Uploading binary to iTunes Connect") if [:ipa] package_path = FastlaneCore::IpaUploadPackageBuilder.new.generate( app_id: [:app].apple_id, ipa_path: [:ipa], package_path: "/tmp" ) elsif [:pkg] package_path = FastlaneCore::PkgUploadPackageBuilder.new.generate( app_id: [:app].apple_id, pkg_path: [:pkg], package_path: "/tmp" ) end transporter = FastlaneCore::ItunesTransporter.new([:username], nil, false, [:itc_provider]) result = transporter.upload([:app].apple_id, package_path) UI.user_error!("Could not upload binary to iTunes Connect. Check out the error above", show_github_issues: true) unless result end |
#upload_metadata ⇒ Object
Upload all metadata, screenshots, pricing information, etc. to iTunes Connect
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/deliver/runner.rb', line 49 def # First, collect all the things for the HTML Report screenshots = UploadScreenshots.new.collect_screenshots() UploadMetadata.new.load_from_filesystem() UploadMetadata.new.assign_defaults() # Validate validate_html(screenshots) # Commit UploadMetadata.new.upload() UploadScreenshots.new.upload(, screenshots) UploadPriceTier.new.upload() UploadAssets.new.upload() # e.g. app icon end |
#verify_version ⇒ Object
Make sure the version on iTunes Connect matches the one in the ipa If not, the new version will automatically be created
35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/deliver/runner.rb', line 35 def verify_version app_version = [:app_version] UI.("Making sure the latest version on iTunes Connect matches '#{app_version}' from the ipa file...") changed = [:app].ensure_version!(app_version, platform: [:pkg] ? 'osx' : 'ios') if changed UI.success("Successfully set the version to '#{app_version}'") else UI.success("'#{app_version}' is the latest version on iTunes Connect") end end |