Class: Fastlane::Actions::EncryptGooglePlayCredentialsAction

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

Documentation collapse

Class Method Summary collapse

Class Method Details

.authorsObject



54
55
56
57
# File 'lib/fastlane/plugin/react_native_release/actions/encrypt_google_play_credentials.rb', line 54

def self.authors
  # So no one will ever forget your contribution to fastlane :) You are awesome btw!
  ["cball", "isaiahgrey93"]
end

.available_optionsObject



37
38
39
40
41
42
43
44
# File 'lib/fastlane/plugin/react_native_release/actions/encrypt_google_play_credentials.rb', line 37

def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :json_path,
                                 env_name: "FL_ENCRYPT_GOOGLE_PLAY_CREDENTIALS_JSON_PATH",
                                 description: "Enter path to the json you downloaded from Google, or drop the file here",
                                 type: String)
  ]
end

.descriptionObject



28
29
30
# File 'lib/fastlane/plugin/react_native_release/actions/encrypt_google_play_credentials.rb', line 28

def self.description
  "Encrypts credentials from Google Play and stores in the context repo."
end

.detailsObject



32
33
34
35
# File 'lib/fastlane/plugin/react_native_release/actions/encrypt_google_play_credentials.rb', line 32

def self.details
  # Optional:
  # this is your chance to provide a more detailed description of this action
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


59
60
61
# File 'lib/fastlane/plugin/react_native_release/actions/encrypt_google_play_credentials.rb', line 59

def self.is_supported?(platform)
  [:ios, :android].include?(platform)
end

.return_valueObject



46
47
48
# File 'lib/fastlane/plugin/react_native_release/actions/encrypt_google_play_credentials.rb', line 46

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
# File 'lib/fastlane/plugin/react_native_release/actions/encrypt_google_play_credentials.rb', line 7

def self.run(params)
  key = Helper::ReactNativeReleaseHelper::GOOGLE_PLAY_CREDENTIALS_CRYPTEX_KEY
  json_path = params[:json_path]

  begin
    other_action.cryptex(
      type: "import",
      key: key,
      in: json_path
    )
  rescue => ex
    UI.abort_with_message!('Error encrypting Google Play Credentials.')
  end

  UI.success("Encrypted #{json_path} as #{key}")
end