6177214e-ce7c-49e3-99de-ff9721b26f63 — Commit f40821e3

AuthorNKL<nikolaj.king@gmail.com>
Date2025-12-08 14:42:04 +0100
Update build-ios.yml

Changed files

azure/templates/build-ios.yml | 116 +++++++++++-------------------------------
 1 file changed, 29 insertions(+), 87 deletions(-)

Diff

diff --git a/azure/templates/build-ios.yml b/azure/templates/build-ios.yml
index 130628f3..6fffe256 100644
--- a/azure/templates/build-ios.yml
+++ b/azure/templates/build-ios.yml
@@ -66,102 +66,44 @@ steps:
- script: |
cd $(Build.SourcesDirectory)/comwell_key_app
flutter clean
+ flutter pub get
rm -rf ios/build
rm -rf ios/.symlinks
rm -rf ~/Library/Developer/Xcode/DerivedData/*Runner*
displayName: 'Clean build artifacts'
-# Prepare Flutter dependencies and CocoaPods
-- script: |
- cd $(Build.SourcesDirectory)/comwell_key_app
- flutter pub get
- displayName: 'Flutter pub get'
-
-- script: |
- cd $(Build.SourcesDirectory)/comwell_key_app/ios
- pod install --repo-update
- displayName: 'Install CocoaPods'
-
-# Build and Archive with explicit scheme and configuration (bypasses Flutter's flavor detection)
-- script: |
- cd $(Build.SourcesDirectory)/comwell_key_app/ios
-
- echo "Building with:"
- echo " Scheme: $(iosScheme)"
- echo " Configuration: $(iosConfiguration)"
- echo " Bundle ID should be: $(iosBundleId)"
-
- # Create output directory
- mkdir -p "$(Build.SourcesDirectory)/output"
-
- xcodebuild archive \
- -workspace Runner.xcworkspace \
- -scheme "$(iosScheme)" \
- -configuration "$(iosConfiguration)" \
- -sdk iphoneos \
- -archivePath "$(Build.SourcesDirectory)/output/Runner.xcarchive" \
- BUILD_NUMBER=$(Build.BuildId) \
- CODE_SIGN_STYLE=Manual \
- CODE_SIGN_IDENTITY="$(APPLE_CERTIFICATE_SIGNING_IDENTITY)" \
- PROVISIONING_PROFILE_SPECIFIER="$(APPLE_PROV_PROFILE_UUID)" \
- DEVELOPMENT_TEAM=8RNV6AX4ZL \
- -allowProvisioningUpdates
-
- echo ""
- echo "=== Archive created ==="
- ls -la "$(Build.SourcesDirectory)/output/"
- displayName: 'Xcode Archive'
-
-# Find and list the archive location
-- script: |
- echo "=== Looking for archive ==="
- echo "Expected location: $(Build.SourcesDirectory)/output/Runner.xcarchive"
- ls -la "$(Build.SourcesDirectory)/output/" 2>/dev/null || echo "output directory not found"
-
- echo ""
- echo "=== Searching for .xcarchive files ==="
- find "$(Build.SourcesDirectory)" -name "*.xcarchive" -type d 2>/dev/null | head -5
-
- echo ""
- echo "=== Searching in common locations ==="
- ls -la ~/Library/Developer/Xcode/Archives/ 2>/dev/null || echo "No archives in default location"
- displayName: 'Debug: Find archive location'
+# - script: |
+# sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
+# displayName: 'Select XCode version'
-# Export IPA
-- script: |
- ARCHIVE_PATH="$(Build.SourcesDirectory)/output/Runner.xcarchive"
-
- # If not found at expected location, try to find it
- if [ ! -d "$ARCHIVE_PATH" ]; then
- echo "Archive not found at expected location, searching..."
- FOUND_ARCHIVE=$(find "$(Build.SourcesDirectory)" -name "*.xcarchive" -type d 2>/dev/null | head -1)
- if [ -n "$FOUND_ARCHIVE" ]; then
- echo "Found archive at: $FOUND_ARCHIVE"
- ARCHIVE_PATH="$FOUND_ARCHIVE"
- else
- echo "ERROR: No archive found!"
- exit 1
- fi
- fi
-
- echo "Using archive: $ARCHIVE_PATH"
-
- # Create output directory
- mkdir -p "$(Build.SourcesDirectory)/output/ipa"
-
- xcodebuild -exportArchive \
- -archivePath "$ARCHIVE_PATH" \
- -exportPath "$(Build.SourcesDirectory)/output/ipa" \
- -exportOptionsPlist "$(Build.SourcesDirectory)/comwell_key_app/ios/$(iosExportOptionsPlist)" \
- -allowProvisioningUpdates
- displayName: 'Export IPA'
-
-- script: ls -lR $(Build.SourcesDirectory)/output/ipa
+- task: FlutterBuild@0
+ displayName: "Build app"
+ inputs:
+ buildNumber: "$(Build.BuildId)"
+ target: "ios"
+ buildFlavour: $(flavor)
+ projectDirectory: "$(Build.SourcesDirectory)/comwell_key_app"
+ iosCodesign: false
+ exportOptionsPlist: "$(Build.SourcesDirectory)/comwell_key_app/ios/$(iosExportOptionsPlist)"
+
+- task: Xcode@5
+ displayName: "Archive app"
+ inputs:
+ actions: "archive" # Make sure to use the correct scheme that includes the custom XCFramework
+ configuration: "$(iosConfiguration)"
+ xcWorkspacePath: "$(Build.SourcesDirectory)/comwell_key_app/ios/Runner.xcworkspace"
+ packageApp: true
+ args: "-verbose"
+ signingOption: "manual"
+ signingIdentity: "$(APPLE_CERTIFICATE_SIGNING_IDENTITY)"
+ provisioningProfileUuid: "$(APPLE_PROV_PROFILE_UUID)"
+
+- script: ls -lR comwell_key_app/build/ios/ipa
displayName: 'List IPA output directory'
- task: PublishBuildArtifacts@1
inputs:
- PathtoPublish: '$(Build.SourcesDirectory)/output/ipa'
+ PathtoPublish: 'comwell_key_app/build/ios/ipa'
ArtifactName: 'ios-ipa'
publishLocation: 'Container'
# (Optional) Publish artifact
@@ -180,6 +122,6 @@ steps:
appIdentifier: $(iosBundleId)
serviceEndpoint: "Apple"
appType: 'iOS'
- ipaPath: '$(Build.SourcesDirectory)/output/ipa/*.ipa'
+ ipaPath: 'comwell_key_app/build/ios/ipa/*.ipa'
shouldSkipWaitingForProcessing: true
shouldSkipSubmission: true