Class: Fastlane::Actions::UpdateGooglePlayReleaseRolloutAction

Inherits:
Action
  • Object
show all
Defined in:
lib/fastlane/plugin/google_play_track_updater/actions/update_google_play_release_rollout_action.rb

Class Method Summary collapse

Class Method Details

.authorsObject



30
31
32
# File 'lib/fastlane/plugin/google_play_track_updater/actions/update_google_play_release_rollout_action.rb', line 30

def self.authors
  ["Takuma Homma"]
end

.available_optionsObject



42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/fastlane/plugin/google_play_track_updater/actions/update_google_play_release_rollout_action.rb', line 42

def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :package_name,
                                 env_name: 'UPDATE_GOOGLE_PLAY_RELEASE_ROLLOUT_PACKAGE_NAME',
                                 description: 'The package name of the application. e.g. \'com.example.app\'',
                                 optional: false,
                                 type: String),
    FastlaneCore::ConfigItem.new(key: :track,
                                 env_name: "UPDATE_GOOGLE_PLAY_RELEASE_ROLLOUT_TRACK",
                                 description: 'The track of the application. The available tracks are: production, beta, alpha, internal',
                                 optional: false,
                                 type: String),
    FastlaneCore::ConfigItem.new(key: :version_name,
                                 env_name: 'UPDATE_GOOGLE_PLAY_RELEASE_ROLLOUT_VERSION_NAME',
                                 description: 'The version name to update. e.g. \'1.0.0\'',
                                 optional: false,
                                 type: String),
    FastlaneCore::ConfigItem.new(key: :user_fraction,
                                 env_name: 'UPDATE_GOOGLE_PLAY_RELEASE_ROLLOUT_USER_FRACTION',
                                 description: 'The rollout percentage as a fraction (0.0 to 1.0, exclusive). e.g. 0.1 for 10% rollout',
                                 optional: false,
                                 type: Float),
    FastlaneCore::ConfigItem.new(key: :json_file_path,
                                 env_name: 'UPDATE_GOOGLE_PLAY_RELEASE_ROLLOUT_JSON_FILE_PATH',
                                 description: 'The path to a file containing service account or external account JSON, used to authenticate with Google',
                                 optional: true,
                                 type: String),
    FastlaneCore::ConfigItem.new(key: :json_key_data,
                                 env_name: 'UPDATE_GOOGLE_PLAY_RELEASE_ROLLOUT_JSON_KEY_DATA',
                                 description: 'The file data containing service account or external account JSON, used to authenticate with Google',
                                 optional: true,
                                 type: String)

  ]
end

.descriptionObject



26
27
28
# File 'lib/fastlane/plugin/google_play_track_updater/actions/update_google_play_release_rollout_action.rb', line 26

def self.description
  'Updates the rollout percentage for a staged rollout on a Google Play track.'
end

.detailsObject



38
39
40
# File 'lib/fastlane/plugin/google_play_track_updater/actions/update_google_play_release_rollout_action.rb', line 38

def self.details
  'Updates the rollout percentage for a staged rollout on a Google Play track.'
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


78
79
80
81
82
83
84
85
# File 'lib/fastlane/plugin/google_play_track_updater/actions/update_google_play_release_rollout_action.rb', line 78

def self.is_supported?(platform)
  # Adjust this if your plugin only works for a particular platform (iOS vs. Android, for example)
  # See: https://docs.fastlane.tools/advanced/#control-configuration-by-lane-and-by-platform
  #
  # [:ios, :mac, :android].include?(platform)

  platform == :android
end

.return_valueObject



34
35
36
# File 'lib/fastlane/plugin/google_play_track_updater/actions/update_google_play_release_rollout_action.rb', line 34

def self.return_value
  # If your method provides a return value, you can describe here what it does
end

.run(params) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/fastlane/plugin/google_play_track_updater/actions/update_google_play_release_rollout_action.rb', line 7

def self.run(params)
  package_name = params[:package_name]
  track = params[:track]
  version_name = params[:version_name]
  user_fraction = params[:user_fraction]
  json_file_path = params[:json_file_path]
  json_key_data = params[:json_key_data]
  client = Fastlane::GooglePlayTrackUpdater::GooglePlayClient.new(
    json_file_path: json_file_path,
    json_key_data: json_key_data
  )
  client.update_rollout(
    package_name: package_name,
    track: track,
    version_name: version_name,
    user_fraction: user_fraction
  )
end