Skip to content

Commit

Permalink
Allow empty certificate passphrase (#32)
Browse files Browse the repository at this point in the history
* Allow empty certificate passphrase

* Reorder tests

* Use latest go-xcode release
  • Loading branch information
ofalvai committed Mar 21, 2022
1 parent 9b31a56 commit b0e5ce4
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 17 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ You can also run this step directly with [Bitrise CLI](https://github.com/bitris
| `min_profile_validity` | If this input is set to >0, the managed Provisioning Profile will be renewed if it expires within the configured number of days. Otherwise the Step renews the managed Provisioning Profile if it is expired. | required | `0` |
| `apple_team_id` | The Apple Developer Portal team to use for downloading code signing assets. Defining this is only required when Automatic Code Signing is set to `apple-id` and the connected account belongs to multiple teams. | | |
| `certificate_url_list` | URL of the code signing certificate to download. Multiple URLs can be specified, separated by a pipe (`\|`) character. Local file path can be specified, using the `file://` URL scheme. | required, sensitive | `$BITRISE_CERTIFICATE_URL` |
| `passphrase_list` | Passphrases for the provided code signing certificates. Specify as many passphrases as many Code signing certificate URL provided, separated by a pipe (`\|`) character. | required, sensitive | `$BITRISE_CERTIFICATE_PASSPHRASE` |
| `passphrase_list` | Passphrases for the provided code signing certificates. Specify as many passphrases as many Code signing certificate URL provided, separated by a pipe (`\|`) character. Certificates without a passphrase: for using a single certificate, leave this step input empty. For multiple certificates, use the separator as if there was a passphrase (examples: `pass\|`, `\|pass\|`, `\|`) | sensitive | `$BITRISE_CERTIFICATE_PASSPHRASE` |
| `keychain_path` | Path to the Keychain where the code signing certificates will be installed. | required | `$HOME/Library/Keychains/login.keychain` |
| `keychain_password` | Password for the provided Keychain. | required, sensitive | `$BITRISE_KEYCHAIN_PASSWORD` |
| `output_dir` | This directory will contain the generated artifacts. | required | `$BITRISE_DEPLOY_DIR` |
Expand Down
25 changes: 25 additions & 0 deletions e2e/bitrise.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ app:
- BITRISE_KEYCHAIN_PASSWORD: $BITRISE_KEYCHAIN_PASSWORD
- BITFALL_APPLE_APPLE_CERTIFICATE_URL_LIST: $BITFALL_APPLE_APPLE_CERTIFICATE_URL_LIST
- BITFALL_APPLE_APPLE_CERTIFICATE_PASSPHRASE_LIST: $BITFALL_APPLE_APPLE_CERTIFICATE_PASSPHRASE_LIST
- BITFALL_APPLE_IOS_CERTIFICATE_NOPASSPHRASE_URL: $BITFALL_APPLE_IOS_CERTIFICATE_NOPASSPHRASE_URL

workflows:
test_swiftpm:
Expand Down Expand Up @@ -121,6 +122,30 @@ workflows:
after_run:
- _run

test_single_certificate_no_passphrase:
steps:
- script:
inputs:
- content: |-
#!/bin/bash
set -ex
rm -rf "./_tmp"
mkdir -p "./_tmp"
- git::https://github.com/bitrise-steplib/bitrise-step-simple-git-clone.git@master:
inputs:
- repository_url: https://github.com/bitrise-io/sample-apps-ios-simple-objc.git
- branch: bundle_id
- clone_into_dir: ./_tmp
- path::./:
title: Step Test
inputs:
- project_path: ./_tmp/ios-simple-objc/ios-simple-objc.xcodeproj
- scheme: ios-simple-objc
- automatic_code_signing: api-key
- certificate_url_list: $BITFALL_APPLE_IOS_CERTIFICATE_NOPASSPHRASE_URL
- passphrase_list: ""
- apple_team_id: 72SA8V3WYL

_run:
steps:
- script:
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ require (
require (
github.com/bitrise-io/go-steputils/v2 v2.0.0-alpha.1
github.com/bitrise-io/go-utils/v2 v2.0.0-alpha.2
github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.9
github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.10
)

require (
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ github.com/bitrise-io/go-utils/v2 v2.0.0-alpha.2/go.mod h1:sy+Ir1X8P3tAAx/qU/r+h
github.com/bitrise-io/go-xcode v1.0.1/go.mod h1:Y0Wu2dXm0MilJ/4D3+gPHaNMlUcP+1DjIPoLPykq7wY=
github.com/bitrise-io/go-xcode v1.0.2 h1:Uv/cBOJ/qZpitjOpyS8orafee3wk66OwvRTbqA2fr+4=
github.com/bitrise-io/go-xcode v1.0.2/go.mod h1:Y0Wu2dXm0MilJ/4D3+gPHaNMlUcP+1DjIPoLPykq7wY=
github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.9 h1:zBb8U+i6LrZXdTSh+FrXhb/ivw/ghnLVmhU5mjQIOSM=
github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.9/go.mod h1:6YbvyYwZgSTt96CQSQ6QlrkcRiv3ssX8zLijh2TPnbU=
github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.10 h1:fL+rOyxRXZADO3o4UKCUFsO3Fr83G+r8fbH4BnzOvls=
github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.10/go.mod h1:6YbvyYwZgSTt96CQSQ6QlrkcRiv3ssX8zLijh2TPnbU=
github.com/bitrise-io/pkcs12 v0.0.0-20211108084543-e52728e011c8 h1:kmvU8AxrNTxXsVPKepBHD8W+eCVmeaKyTkRuUJB2K38=
github.com/bitrise-io/pkcs12 v0.0.0-20211108084543-e52728e011c8/go.mod h1:UiXKNs0essbC14a2TvGlnUKo9isP9m4guPrp8KJHJpU=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
Expand Down
4 changes: 3 additions & 1 deletion step.yml
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,9 @@ inputs:
Passphrases for the provided code signing certificates.
Specify as many passphrases as many Code signing certificate URL provided, separated by a pipe (`|`) character.
is_required: true
Certificates without a passphrase: for using a single certificate, leave this step input empty. For multiple certificates, use the separator as if there was a passphrase (examples: `pass|`, `|pass|`, `|`)
is_required: false # A single cert with an empty passphrase is allowed too
is_sensitive: true

- keychain_path: $HOME/Library/Keychains/login.keychain
Expand Down
23 changes: 12 additions & 11 deletions vendor/github.com/bitrise-io/go-xcode/v2/codesign/inputparse.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ github.com/bitrise-io/go-xcode/xcodeproject/xcodeproj
github.com/bitrise-io/go-xcode/xcodeproject/xcscheme
github.com/bitrise-io/go-xcode/xcodeproject/xcworkspace
github.com/bitrise-io/go-xcode/xcpretty
# github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.9
# github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.10
## explicit; go 1.16
github.com/bitrise-io/go-xcode/v2/autocodesign
github.com/bitrise-io/go-xcode/v2/autocodesign/certdownloader
Expand Down

0 comments on commit b0e5ce4

Please sign in to comment.