Skip to content

Commit 1bfb988

Browse files
committed
fix(ci): use xcodebuild archive for signing
1 parent dff0424 commit 1bfb988

1 file changed

Lines changed: 23 additions & 3 deletions

File tree

.github/workflows/build.yaml

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ jobs:
234234
security find-identity -v -p codesigning "$KEYCHAIN_PATH"
235235
SIGNING_IDENTITY=$(security find-identity -v -p codesigning "$KEYCHAIN_PATH" | head -n 1 | sed -E 's/.*"(.*)"/\1/')
236236
echo "signing_identity=$SIGNING_IDENTITY" >> $GITHUB_ENV
237+
echo "keychain_path=$KEYCHAIN_PATH" >> $GITHUB_ENV
237238
238239
PROFILE_PATH="${RUNNER_TEMP}/openlist.mobileprovision"
239240
echo "$IOS_PROVISION_PROFILE" | base64 --decode > "$PROFILE_PATH"
@@ -265,13 +266,12 @@ jobs:
265266
BUILD_VERSION_NAME: ${{ needs.version.outputs.version_name }}
266267
run: |
267268
echo "Building signed iOS IPA for TestFlight..."
268-
export OTHER_CODE_SIGN_FLAGS="--keychain ${RUNNER_TEMP}/openlist.keychain-db"
269269
BUNDLE_ID="${{ secrets.IOS_BUNDLE_ID }}"
270270
if [ -z "$BUNDLE_ID" ]; then
271271
BUNDLE_ID="org.oplist.app"
272272
fi
273273
274-
export FLUTTER_XCODE_BUILD_ARGS="CODE_SIGN_STYLE=Manual DEVELOPMENT_TEAM=$team_id CODE_SIGN_IDENTITY=$signing_identity PROVISIONING_PROFILE_SPECIFIER=$profile_name PRODUCT_BUNDLE_IDENTIFIER=$BUNDLE_ID"
274+
flutter build ios --release --no-codesign
275275
276276
EXPORT_OPTIONS_PATH="${RUNNER_TEMP}/exportOptions.plist"
277277
/usr/libexec/PlistBuddy -c "Clear dict" "$EXPORT_OPTIONS_PATH" || true
@@ -282,7 +282,27 @@ jobs:
282282
/usr/libexec/PlistBuddy -c "Add :provisioningProfiles dict" "$EXPORT_OPTIONS_PATH"
283283
/usr/libexec/PlistBuddy -c "Add :provisioningProfiles:$BUNDLE_ID string $profile_name" "$EXPORT_OPTIONS_PATH"
284284
285-
flutter build ipa --release --export-options-plist="$EXPORT_OPTIONS_PATH"
285+
ARCHIVE_PATH="${RUNNER_TEMP}/OpenList.xcarchive"
286+
xcodebuild \
287+
-workspace ios/Runner.xcworkspace \
288+
-scheme Runner \
289+
-configuration Release \
290+
-sdk iphoneos \
291+
-archivePath "$ARCHIVE_PATH" \
292+
archive \
293+
CODE_SIGN_STYLE=Manual \
294+
DEVELOPMENT_TEAM="$team_id" \
295+
CODE_SIGN_IDENTITY="$signing_identity" \
296+
PROVISIONING_PROFILE_SPECIFIER="$profile_name" \
297+
PRODUCT_BUNDLE_IDENTIFIER="$BUNDLE_ID" \
298+
OTHER_CODE_SIGN_FLAGS="--keychain $keychain_path"
299+
300+
xcodebuild \
301+
-exportArchive \
302+
-archivePath "$ARCHIVE_PATH" \
303+
-exportOptionsPlist "$EXPORT_OPTIONS_PATH" \
304+
-exportPath "${{ env.output }}" \
305+
OTHER_CODE_SIGN_FLAGS="--keychain $keychain_path"
286306
287307
- name: Create IPA
288308
if: ${{ env.testflight_ready != 'true' }}

0 commit comments

Comments
 (0)