GithubHelp home page GithubHelp logo

cupojoe / bitrise-step-update-xcode-project-provisioning Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 17 KB

Bitrise step to update Xcode's project file signing config to use a specific certificate and provisioning profile

License: MIT License

Ruby 63.02% Shell 36.98%

bitrise-step-update-xcode-project-provisioning's Introduction

Update Xcode Project Provisioning

Updates Xcode's project file signing config to use a specific certificate and provisioning profile

How to use this Step

Add the Update Xcode Project Provisioning step into your workflow before the Xcode Archive & Export for iOS step.

Fill up the required values:

  • Xcode project.xcodeproj Path
  • Project Target
  • Code Sign Style
  • Development Team
  • Code Sign Identity
  • Provisioning Profile Specifier

Automatic Signing

  • Code Sign Style use Automatic.
  • Fill Code Sign Identity with iPhone Developer.
  • Specify Development Team
  • Leave Provisioning Profile Specifier empty.

Manual Signing

Specify all the values.

CODE_SIGN_STYLE: Manual
DEVELOPMENT_TEAM: ABCDEFGHIJ
CODE_SIGN_IDENTITY: iPhone Developer
PROVISIONING_PROFILE_SPECIFIER: MyAwesomeProjectDEV_Development

Demo

Here is part result of bitrise run test command with the bitrise CLI.

# Original Settings:
-----------------------------
Target: MyAwesomeProjectDEV

Build Configuration: Debug
CODE_SIGN_STYLE: Automatic
DEVELOPMENT_TEAM: XXXXXXXXXX
CODE_SIGN_IDENTITY: iPhone Developer
PROVISIONING_PROFILE_SPECIFIER:

Build Configuration: Release
CODE_SIGN_STYLE: Automatic
DEVELOPMENT_TEAM: XXXXXXXXXX
CODE_SIGN_IDENTITY: iPhone Developer
PROVISIONING_PROFILE_SPECIFIER:
-----------------------------

# Changed Settings:
-----------------------------
Target: MyAwesomeProjectDEV

Build Configuration: Debug
CODE_SIGN_STYLE: Manual
DEVELOPMENT_TEAM: ABCDEFGHIJ
CODE_SIGN_IDENTITY: iPhone Developer
PROVISIONING_PROFILE_SPECIFIER: MyAwesomeProjectDEV_Development

Build Configuration: Release
CODE_SIGN_STYLE: Manual
DEVELOPMENT_TEAM: FGHIJABCDE
CODE_SIGN_IDENTITY: iPhone Distribution
PROVISIONING_PROFILE_SPECIFIER: MyAwesomeProjectDEV_store
-----------------------------

Contribution

Can be run directly with the bitrise CLI, just git clone this repository, cd into it's folder in your Terminal/Command Line and call bitrise run test.

Check the bitrise.yml file for required inputs which have to be added to your .bitrise.secrets.yml file!

Step by step:

  1. Open up your Terminal / Command Line
  2. git clone the repository
  3. cd into the directory of the step (the one you just git clone)
  4. Once you have all the required secret parameters in your .bitrise.secrets.yml you can just run this step with the bitrise CLI: bitrise run test

Pull Request is welcome.

Credits

Forked from

https://github.com/j796160836/bitrise-step-code-signing-setting-patch

Updated to fit a more generic configuration pattern that does not require to have specific configuration names. Instead works with all and any configurations.

Inspired by

https://github.com/fastlane/fastlane/blob/master/fastlane/lib/fastlane/actions/update_project_provisioning.rb

bitrise-step-update-xcode-project-provisioning's People

Contributors

cupojoe avatar

Watchers

 avatar  avatar

bitrise-step-update-xcode-project-provisioning's Issues

Setting the provisioning for a Mac Catalyst app

When using this step on a Mac Catalyst project, the provisioning settings are replaced for the iOS part, and it is not possible to set the provisioning settings for the macOS (Catalyst) part.

Bug in the new version (v1.1.0)

	if configSettings["CODE_SIGN_IDENTITY"]
		configSettings["CODE_SIGN_IDENTITY"] = $code_sign_identity
	end

for some reason the new conditionals broke down, not sure why, I do not immediately see a bug, maybe upper/lowercase? But now CODE_SIGN_IDENTITY and PROVISIONING_PROFILE_SPECIFIER are empty. Downgrading to the previous release fixes the issue without any edits to the config

Feature Request: Run `bundle install` prior to executing

Background

After updating the ruby version I use on Bitrise, my update-xcode-project-provisioning step failed with the following error:

/Users/vagrant/.rbenv/versions/2.7.5/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require': cannot load such file -- xcodeproj (LoadError)
	from /Users/vagrant/.rbenv/versions/2.7.5/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
	from /var/folders/9l/1ysg9vq51p37q0lgksxhdb9r0000gn/T/bitrise601015283/step_src/edit.rb:3:in `<main>'

I looked into this, and it seems that update-xcode-project-provisioning's step.sh runs edit.rb directly without first running bundle install, and the first line of edit.rb includes a ruby require.

This configuration requires that bundle install be ran prior to calling update-xcode-project-provisioning (unless a prior CI run has installed xcodeproj already). Looking at the CI tool cocoapods-install, they run bundle install prior to running their ruby commands to ensure that they don't fail due to ruby setup issues.

Feature Request

It would be great for the update-xcode-project-provisioning tool to ensure that its ruby environment is properly set up prior to running by executing bundle install as part of the step.sh script.

Workaround

For now, I'm running bundle install myself in CI prior to running update-xcode-project-provisioning.

Xcode 14 apparently can add different provisioning profiles per OS

I have just installed Xcode 14 and manually updated the provisioning profile as I added some new devices to the account.
Seems that Xcode now adds new properties to the provisioning profile when set from Xcode 14, breaking this step script.
I manually reverted the changes, you can see them in the following screenshot
Screenshot 2022-09-16 at 21 18 32

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.