-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Runner (self-hosted, macOS) as service fails code-signing step on xcode archive #3407
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I encountered the same issue, when i am using
But when i am using |
@Adam-Beno, I managed to code-signing when running runner as a service, i just tried unlocking login keychain (my signing key is on the login keychain) before running the xcodebuild cmd, and it works! # ....
print("unlocking login keychain...")
# check if there is a file named login.keychain-password in the LOGIN_KEYCHAIN_PASSWORD_PATH
login_keychain_password_path = LOGIN_KEYCHAIN_PASSWORD_PATH.joinpath(
"login.keychain-password"
)
if login_keychain_password_path.exists():
keychain_password = login_keychain_password_path.read_text().strip()
if keychain_password:
print("unlocking login keychain with password...")
subprocess.run(
[
"security",
"unlock-keychain",
"-p",
keychain_password,
"login.keychain",
],
check=True,
)
else:
print("unlocking login keychain without password...")
subprocess.run(
[
"security",
"unlock-keychain",
"login.keychain",
],
check=True,
)
else:
print("login.keychain-password file not found, don't unlock login keychain")
## ....
print("cleaning...")
subprocess.run(
[
"xcodebuild",
"clean",
"-project",
XCODE_PROJECT_PATH,
"-scheme",
scheme,
"-derivedDataPath",
derived_data_path,
"-resultBundlePath",
xcode_result_bundle_path("build_clean"),
# *xcodebuild_authenticate_args,
],
check=True,
env=env,
)
print("archiving...")
subprocess.run(
[
"xcodebuild",
"archive",
"-project",
XCODE_PROJECT_PATH,
"-scheme",
scheme,
"-configuration",
build_configuration,
"-sdk",
"iphoneos",
"-destination",
"generic/platform=iOS",
"-archivePath",
archive_path,
"-derivedDataPath",
derived_data_path,
"-resultBundlePath",
xcode_result_bundle_path("build_archive"),
"-showBuildTimingSummary",
*xcodebuild_authenticate_args,
],
check=True,
env=env,
) |
I encountered the same problem when using In order to perform xcode compilation normally, you can only use |
@douba0 I don't know the exact reason, but if <plist version="1.0">
...
<key>SessionCreate</key>
<false/>
</plist> After reinstalling the service, the signing task in my workflow worked well. |
Describe the bug
Runner fails xcode signing step while being run as a service via
./svh.sh start
, however while using the runner via./run.sh
the job completes successfullyTo Reproduce
./svc.sh install
>./svc.sh start
Expected behavior
Using runner as service should result in the same output as using the runner via the run command.
Runner Version and Platform
System
Runner
Gemfile
What's not working?
xcodebuild fails on signing step for the first native module of a RN app. There is not really an explanation on why. Here is a rundown of things I tried to fix the issue
Note: This whole time I was able to compile the app both in XCode and by manually executing the fastlane
1. Restarting mac mini (i know i know.. its a meme but you never know)
2. Switching between automatic and manual signing
Signing is the usual culprit when building iOS apps via CI but doing any changes had no effect on the archive error.
Initially I used automatic signing from XCode by enabling it in XCode on the project itself and in Gymfile via
Next I tried switching over to manual signing using Match and modifying the fastlane configs accordingly, yet the app still won't build
3. Configure fastlane to use different keychain
I noticed in the docs for fastlane they recommend adding
setup_ci
setup_ci to resolve potentional keychain issues but this had no effect on the error either.4. Upgraded Ruby
Initially I used the system provided Ruby but then I found a similar error online and someone mentioned that upgrading Ruby fixed it for them. So I ended up using Ruby
2.7.7
viarvm
.Job Log Output
Fastlane Output
Configs
Workflow
Fastfile
Appfile
Gymfile
Conclusion
I intially thought it's the service being unable to reach the keychain but after setting up the
setup_ci
step in fastlane and it having access to the chain + being able to write the certs I really have no idea what could be causing this issue. Maybe it's just xcode being xcode again...At least I can still use the pipeline with
./run.sh
to keep my autobuilds going 🙏The text was updated successfully, but these errors were encountered: