Class: Fastlane::Actions::DecryptGooglePlayCredentialsAction

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

Documentation collapse

Class Method Summary collapse

Class Method Details

.authorsObject



52
53
54
55
# File 'lib/fastlane/plugin/react_native_release/actions/decrypt_google_play_credentials.rb', line 52

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

.available_optionsObject



40
41
42
# File 'lib/fastlane/plugin/react_native_release/actions/decrypt_google_play_credentials.rb', line 40

def self.available_options
  []
end

.descriptionObject



31
32
33
# File 'lib/fastlane/plugin/react_native_release/actions/decrypt_google_play_credentials.rb', line 31

def self.description
  "Decrypts app env vars and sets the values in the root .env file"
end

.detailsObject



35
36
37
38
# File 'lib/fastlane/plugin/react_native_release/actions/decrypt_google_play_credentials.rb', line 35

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

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


57
58
59
# File 'lib/fastlane/plugin/react_native_release/actions/decrypt_google_play_credentials.rb', line 57

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

.return_valueObject



44
45
46
# File 'lib/fastlane/plugin/react_native_release/actions/decrypt_google_play_credentials.rb', line 44

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

def self.run(params)
  key = Helper::ReactNativeReleaseHelper::GOOGLE_PLAY_CREDENTIALS_CRYPTEX_KEY
  file = Tempfile.new('')

  begin
    other_action.cryptex(
      type: "export",
      key: key,
      out: file.path
    )
  rescue => ex
    UI.abort_with_message!('Error decrypting Google Play Credentials. Did you add them to the repo?')
  end

  google_creds = (open file.path).read
  UI.success("Decrypted #{key}")

  google_creds
end