Class: Fastlane::Actions::UploadToPlayStoreInternalAppSharingAction

Inherits:
Fastlane::Action
  • Object
show all
Defined in:
fastlane/lib/fastlane/actions/upload_to_play_store_internal_app_sharing.rb

Constant Summary

Constants inherited from Fastlane::Action

Fastlane::Action::AVAILABLE_CATEGORIES, Fastlane::Action::RETURN_TYPES

Documentation collapse

Class Method Summary collapse

Methods inherited from Fastlane::Action

action_name, author, deprecated_notes, lane_context, method_missing, other_action, output, return_type, sample_return_value, shell_out_should_use_bundle_exec?, step_text

Class Method Details

.authorsObject



61
62
63
# File 'fastlane/lib/fastlane/actions/upload_to_play_store_internal_app_sharing.rb', line 61

def self.authors
  ["andrewhavens"]
end

.available_optionsObject



47
48
49
50
51
52
53
54
55
# File 'fastlane/lib/fastlane/actions/upload_to_play_store_internal_app_sharing.rb', line 47

def self.available_options
  require 'supply'
  require 'supply/options'
  options = Supply::Options.available_options.clone

  # remove all the unnecessary (for this action) options
  options_to_keep = [:package_name, :apk, :apk_paths, :aab, :aab_paths, :json_key, :json_key_data, :root_url, :timeout]
  options.delete_if { |option| options_to_keep.include?(option.key) == false }
end

.categoryObject



73
74
75
# File 'fastlane/lib/fastlane/actions/upload_to_play_store_internal_app_sharing.rb', line 73

def self.category
  :production
end

.descriptionObject



39
40
41
# File 'fastlane/lib/fastlane/actions/upload_to_play_store_internal_app_sharing.rb', line 39

def self.description
  "Upload binaries to Google Play Internal App Sharing (via _supply_)"
end

.detailsObject



43
44
45
# File 'fastlane/lib/fastlane/actions/upload_to_play_store_internal_app_sharing.rb', line 43

def self.details
  "More information: https://docs.fastlane.tools/actions/upload_to_play_store_internal_app_sharing/"
end

.example_codeObject



69
70
71
# File 'fastlane/lib/fastlane/actions/upload_to_play_store_internal_app_sharing.rb', line 69

def self.example_code
  ["upload_to_play_store_internal_app_sharing"]
end

.is_supported?(platform) ⇒ Boolean

Returns:



65
66
67
# File 'fastlane/lib/fastlane/actions/upload_to_play_store_internal_app_sharing.rb', line 65

def self.is_supported?(platform)
  platform == :android
end

.return_valueObject



57
58
59
# File 'fastlane/lib/fastlane/actions/upload_to_play_store_internal_app_sharing.rb', line 57

def self.return_value
  "Returns a string containing the download URL for the uploaded APK/AAB (or array of strings if multiple were uploaded)."
end

.run(params) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'fastlane/lib/fastlane/actions/upload_to_play_store_internal_app_sharing.rb', line 4

def self.run(params)
  require 'supply'

  # If no APK params were provided, try to fill in the values from lane context, preferring
  # the multiple APKs over the single APK if set.
  if params[:apk_paths].nil? && params[:apk].nil?
    all_apk_paths = Actions.lane_context[SharedValues::GRADLE_ALL_APK_OUTPUT_PATHS] || []
    if all_apk_paths.size > 1
      params[:apk_paths] = all_apk_paths
    else
      params[:apk] = Actions.lane_context[SharedValues::GRADLE_APK_OUTPUT_PATH]
    end
  end

  # If no AAB param was provided, try to fill in the value from lane context.
  # First GRADLE_ALL_AAB_OUTPUT_PATHS if only one
  # Else from GRADLE_AAB_OUTPUT_PATH
  if params[:aab].nil?
    all_aab_paths = Actions.lane_context[SharedValues::GRADLE_ALL_AAB_OUTPUT_PATHS] || []
    if all_aab_paths.count == 1
      params[:aab] = all_aab_paths.first
    else
      params[:aab] = Actions.lane_context[SharedValues::GRADLE_AAB_OUTPUT_PATH]
    end
  end

  Supply.config = params # we already have the finished config

  Supply::Uploader.new.perform_upload_to_internal_app_sharing
end