6177214e-ce7c-49e3-99de-ff9721b26f63 — Commit 3be08a36

AuthorJakob Højgård<141220340+jaxthedwarf@users.noreply.github.com>
Date2024-08-26 21:06:32 +0200
Update build-ios.yml for Azure Pipelines

Changed files

azure/templates/build-ios.yml | 104 ++++++++++++++++++------------------------
 1 file changed, 44 insertions(+), 60 deletions(-)

Diff

diff --git a/azure/templates/build-ios.yml b/azure/templates/build-ios.yml
index 958977a1..e66bfd8e 100644
--- a/azure/templates/build-ios.yml
+++ b/azure/templates/build-ios.yml
@@ -4,16 +4,26 @@ variables:
value: releasetest
pool:
- vmImage: 'macOS-14'
+ vmImage: 'macOS-latest'
steps:
- # Download secure file from Azure library
+
+ # Install Flutter SDK
+ - script: |
+ git clone https://github.com/flutter/flutter.git -b stable --depth 1 $(Pipeline.Workspace)/flutter
+ displayName: "Install Flutter SDK"
+
+ - script: |
+ echo "$(Pipeline.Workspace)/flutter/bin" >> $GITHUB_PATH
+ displayName: "Add Flutter to PATH"
+
+ # Download and copy the .env file
- task: DownloadSecureFile@1
inputs:
secureFile: '.env'
-
- # Copy the .env file to the project directory
+
- task: CopyFiles@2
+ displayName: "Copy .env file"
inputs:
sourceFolder: '$(Agent.TempDirectory)'
contents: '**/*.env'
@@ -22,87 +32,53 @@ steps:
# Install Apple certificate for code signing
- task: InstallAppleCertificate@2
- displayName: Install certificate
+ displayName: "Install Apple Certificate"
inputs:
certSecureFile: 'cpcert.p12'
- certPwd: '$(cppwd)' # Assuming cppwd is a parameter or pipeline variable
+ certPwd: '$(cppwd)'
keychain: 'temp'
- # Install Apple provisioning profile
+ # Install provisioning profile
- task: InstallAppleProvisioningProfile@1
- displayName: Install provisioning file
+ displayName: "Install Provisioning Profile"
inputs:
provisioningProfileLocation: 'secureFiles'
provProfileSecureFile: 'CP_Test.mobileprovision'
- # Install Flutter SDK
- - task: FlutterInstall@0
- displayName: "Install Flutter SDK"
- inputs:
- mode: 'auto'
- channel: 'stable'
- version: 'latest'
-
- # Run Flutter diagnostics
-# - task: FlutterCommand@0
-# displayName: "Run Flutter diagnostics"
-# inputs:
-# projectDirectory: '.'
-# arguments: 'doctor -v'
-
- # Run custom Pigeon script
- - task: ShellScript@2
- displayName: "Run Pigeon script"
- inputs:
- scriptPath: "$(Build.SourcesDirectory)/mobilekeys_sdk_plugin/pigeon.sh"
-
- # Analyze Flutter code
-# - task: FlutterAnalyzeTask@0
-# inputs:
-# projectDirectory: '$(Build.SourcesDirectory)/comwell_key_app'
-# pubGet: true
-# extraArgs: --no-fatal-infos --no-fatal-warnings
-
# Install CocoaPods dependencies
- task: Bash@3
- displayName: "Clean Flutter build"
+ displayName: "Install CocoaPods Dependencies"
inputs:
targetType: 'inline'
script: |
- cd $(Build.SourcesDirectory)/comwell_key_app/ios
flutter pub get
+ cd $(Build.SourcesDirectory)/comwell_key_app/ios
pod install
# Copy SeosMobileKeysSDK to the Xcode project directory
- task: CopyFiles@2
- displayName: "Copy SeosMobileKeysSDK framework to Xcode project"
+ displayName: "Copy SeosMobileKeysSDK to Xcode Project"
inputs:
sourceFolder: '$(Build.SourcesDirectory)/mobilekeys_sdk_plugin/XCFrameworks/'
contents: 'SeosMobileKeysSDK.xcframework/**'
targetFolder: '$(Build.SourcesDirectory)/comwell_key_app/ios/Frameworks/'
flattenFolders: false
+ # Ensure SeosMobileKeysSDK is linked properly
- task: Bash@3
- displayName: "Ensure SeosMobileKeysSDK is linked"
+ displayName: "Ensure SeosMobileKeysSDK is Linked"
inputs:
targetType: 'inline'
script: |
- cd $(Build.SourcesDirectory)/comwell_key_app/ios/
+ cd $(Build.SourcesDirectory)/comwell_key_app/ios
if [ ! -d "Frameworks/SeosMobileKeysSDK.xcframework" ]; then
echo "Error: SeosMobileKeysSDK.xcframework not found!"
exit 1
fi
# Build the iOS application
- - task: FlutterCommand@0
- displayName: "Build Flutter iOS project"
- inputs:
- projectDirectory: '$(Build.SourcesDirectory)/comwell_key_app'
- arguments: 'build ios --no-codesign --flavor=$(flavor) --build-name=1.0.0 --build-number=1'
-
- # Code Sign ipa for Distribution
- task: Xcode@5
- displayName: "Code Sign ipa for Distribution"
+ displayName: "Build and Sign iOS App"
inputs:
actions: "build"
scheme: "$(flavor)" # Ensure this uses the correct scheme
@@ -114,27 +90,35 @@ steps:
signingOption: "manual"
signingIdentity: "$(APPLE_CERTIFICATE_SIGNING_IDENTITY)"
provisioningProfileUuid: "$(APPLE_PROV_PROFILE_UUID)"
+ args: |
+ OTHER_LDFLAGS="$(inherited) -framework SeosMobileKeysSDK"
+ FRAMEWORK_SEARCH_PATHS="$(Build.SourcesDirectory)/comwell_key_app/ios/Frameworks"
+ SWIFT_INCLUDE_PATHS="$(Build.SourcesDirectory)/comwell_key_app/ios/Frameworks/SeosMobileKeysSDK.xcframework"
- # Uncomment to run unit tests
- # - task: FlutterTest@0
- # displayName: "Run unit tests"
- # inputs:
- # generateCodeCoverageReport: true
- # projectDirectory: '$(Build.SourcesDirectory)'
+ # Verify that the framework is included in the build
+ - task: Bash@3
+ displayName: "Verify Framework Inclusion"
+ inputs:
+ targetType: 'inline'
+ script: |
+ if ! nm $(Build.SourcesDirectory)/comwell_key_app/build/ios/Release-iphoneos/Runner.app/Runner | grep -q SeosMobileKeysSDK; then
+ echo "Error: SeosMobileKeysSDK framework not included in the build!"
+ exit 1
+ fi
- # Copy app to staging directory
+ # Copy the IPA to staging directory
- task: CopyFiles@2
- displayName: "Copy app to staging directory"
+ displayName: "Copy IPA to Staging Directory"
inputs:
sourceFolder: '$(Agent.BuildDirectory)'
contents: '**/ipa/*.ipa'
targetFolder: '$(Build.StagingDirectory)'
flattenFolders: true
- # Publish IPA file
+ # Publish the IPA file
- task: PublishBuildArtifacts@1
- displayName: "Publish IPA file"
+ displayName: "Publish IPA File"
inputs:
PathtoPublish: '$(Build.StagingDirectory)'
ArtifactName: 'IPA'
- publishLocation: 'Container'
\ No newline at end of file
+ publishLocation: 'Container'