Sha256: 8750858ad6f5fb156419621e527c71f4584d0f73245f55daf45e843228a61804

Contents?: true

Size: 1.18 KB

Versions: 2

Compression:

Stored size: 1.18 KB

Contents

module Fastlane
  module Actions
    module SharedValues
      CERT_FILE_PATH = :CERT_FILE_PATH
      CERT_CERTIFICATE_ID = :CERT_CERTIFICATE_ID
    end

    class CertAction
      def self.run(params)
        require 'cert'
        require 'cert/options'

        return if Helper.test?

        Dir.chdir(FastlaneFolder.path || Dir.pwd) do
          # This should be executed in the fastlane folder

          values = params.first
          if params.kind_of?Array
            # Old syntax
            values = {}
            params.each do |val|
              values[val] = true
            end
          end

          Cert.config = FastlaneCore::Configuration.create(Cert::Options.available_options, (values || {}))

          Cert::CertRunner.run
          cert_file_path = ENV["CER_FILE_PATH"]
          certificate_id = ENV["CER_CERTIFICATE_ID"]
          Actions.lane_context[SharedValues::CERT_FILE_PATH] = cert_file_path
          Actions.lane_context[SharedValues::CERT_CERTIFICATE_ID] = certificate_id

          Helper.log.info("Use signing certificate '#{certificate_id}' from now on!".green)

          ENV["SIGH_CERTIFICATE_ID"] = certificate_id
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fastlane-0.1.19 lib/fastlane/actions/cert.rb
fastlane-0.1.18 lib/fastlane/actions/cert.rb