-
Notifications
You must be signed in to change notification settings - Fork 162
[WIP][CIAM Cred Mgmt] PR3 — Release pipeline setup (SPM) #3009
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
base: sedemche/ciam-cred-managment-release
Are you sure you want to change the base?
Changes from all commits
574c28d
21c135b
b3c46b8
f88064a
ebd1ecf
e50afb1
c9636ee
97f92af
e5dc052
fabcb67
ec11dc8
4eb320d
bf9edcb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,289 @@ | ||
| # ============================================================================= | ||
| # MSALNativeCredManagment SDK — Release Pipeline (SPM + XCFramework) | ||
| # ============================================================================= | ||
| # | ||
| # This pipeline builds the credential management SDK for release distribution. | ||
| # | ||
| # Triggers: | ||
| # - Tag push matching 'credmgmt/*' (e.g., credmgmt/1.0.0) | ||
| # | ||
| # Stages: | ||
| # 1. PR Validation — Build iOS + macOS, run unit tests, validate SPM resolution | ||
| # 2. Build Release — Create versioned XCFramework artifact | ||
| # 3. Publish — Attach XCFramework to pipeline artifacts | ||
| # | ||
| # Distribution: Swift Package Manager only (no CocoaPods). | ||
| # ============================================================================= | ||
|
|
||
| trigger: | ||
| tags: | ||
| include: | ||
| - 'credmgmt/*' | ||
| branches: | ||
| include: | ||
| - sedemche/ciam-cred-managment-release | ||
|
|
||
| pr: | ||
| branches: | ||
| include: | ||
| - sedemche/ciam-cred-managment-release | ||
|
|
||
| variables: | ||
| SDK_PATH: 'lib/native/MSALNativeCredManagment' | ||
| XCODE_VERSION: '16.2' | ||
| XCFRAMEWORK_OUTPUT: '$(Build.ArtifactStagingDirectory)/MSALNativeCredManagment.xcframework' | ||
|
|
||
| stages: | ||
|
|
||
| # ============================================================================= | ||
| # Stage 1: Validate — Build & Test | ||
| # ============================================================================= | ||
| - stage: Validate | ||
| displayName: 'Validate SDK (Build + Test)' | ||
| jobs: | ||
|
|
||
| - job: Build_iOS | ||
| displayName: 'Build & Test — iOS' | ||
| pool: | ||
| vmImage: 'macOS-14' | ||
| timeoutInMinutes: 30 | ||
| steps: | ||
| - checkout: self | ||
| clean: true | ||
| submodules: true | ||
| fetchDepth: 1 | ||
|
|
||
| - script: | | ||
| sudo xcode-select -s /Applications/Xcode_$(XCODE_VERSION).app | ||
| displayName: 'Select Xcode $(XCODE_VERSION)' | ||
|
|
||
| - script: | | ||
| cd $(SDK_PATH) | ||
| xcodebuild -resolvePackageDependencies \ | ||
| -scheme MSALNativeCredManagment \ | ||
| -clonedSourcePackagesDirPath $(Build.BinariesDirectory)/spm-packages | ||
| displayName: 'Resolve iOS Package Dependencies' | ||
|
|
||
| - script: | | ||
| cd $(SDK_PATH) | ||
| xcodebuild build-for-testing \ | ||
| -scheme MSALNativeCredManagment \ | ||
| -destination 'platform=iOS Simulator,name=iPhone 16,OS=latest' \ | ||
| -derivedDataPath $(Build.BinariesDirectory)/ios \ | ||
| -clonedSourcePackagesDirPath $(Build.BinariesDirectory)/spm-packages \ | ||
| | xcpretty | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Without |
||
| displayName: 'Build iOS' | ||
|
|
||
| - script: | | ||
| cd $(SDK_PATH) | ||
| xcodebuild test-without-building \ | ||
| -scheme MSALNativeCredManagment \ | ||
| -destination 'platform=iOS Simulator,name=iPhone 16,OS=latest' \ | ||
| -derivedDataPath $(Build.BinariesDirectory)/ios \ | ||
| -clonedSourcePackagesDirPath $(Build.BinariesDirectory)/spm-packages \ | ||
| -resultBundlePath $(Build.ArtifactStagingDirectory)/TestResults-iOS.xcresult \ | ||
| | xcpretty --report junit --output $(Build.ArtifactStagingDirectory)/test-results-ios.xml | ||
| displayName: 'Run Unit Tests — iOS' | ||
| continueOnError: true | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Test failures are explicitly allowed here, so the Release stage can publish an XCFramework after failed tests. Remove |
||
|
|
||
| - task: PublishTestResults@2 | ||
| condition: always() | ||
| displayName: 'Publish iOS Test Results' | ||
| inputs: | ||
| testResultsFormat: 'JUnit' | ||
| testResultsFiles: '$(Build.ArtifactStagingDirectory)/test-results-ios.xml' | ||
| testRunTitle: 'CredManagement iOS Tests' | ||
|
|
||
| - job: Build_macOS | ||
| displayName: 'Build & Test — macOS' | ||
| pool: | ||
| vmImage: 'macOS-14' | ||
| timeoutInMinutes: 30 | ||
| steps: | ||
| - checkout: self | ||
| clean: true | ||
| submodules: true | ||
| fetchDepth: 1 | ||
|
|
||
| - script: | | ||
| sudo xcode-select -s /Applications/Xcode_$(XCODE_VERSION).app | ||
| displayName: 'Select Xcode $(XCODE_VERSION)' | ||
|
|
||
| - script: | | ||
| cd $(SDK_PATH) | ||
| xcodebuild -resolvePackageDependencies \ | ||
| -scheme MSALNativeCredManagment \ | ||
| -clonedSourcePackagesDirPath $(Build.BinariesDirectory)/spm-packages | ||
| displayName: 'Resolve macOS Package Dependencies' | ||
|
|
||
| - script: | | ||
| cd $(SDK_PATH) | ||
| xcodebuild build \ | ||
| -scheme MSALNativeCredManagment \ | ||
| -destination 'platform=macOS' \ | ||
| -derivedDataPath $(Build.BinariesDirectory)/macos \ | ||
| -clonedSourcePackagesDirPath $(Build.BinariesDirectory)/spm-packages \ | ||
| CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO | ||
| displayName: 'Build macOS' | ||
|
|
||
| - script: | | ||
| cd $(SDK_PATH) | ||
| xcodebuild test \ | ||
| -scheme MSALNativeCredManagment \ | ||
| -destination 'platform=macOS' \ | ||
| -derivedDataPath $(Build.BinariesDirectory)/macos \ | ||
| -clonedSourcePackagesDirPath $(Build.BinariesDirectory)/spm-packages \ | ||
| -resultBundlePath $(Build.ArtifactStagingDirectory)/TestResults-macOS.xcresult \ | ||
| CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO \ | ||
| | xcpretty --report junit --output $(Build.ArtifactStagingDirectory)/test-results-macos.xml | ||
| displayName: 'Run Unit Tests — macOS' | ||
| continueOnError: true | ||
|
|
||
| - task: PublishTestResults@2 | ||
| condition: always() | ||
| displayName: 'Publish macOS Test Results' | ||
| inputs: | ||
| testResultsFormat: 'JUnit' | ||
| testResultsFiles: '$(Build.ArtifactStagingDirectory)/test-results-macos.xml' | ||
| testRunTitle: 'CredManagement macOS Tests' | ||
|
|
||
| - job: Validate_SPM | ||
| displayName: 'Validate SPM Resolution' | ||
| pool: | ||
| vmImage: 'macOS-14' | ||
| timeoutInMinutes: 15 | ||
| steps: | ||
| - checkout: self | ||
| clean: true | ||
| submodules: true | ||
| fetchDepth: 1 | ||
|
|
||
| - script: | | ||
| sudo xcode-select -s /Applications/Xcode_$(XCODE_VERSION).app | ||
| displayName: 'Select Xcode $(XCODE_VERSION)' | ||
|
|
||
| - script: | | ||
| cd $(SDK_PATH) | ||
| swift package resolve | ||
| displayName: 'SPM — Resolve Dependencies' | ||
|
|
||
| - script: | | ||
| cd $(SDK_PATH) | ||
| swift build | ||
| displayName: 'SPM — Build (Debug)' | ||
|
|
||
| - script: | | ||
| cd $(SDK_PATH) | ||
| swift build -c release | ||
| displayName: 'SPM — Build (Release)' | ||
|
|
||
| # ============================================================================= | ||
| # Stage 2: Release — Build XCFramework | ||
| # ============================================================================= | ||
| - stage: Release | ||
| displayName: 'Build XCFramework' | ||
| dependsOn: Validate | ||
| condition: succeeded() | ||
| jobs: | ||
|
|
||
| - job: Build_XCFramework | ||
| displayName: 'Archive & Create XCFramework' | ||
| pool: | ||
| vmImage: 'macOS-14' | ||
| timeoutInMinutes: 45 | ||
| steps: | ||
| - checkout: self | ||
| clean: true | ||
| submodules: true | ||
| fetchDepth: 1 | ||
|
|
||
| - script: | | ||
| sudo xcode-select -s /Applications/Xcode_$(XCODE_VERSION).app | ||
| displayName: 'Select Xcode $(XCODE_VERSION)' | ||
|
|
||
| # Extract version from tag (credmgmt/1.0.0 → 1.0.0) or use 'dev' for branch builds | ||
| - script: | | ||
| if [[ "$(Build.SourceBranch)" == refs/tags/credmgmt/* ]]; then | ||
| TAG_NAME=$(echo "$(Build.SourceBranchName)") | ||
| echo "##vso[task.setvariable variable=SDK_VERSION]${TAG_NAME}" | ||
| echo "SDK Version: ${TAG_NAME}" | ||
| else | ||
| echo "##vso[task.setvariable variable=SDK_VERSION]dev-$(Build.BuildNumber)" | ||
| echo "SDK Version: dev-$(Build.BuildNumber)" | ||
| fi | ||
| displayName: 'Extract Version' | ||
|
|
||
| - script: | | ||
| cd $(SDK_PATH) | ||
| xcodebuild -resolvePackageDependencies \ | ||
| -scheme MSALNativeCredManagment \ | ||
| -clonedSourcePackagesDirPath $(Build.BinariesDirectory)/spm-packages | ||
| displayName: 'Resolve Package Dependencies' | ||
|
|
||
| # Archive for iOS device | ||
| - script: | | ||
| cd $(SDK_PATH) | ||
| xcodebuild archive \ | ||
| -scheme MSALNativeCredManagment \ | ||
| -destination 'generic/platform=iOS' \ | ||
| -archivePath $(Build.BinariesDirectory)/archives/ios.xcarchive \ | ||
| -clonedSourcePackagesDirPath $(Build.BinariesDirectory)/spm-packages \ | ||
| SKIP_INSTALL=NO \ | ||
| BUILD_LIBRARY_FOR_DISTRIBUTION=YES \ | ||
| CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO | ||
| displayName: 'Archive — iOS Device' | ||
|
|
||
| # Archive for iOS Simulator | ||
| - script: | | ||
| cd $(SDK_PATH) | ||
| xcodebuild archive \ | ||
| -scheme MSALNativeCredManagment \ | ||
| -destination 'generic/platform=iOS Simulator' \ | ||
| -archivePath $(Build.BinariesDirectory)/archives/ios-simulator.xcarchive \ | ||
| -clonedSourcePackagesDirPath $(Build.BinariesDirectory)/spm-packages \ | ||
| SKIP_INSTALL=NO \ | ||
| BUILD_LIBRARY_FOR_DISTRIBUTION=YES \ | ||
| CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO | ||
| displayName: 'Archive — iOS Simulator' | ||
|
|
||
| # Archive for macOS | ||
| - script: | | ||
| cd $(SDK_PATH) | ||
| xcodebuild archive \ | ||
| -scheme MSALNativeCredManagment \ | ||
| -destination 'generic/platform=macOS' \ | ||
| -archivePath $(Build.BinariesDirectory)/archives/macos.xcarchive \ | ||
| -clonedSourcePackagesDirPath $(Build.BinariesDirectory)/spm-packages \ | ||
| SKIP_INSTALL=NO \ | ||
| BUILD_LIBRARY_FOR_DISTRIBUTION=YES \ | ||
| CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO | ||
| displayName: 'Archive — macOS' | ||
|
|
||
| # Create XCFramework from all archives | ||
| - script: | | ||
| xcodebuild -create-xcframework \ | ||
| -framework $(Build.BinariesDirectory)/archives/ios.xcarchive/Products/Library/Frameworks/MSALNativeCredManagment.framework \ | ||
| -framework $(Build.BinariesDirectory)/archives/ios-simulator.xcarchive/Products/Library/Frameworks/MSALNativeCredManagment.framework \ | ||
| -framework $(Build.BinariesDirectory)/archives/macos.xcarchive/Products/Library/Frameworks/MSALNativeCredManagment.framework \ | ||
| -output $(XCFRAMEWORK_OUTPUT) | ||
| displayName: 'Create XCFramework' | ||
|
|
||
| # Zip for distribution | ||
| - script: | | ||
| cd $(Build.ArtifactStagingDirectory) | ||
| zip -r MSALNativeCredManagment-$(SDK_VERSION).xcframework.zip MSALNativeCredManagment.xcframework | ||
| displayName: 'Zip XCFramework' | ||
|
|
||
| - task: PublishBuildArtifacts@1 | ||
| displayName: 'Publish XCFramework Artifact' | ||
| inputs: | ||
| pathToPublish: '$(Build.ArtifactStagingDirectory)/MSALNativeCredManagment-$(SDK_VERSION).xcframework.zip' | ||
| artifactName: 'MSALNativeCredManagment-XCFramework' | ||
| publishLocation: 'Container' | ||
|
|
||
| - task: PublishBuildArtifacts@1 | ||
| displayName: 'Publish Raw XCFramework' | ||
| inputs: | ||
| pathToPublish: '$(XCFRAMEWORK_OUTPUT)' | ||
| artifactName: 'MSALNativeCredManagment-XCFramework-Raw' | ||
| publishLocation: 'Container' | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| ## [0.1.0] | ||
| * Initial implementation of MSAL Native Credential Management SDK. | ||
| * Add credential method support for CIAM scenarios. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| // Minimal MSAL_Private module for credential management. | ||
| // Exposes IdentityCore types needed by Swift code (logger, context). | ||
| // Paths are relative to this modulemap file's location. | ||
| module MSAL_Private { | ||
| header "../../../../../MSAL/IdentityCore/IdentityCore/src/MSIDBasicContext.h" | ||
| header "../../../../../MSAL/IdentityCore/IdentityCore/src/logger/MSIDLogger.h" | ||
| header "../../../../../MSAL/IdentityCore/IdentityCore/src/logger/MSIDLogger+Internal.h" | ||
| header "../../../../../MSAL/IdentityCore/IdentityCore/src/logger/MSIDMaskedHashableLogParameter.h" | ||
| header "../../../../../MSAL/IdentityCore/IdentityCore/src/logger/MSIDMaskedLogParameter.h" | ||
| header "../../../../../MSAL/IdentityCore/IdentityCore/src/logger/MSIDMaskedUsernameLogParameter.h" | ||
| header "../../../../../MSAL/IdentityCore/IdentityCore/src/MSIDError.h" | ||
| header "../../../../../MSAL/IdentityCore/IdentityCore/src/oauth2/MSIDExternalSSOContext.h" | ||
| header "../../../../../MSAL/IdentityCore/IdentityCore/src/parameters/MSIDRequestParameters.h" | ||
| export * | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
| <plist version="1.0"> | ||
| <dict> | ||
| <key>CFBundleDevelopmentRegion</key> | ||
| <string>en</string> | ||
| <key>CFBundleExecutable</key> | ||
| <string>$(EXECUTABLE_NAME)</string> | ||
| <key>CFBundleIdentifier</key> | ||
| <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> | ||
| <key>CFBundleInfoDictionaryVersion</key> | ||
| <string>6.0</string> | ||
| <key>CFBundleName</key> | ||
| <string>$(PRODUCT_NAME)</string> | ||
| <key>CFBundlePackageType</key> | ||
| <string>FMWK</string> | ||
| <key>CFBundleShortVersionString</key> | ||
| <string>$(MARKETING_VERSION)</string> | ||
| <key>CFBundleVersion</key> | ||
| <string>$(CURRENT_PROJECT_VERSION)</string> | ||
| <key>NSPrincipalClass</key> | ||
| <string></string> | ||
| </dict> | ||
| </plist> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This pull request does not update CHANGELOG.md.
Please consider if this change would be noticeable to a partner or user and either update CHANGELOG.md or resolve this conversation.