GithubHelp home page GithubHelp logo

mindera / fastlane-plugin-cosigner Goto Github PK

View Code? Open in Web Editor NEW
25.0 26.0 3.0 27 KB

A fastlane plugin to help you sign your iOS builds

License: MIT License

Ruby 100.00%
fastlane fastlane-plugin mindera codesigning provisioning-profiles xcodeproj

fastlane-plugin-cosigner's Introduction

Cosigner ✍️

Fastlane plugin which enables iOS workflows to change the Xcode project's code signing settings before building a target, being your "cosigner".

Deprecation notice ⚠️

cosigner has long been integrated into fastlane, and as such is considered deprecated and will no longer receive updates. Please use fastlane's update_code_signing_settings action instead. 🙏

Why do I need it? 🤔

This action is especially useful to avoid having to configure the Xcode project with a "static" set of code signing configurations for:

  • Code Signing Style (Xcode8+): Manual / Automatic (originally Provisioning Style on Xcode 8)
  • Code Signing Identity: iPhone Development / iPhone Distribution
  • Provisioning Profile UUID (Xcode 7 and earlier)
  • Provisioning Profile Name (Xcode8+)
  • Team ID
  • Application Bundle identifier

By being able to configure this before each build (e.g. gym call), it allows having separate sets of code signing configurations on the same project without being "intrusive".

Some practical scenarios can be for example:

  • Xcode project in which two different Apple Developer accounts/teams are required (e.g. 1 for Development and 1 for Release)
  • Shared Xcode project where teams have different code signing configurations (e.g. Automatic vs Manual Provisioning Style)

How to use it? 👀

  1. Run fastlane add_plugin cosigner on your project folder.
  2. Invoke cosigner in your Fastfile and provide the required options.
  3. Enjoy your new dynamic code signing setup! ✨

Available options 🛠

Option Description Environment Variable Default Optional
xcodeproj_path The Xcode project's path PROJECT_PATH
scheme The Xcode project's scheme SCHEME
build_configuration Build configuration ("Debug", "Release", ...) BUILD_CONFIGURATION
code_sign_style Code signing style ("Automatic", "Manual ") (Xcode 8+, previously provisioning_style) CODE_SIGN_STYLE (previously PROVISIONING_STYLE) "Manual"
code_sign_identity Code signing identity type ("iPhone Development", "iPhone Distribution") CODE_SIGN_IDENTITY "iPhone Distribution"
profile_name Provisioning profile name to use for code signing (Xcode 8+) PROVISIONING_PROFILE_SPECIFIER
profile_uuid Provisioning profile UUID to use for code signing (Xcode 7 and earlier) PROVISIONING_PROFILE ✔️
development_team Development team identifier TEAM_ID
bundle_identifier Application Product Bundle Identifier APP_IDENTIFIER ✔️

Example usage 🔍

.env.default

TEAM_ID=XYZ1234
SCHEME=MyAppScheme
PROJECT_PATH='/path/to/MyApp.xcodeproj'

Fastfile

lane :build do
  app_identifier = "com.my.app.identifier"
  configuration = "Release"

  match(type: "adhoc", app_identifier: app_identifier)

  cosigner(
    build_configuration: configuration,
    profile_name: ENV['sigh_' + app_identifier + '_adhoc_profile-name'],
    profile_uuid: ENV['sigh_' + app_identifier + '_adhoc']
  )

  gym(
    configuration: configuration,
    export_options: {
      method: "ad-hoc"
    }
  )
end

Precautions ⚠️

Please be aware that cosigner effectively modifies your Xcode project file, so be careful if your workflow commits changes to source control, or if steps further down your pipeline can be affected by the resulting modifications.

Contributing 🙌

See CONTRIBUTING.

With ❤️ from Mindera 🤓

fastlane-plugin-cosigner's People

Contributors

p4checo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

aeons uxap exhorder

fastlane-plugin-cosigner's Issues

NoMethodError if the xcode project has no target attributes

