Class: Fastlane::Actions::ManagedGooglePlayAction
- Inherits:
-
Action
- Object
- Action
- Fastlane::Actions::ManagedGooglePlayAction
- Defined in:
- lib/fastlane/plugin/managed_google_play/actions/managed_google_play_action.rb
Class Method Summary collapse
- .authors ⇒ Object
- .available_options ⇒ Object
- .description ⇒ Object
- .details ⇒ Object
- .is_supported?(platform) ⇒ Boolean
- .return_value ⇒ Object
- .run(params) ⇒ Object
Class Method Details
.authors ⇒ Object
63 64 65 |
# File 'lib/fastlane/plugin/managed_google_play/actions/managed_google_play_action.rb', line 63 def self. ["Jan Piotrowski"] end |
.available_options ⇒ Object
76 77 78 79 80 81 82 83 84 |
# File 'lib/fastlane/plugin/managed_google_play/actions/managed_google_play_action.rb', line 76 def self. [ # FastlaneCore::ConfigItem.new(key: :your_option, # env_name: "MANAGED_GOOGLE_PLAY_YOUR_OPTION", # description: "A description of your option", # optional: false, # type: String) ] end |
.description ⇒ Object
59 60 61 |
# File 'lib/fastlane/plugin/managed_google_play/actions/managed_google_play_action.rb', line 59 def self.description "Create Managed Google Play Apps" end |
.details ⇒ Object
71 72 73 74 |
# File 'lib/fastlane/plugin/managed_google_play/actions/managed_google_play_action.rb', line 71 def self.details # Optional: "none yet" end |
.is_supported?(platform) ⇒ Boolean
86 87 88 89 90 91 92 |
# File 'lib/fastlane/plugin/managed_google_play/actions/managed_google_play_action.rb', line 86 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) true end |
.return_value ⇒ Object
67 68 69 |
# File 'lib/fastlane/plugin/managed_google_play/actions/managed_google_play_action.rb', line 67 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 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/fastlane/plugin/managed_google_play/actions/managed_google_play_action.rb', line 7 def self.run(params) require "google/apis/playcustomapp_v1" # Auth Info @keyfile = ENV['KEYFILE_PATH'] @developer_account = ENV['DEVELOPER_ACCOUNT'] # App Info @apk_path = "artifacts/app-release.apk" @app_title = "App title!" @language_code = "en_US" # login scope = 'https://www.googleapis.com/auth/androidpublisher' credentials = JSON.parse(File.open(@keyfile, 'rb').read) auth_client = Signet::OAuth2::Client.new( token_credential_uri: 'https://oauth2.googleapis.com/token', audience: 'https://oauth2.googleapis.com/token', scope: scope, issuer: credentials['client_id'], signing_key: OpenSSL::PKey::RSA.new(credentials['private_key'], nil) ) UI.('auth_client: ' + auth_client.inspect) auth_client.fetch_access_token! # service play_custom_apps = Google::Apis::PlaycustomappV1::PlaycustomappService.new play_custom_apps. = auth_client UI.('play_custom_apps with auth: ' + play_custom_apps.inspect) # app custom_app = Google::Apis::PlaycustomappV1::CustomApp.new(title: @app_title, language_code: @language_code) UI.('custom_app: ' + custom_app.inspect) # create app returned = play_custom_apps.create_account_custom_app( @developer_account, custom_app, upload_source: nil # , # upload_source: @apk_path, ) do |created_app, error| if error.nil? puts("Success: #{created_app}.") UI.success(created_app) else puts("Error: #{error}") UI.error(error.inspect) end end UI.('returned: ' + returned.inspect) end |