def upload
      # Login & Upload IPA with metadata using RSA key or username/password
      FastlaneCore::UI.message('upload...')

      if host.nil? || user.nil?
        FastlaneCore::UI.user_error('repo_url, repo_user and repo_pasdword or repo_key must be set on upload')
        return false
      end

      if rsa_keypath
        rsa_key = load_rsa_key(rsa_keypath)
        if rsa_key.nil?
          FastlaneCore::UI.user_error('Failed to load RSA key... ' + options[:rsa_keypath])
        end
      end

      success = false
      if !rsa_key.nil?
        FastlaneCore::UI.message('Logging in with RSA key...')
        Net::SSH.start(host, user, key_data: rsa_key, keys_only: true) do |ssh|
          FastlaneCore::UI.message('Uploading IPA & Manifest...')
          success = ssh_sftp_upload(ssh, ipa_path, manifest_path)
        end
      else
        FastlaneCore::UI.message('Logging in with username/password...')
        Net::SSH.start(host, user, password: password) do |ssh|
          FastlaneCore::UI.message('Uploading IPA & Manifest...')
          success = ssh_sftp_upload(ssh, ipa_path, manifest_path)
        end
      end
      success
    end
def upload
      # Login & Upload IPA with metadata using RSA key or username/password
      FastlaneCore::UI.message('upload...')

      if host.nil? || user.nil?
        FastlaneCore::UI.user_error('repo_url, repo_user and repo_pasdword or repo_key must be set on upload')
        return false
      end

      if rsa_keypath
        rsa_key = load_rsa_key(rsa_keypath)
        if rsa_key.nil?
          FastlaneCore::UI.user_error('Failed to load RSA key... ' + options[:rsa_keypath])
        end
      end

      success = false
      if !rsa_key.nil?
        FastlaneCore::UI.message('Logging in with RSA key...')
        Net::SSH.start(host, user, key_data: rsa_key, keys_only: true) do |ssh|
          FastlaneCore::UI.message('Uploading IPA & Manifest...')
          success = ssh_sftp_upload(ssh, ipa_path, manifest_path)
        end
      else
        FastlaneCore::UI.message('Logging in with username/password...')
        Net::SSH.start(host, user, password: password) do |ssh|
          FastlaneCore::UI.message('Uploading IPA & Manifest...')
          success = ssh_sftp_upload(ssh, ipa_path, manifest_path)
        end
      end
      success
    end
rubocop:disable Metrics/AbcSize
 rubocop:disable Metrics/MethodLength

 Upload IPA & manifest

 rubocop:disable Metrics/AbcSize
 rubocop:disable Metrics/MethodLength