Class: Fastlane::Actions::ResignAction

Inherits:
Object
  • Object
show all
Defined in:
lib/fastlane/actions/resign.rb

Overview

Resigns the ipa

Class Method Summary collapse

Class Method Details

.run(params) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/fastlane/actions/resign.rb', line 5

def self.run(params)
  require 'sigh'

  params = params.first

  raise 'You must pass valid params to the resign action. Please check the README.md'.red if (params.nil? || params.empty?)

  ipa                   = params[:ipa] || Actions.lane_context[SharedValues::IPA_OUTPUT_PATH]
  signing_identity      = params[:signing_identity]
  provisioning_profile  = params[:provisioning_profile] || Actions.lane_context[SharedValues::SIGH_PROFILE_PATH]

  raise 'Please pass a valid ipa which should be a path to an ipa on disk'.red unless ipa
  raise 'Please pass a valid signing_identity'.red unless signing_identity
  raise 'Please pass a valid provisioning_profile which should be a path to a profile on disk.'.red unless provisioning_profile

  # try to resign the ipa
  if Sigh::Resign.resign(ipa, signing_identity, provisioning_profile)
    Helper.log.info 'Successfully re-signed .ipa 🔏.'.green
  else
    raise 'Failed to re-sign .ipa'.red
  end
end