Skip to content

Commit daf9b46

Browse files
committed
fix: resolve iOS build hanging at code signing step
- Add proper keychain setup for CI environment - Configure keychain with timeout to prevent locking during build - Pass keychain credentials to Fastlane match - Add verbose logging and build timeout - Explicitly set provisioning profile for CI builds - Add manual code signing style to build arguments
1 parent 45654da commit daf9b46

File tree

2 files changed

+49
-4
lines changed

2 files changed

+49
-4
lines changed

.github/workflows/release.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,30 @@ jobs:
116116
with:
117117
ssh-private-key: ${{ secrets.DEPLOY_KEY }}
118118

119+
- name: Setup Keychain for Code Signing
120+
run: |
121+
# Create a temporary keychain for the build
122+
KEYCHAIN_NAME="build-temp.keychain"
123+
KEYCHAIN_PASSWORD="temp-password-$(date +%s)"
124+
125+
# Create keychain
126+
security create-keychain -p "$KEYCHAIN_PASSWORD" "$KEYCHAIN_NAME"
127+
128+
# Set it as default
129+
security default-keychain -s "$KEYCHAIN_NAME"
130+
131+
# Unlock the keychain
132+
security unlock-keychain -p "$KEYCHAIN_PASSWORD" "$KEYCHAIN_NAME"
133+
134+
# Set keychain timeout to 1 hour (3600 seconds) to prevent locking during build
135+
security set-keychain-settings -t 3600 -l "$KEYCHAIN_NAME"
136+
137+
# Add keychain to search list
138+
security list-keychains -d user -s "$KEYCHAIN_NAME" $(security list-keychains -d user | sed 's/"//g')
139+
140+
echo "MATCH_KEYCHAIN_NAME=$KEYCHAIN_NAME" >> $GITHUB_ENV
141+
echo "MATCH_KEYCHAIN_PASSWORD=$KEYCHAIN_PASSWORD" >> $GITHUB_ENV
142+
119143
- name: Create App Store Connect API Key
120144
env:
121145
APP_STORE_CONNECT_KEY_ID: ${{ secrets.APP_STORE_CONNECT_KEY_ID }}
@@ -253,11 +277,16 @@ jobs:
253277
fastlane match appstore --readonly
254278
255279
- name: Build and Upload to TestFlight
280+
timeout-minutes: 45
256281
env:
257282
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
258283
MATCH_GIT_URL: ${{ secrets.MATCH_GIT_URL }}
259284
TEAM_ID: ${{ secrets.TEAM_ID }}
260285
run: |
286+
# Enable verbose output for debugging
287+
export FASTLANE_VERBOSE=true
288+
289+
# Run the beta lane
261290
fastlane beta
262291
263292
- name: Create GitHub Release

fastlane/Fastfile

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,13 @@ platform :ios do
2828
teamID: ENV["TEAM_ID"]
2929
},
3030
export_team_id: ENV["TEAM_ID"],
31-
xcargs: "-allowProvisioningUpdates",
31+
xcargs: "-allowProvisioningUpdates CODE_SIGN_STYLE=Manual",
3232
clean: true,
3333
output_directory: "./build",
34-
output_name: "V2er.ipa"
34+
output_name: "V2er.ipa",
35+
verbose: true,
36+
buildlog_path: "./buildlog",
37+
silent: false
3538
)
3639
end
3740

@@ -41,7 +44,9 @@ platform :ios do
4144
type: "appstore",
4245
readonly: is_ci,
4346
app_identifier: "v2er.app",
44-
git_url: ENV["MATCH_GIT_URL"] || "git@github.com:graycreate/certificates-v2er-iOS.git"
47+
git_url: ENV["MATCH_GIT_URL"] || "git@github.com:graycreate/certificates-v2er-iOS.git",
48+
keychain_name: ENV["MATCH_KEYCHAIN_NAME"] || "login.keychain",
49+
keychain_password: ENV["MATCH_KEYCHAIN_PASSWORD"] || ""
4550
)
4651
end
4752

@@ -79,9 +84,20 @@ platform :ios do
7984
path: "V2er.xcodeproj",
8085
team_id: ENV["TEAM_ID"],
8186
profile_name: "match AppStore v2er.app",
82-
code_sign_identity: "iPhone Distribution"
87+
code_sign_identity: "iPhone Distribution",
88+
targets: ["V2er"]
8389
)
8490

91+
# Explicitly set provisioning profile for CI
92+
if is_ci
93+
update_project_provisioning(
94+
xcodeproj: "V2er.xcodeproj",
95+
profile: ENV["sigh_v2er.app_appstore_profile-path"],
96+
target_filter: "V2er",
97+
build_configuration: "Release"
98+
)
99+
end
100+
85101
# Build the app
86102
build_ipa
87103

0 commit comments

Comments
 (0)