NoMethodError: [!] undefined method `[]' for nil:NilClass
  /usr/local/lib/ruby/gems/2.5.0/gems/fastlane-plugin-cosigner-2.0.1/lib/fastlane/plugin/cosigner/actions/cosigner_action.rb:21:in `run'
  /usr/local/lib/ruby/gems/2.5.0/gems/fastlane-2.85.0/fastlane/lib/fastlane/runner.rb:257:in `block (2 levels) in execute_action'
  /usr/local/lib/ruby/gems/2.5.0/gems/fastlane-2.85.0/fastlane/lib/fastlane/actions/actions_helper.rb:50:in `execute_action'
  /usr/local/lib/ruby/gems/2.5.0/gems/fastlane-2.85.0/fastlane/lib/fastlane/runner.rb:236:in `block in execute_action'
  /usr/local/lib/ruby/gems/2.5.0/gems/fastlane-2.85.0/fastlane/lib/fastlane/runner.rb:231:in `chdir'
  /usr/local/lib/ruby/gems/2.5.0/gems/fastlane-2.85.0/fastlane/lib/fastlane/runner.rb:231:in `execute_action'
  /usr/local/lib/ruby/gems/2.5.0/gems/fastlane-2.85.0/fastlane/lib/fastlane/runner.rb:157:in `trigger_action_by_name'
  /usr/local/lib/ruby/gems/2.5.0/gems/fastlane-2.85.0/fastlane/lib/fastlane/fast_file.rb:148:in `method_missing'
  Fastfile:24:in `block (2 levels) in parsing_binding'
  /usr/local/lib/ruby/gems/2.5.0/gems/fastlane-2.85.0/fastlane/lib/fastlane/lane.rb:33:in `call'
  /usr/local/lib/ruby/gems/2.5.0/gems/fastlane-2.85.0/fastlane/lib/fastlane/runner.rb:49:in `block in execute'
  /usr/local/lib/ruby/gems/2.5.0/gems/fastlane-2.85.0/fastlane/lib/fastlane/runner.rb:45:in `chdir'
  /usr/local/lib/ruby/gems/2.5.0/gems/fastlane-2.85.0/fastlane/lib/fastlane/runner.rb:45:in `execute'
  /usr/local/lib/ruby/gems/2.5.0/gems/fastlane-2.85.0/fastlane/lib/fastlane/lane_manager.rb:57:in `cruise_lane'
  /usr/local/lib/ruby/gems/2.5.0/gems/fastlane-2.85.0/fastlane/lib/fastlane/command_line_handler.rb:36:in `handle'
  /usr/local/lib/ruby/gems/2.5.0/gems/fastlane-2.85.0/fastlane/lib/fastlane/commands_generator.rb:108:in `block (2 levels) in run'
  /usr/local/lib/ruby/gems/2.5.0/gems/commander-fastlane-4.4.6/lib/commander/command.rb:178:in `call'
  /usr/local/lib/ruby/gems/2.5.0/gems/commander-fastlane-4.4.6/lib/commander/command.rb:153:in `run'
  /usr/local/lib/ruby/gems/2.5.0/gems/commander-fastlane-4.4.6/lib/commander/runner.rb:476:in `run_active_command'
  /usr/local/lib/ruby/gems/2.5.0/gems/fastlane-2.85.0/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:75:in `run!'
  /usr/local/lib/ruby/gems/2.5.0/gems/commander-fastlane-4.4.6/lib/commander/delegates.rb:15:in `run!'
  /usr/local/lib/ruby/gems/2.5.0/gems/fastlane-2.85.0/fastlane/lib/fastlane/commands_generator.rb:333:in `run'
  /usr/local/lib/ruby/gems/2.5.0/gems/fastlane-2.85.0/fastlane/lib/fastlane/commands_generator.rb:42:in `start'
  /usr/local/lib/ruby/gems/2.5.0/gems/fastlane-2.85.0/fastlane/lib/fastlane/cli_tools_distributor.rb:98:in `take_off'
  /usr/local/lib/ruby/gems/2.5.0/gems/fastlane-2.85.0/bin/fastlane:20:in `<top (required)>'
  /usr/local/bin/fastlane:23:in `load'
  /usr/local/bin/fastlane:23:in `<top (required)>'

Development team is set to "$(PROFILE_UUID)" instead of the specified development_team

The team is always set to the default value of "$(PROFILE_UUID)" instead of the specified development_team.

The issue is here:

build_settings['DEVELOPMENT_TEAM'] = params[:development_team]

then later on

  FastlaneCore::ConfigItem.new(key: :development_team,
                                     env_name: "TEAM_ID",
                                     description: "Development team identifier",
                                     default_value: "\"$(PROFILE_UUID)\""),

instead of using the DEVELOPMENT_TEAM id which is set, it is here trying to use the TEAM_ID. And when that does not work it tries to use the default value of "$(PROFILE_UUID)" (which also should have a better default value).

Integrate into fastlane

Hey @p4checo 🤝

we recently integrated one of my plugins into fastlane automatic_code_signing for setting team_id and signing mode (manual, auto).

your plugin looks super awesome, how about combining forces and integrating the differences/missing-parts into the core action - providing all fastlane users a smooth way to handle codesigning?

namely:

  • setting CODE_SIGN_IDENTITY if :code_sign_identity set
  • setting PROVISIONING_PROFILE_SPECIFIER if :profile_name set
  • setting PROVISIONING_PROFILE if :profile_uuid set
  • setting PRODUCT_BUNDLE_IDENTIFIER if bundle_identifier set

for easy backward compatibility - we can add aliases and even transform parameters in alias_used
let me know if that is something you might wan't to do, if you need help anywhere let me know.

Here is the action i am talking about:

once you have a PR - feel free to directly mention me, and i am going to review it. 👍

regards ✋

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.