diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 38d86bc9..1d27a714 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,38 +1,4 @@ -trigger: - branches: - include: - - master - - release/beta/* - - release/stable/* - - feature/* - -pr: - branches: - include: - - master - - release/beta/* - - release/stable/* - -variables: - # Pool names - windowsPoolName: 'windows 1809' - macOSPoolName: 'Default' - - # Nuget Version to use - NUGET_VERSION: 5.4.0 - - # Solution to build - SolutionFileName: Uno.Material.sln - - # name of the folder where artefacts will be placed. Variable used in build and release phases. - # We make seperate folders so that releases can each download only the folder they need. - NugetPackagesArtifactName: Packages - AndroidArtifactName: Android - iOSArtifactName: iOS - UWPArtifactName: UWP - macOSArtifactName: macOS - WASMArtifactName: WASM - +variables: # Path where packages (nuget or app packages) will be copied to. PackageOutputPath: $(Build.ArtifactStagingDirectory) @@ -42,148 +8,72 @@ variables: # For release conditions IsReleaseBranch: $[or(eq(variables['Build.SourceBranch'], 'refs/heads/master'), startsWith(variables['Build.SourceBranch'], 'refs/heads/feature/'), startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'))] - # Android configurations - ANDROID_NDK_HOME: C:\Microsoft\AndroidNDK64\android-ndk-r16b - ANDROID_NDK_PATH: C:\Microsoft\AndroidNDK64\android-ndk-r16b - AndroidNdkDirectory: C:\Microsoft\AndroidNDK64\android-ndk-r16b +jobs: +- job: Windows # Build UWP/Android/NuGet + strategy: + maxParallel: 3 + matrix: + UWP: + ApplicationPlatform: UWP_x64 + ArtifactName: UWP + Android: + ApplicationPlatform: Android + ArtifactName: Android + Packages: + ApplicationPlatform: Packages + GeneratePackageOnBuild: true + ArtifactName: Packages + pool: + vmImage: windows-2019 - # Optional, specifiy xcode and xamarin versions. See ios-build-select-version.yml if needed. - # xCodeRoot: '/Applications/Xcode_11.3.app' - # XamarinSDKVersion: 6_6_0 - - # Configuration requirements on the azure devops pipeline - # Those variables must be configured in the AzureDevops Library - #### iOS #### - ## Secure files: - # distribution certificate (.p12) - # distribution provisioning profile (.mobileprovision) - - ## Variable group containing : "group: apple.appstore.distribution" - # $(appleappstorecertificatepassword) : password for the p12 certificate (this is marked private in azdo) - # $(UnoMaterialStoreProvisioningProfileName) : Name of the .mobileprovision file in the secure files. - # $(appleTeamId) : id of the apple team (Required if the secure connection used has access to more than one team, which is often the case) - # $(appleTeamName) : name of the apple developer team. (Required if the secure connection used has access to more than one team, which is often the case) - ## Code to update below - # In InstallAppleCertificate@ task: Set the value for certSecureFile - # In InstallAppleProvisioningProfile@ task: Set the value for provProfileSecureFile - # In stage-release-testflight.yml, AppStoreRelease : Set the name of the service connection and the identifier of the app (aka the Bundle ID) - -stages: -- stage: Build - jobs: - - job: Build_on_Windows # Build samples possible on a windows machine and nuget packages - strategy: - maxParallel: 3 - matrix: - Android: - ApplicationConfiguration: Release - ApplicationPlatform: Android - ArtifactName: $(AndroidArtifactName) - UWP: - ApplicationConfiguration: Release - ApplicationPlatform: UWP_x64 - ArtifactName: $(UWPArtifactName) - Packages: - ApplicationConfiguration: Release - ApplicationPlatform: Packages - GeneratePackageOnBuild: true - ArtifactName: $(NugetPackagesArtifactName) - pool: - name: $(windowsPoolName) - - container: nventive/build-agent:vs16.6.0 - - steps: - - template: build/stage-build.yml - - - job: Build_on_Mac # Build iOS and macOS samples - strategy: - maxParallel: 3 - matrix: - iOS: - ApplicationConfiguration: Release - ApplicationPlatform: iPhone - ArtifactName: $(iOSArtifactName) - macOS: - ApplicationConfiguration: Release - ApplicationPlatform: macOS - ArtifactName: $(macOSArtifactName) - pool: - name: $(macOSPoolName) - demands: - - Xamarin.iOS -equals 13.16 - - variables: - - name: SkipUnknownFrameworks - value: true # Used by TargetFrameworks.Filtering package to build only what's possible on a mac for the multitargeted library - - group: apple.appstore.distribution # Import all variables for certificate from the library in azure devops - - steps: - - task: InstallAppleCertificate@2 - displayName: Install Apple Certificate - inputs: - certSecureFile: 'apple.appstore.distribution.p12' # Name of the p12 certificate in the secure files (in azure devops library) - certPwd: '$(appleappstorecertificatepassword)' - keychain: 'temp' - deleteCert: true - - - task: InstallAppleProvisioningProfile@1 - displayName: 'Install Apple Provisioning Profile' - inputs: - provisioningProfileLocation: 'secureFiles' - provProfileSecureFile: 'UnoMaterial.mobileprovision' # Name of the .mobileprovision file in the secure files. - - - task: UseDotNet@2 - displayName: 'Install .Net Core runtime 2.1.x' - inputs: - version: 2.1.x - packageType: 'runtime' - installationPath: '$(Agent.ToolsDirectory)/dotnet' - + steps: - template: build/stage-build.yml - - job: Build_Wasm - container: unoplatform/wasm-build:2.2 - - pool: - vmImage: 'ubuntu-18.04' - - variables: - NUGET_PACKAGES: $(build.sourcesdirectory)/.nuget - SkipUnknowFrameworks: True - ArtifactName: $(WASMArtifactName) - - steps: - - template: build/stage-build-wasm.yml - -- stage: Release_Nuget - # Only release when the build is not a Pull Request and it's using one of the proper release branches - condition: and(succeeded(), ne(variables['IsLightBuild'], 'true'), eq(variables['IsReleaseBranch'], 'true')) - dependsOn: Build - - jobs: - - template: build/stage-release-nuget.yml - -- stage: Release_AppCenter - # Only release when the build is not a Pull Request and it's using one of the proper release branches - condition: and(succeeded(), ne(variables['IsLightBuild'], 'true'), eq(variables['IsReleaseBranch'], 'true')) - dependsOn: Build - - jobs: - - template: build/stage-release-appcenter.yml - -- stage: Release_TestFlight - # Only release when the build is not a Pull Request and it's using one of the proper release branches - condition: and(succeeded(), ne(variables['IsLightBuild'], 'true'), eq(variables['IsReleaseBranch'], 'true')) - dependsOn: Build +- job: MacOS # Build iOS/macOS + strategy: + maxParallel: 2 + matrix: + iOS: + ApplicationPlatform: iPhone + ArtifactName: iOS + macOS: + ApplicationPlatform: macOS + ArtifactName: macOS + pool: + vmImage: macOS-10.15 - jobs: - - template: build/stage-release-testflight.yml + variables: + - name: SkipUnknownFrameworks + value: true # Used by TargetFrameworks.Filtering package + - group: apple.appstore.distribution # Variables for certificate -- stage: Release_WASM - # Only release when the build is not a Pull Request and it's using one of the proper release branches - condition: and(succeeded(), ne(variables['IsLightBuild'], 'true'), eq(variables['IsReleaseBranch'], 'true')) - dependsOn: Build + steps: + - task: InstallAppleCertificate@2 + displayName: Install Apple Certificate + inputs: + certSecureFile: 'apple.appstore.distribution.p12' # Name of the p12 certificate + certPwd: '$(appleappstorecertificatepassword)' + keychain: 'temp' + deleteCert: true + + - task: InstallAppleProvisioningProfile@1 + displayName: 'Install Apple Provisioning Profile' + inputs: + provisioningProfileLocation: 'secureFiles' + provProfileSecureFile: 'UnoMaterial.mobileprovision' - jobs: - - template: build/stage-release-wasm.yml + - template: build/stage-build.yml + +- job: Linux + + pool: + vmImage: 'ubuntu-18.04' + + container: unoplatform/wasm-build:2.2 + + variables: + ArtifactName: WASM + SkipUnknownFrameworks: True + + steps: + - template: build/stage-build-wasm.yml diff --git a/build/stage-build-wasm.yml b/build/stage-build-wasm.yml index 60702996..71b07f6a 100644 --- a/build/stage-build-wasm.yml +++ b/build/stage-build-wasm.yml @@ -10,26 +10,21 @@ - task: UseGitVersion@5 inputs: versionSpec: '5.x' + useConfigFile: true + configFilePath: 'build/gitversion.yml' updateAssemblyInfo: 'False' - - task: Bash@3 - inputs: - targetType: inline - script: | - source ~/emsdk/emsdk_env.sh - msbuild /r /p:Configuration=Release /p:ApplicationVersion=$(USEGITVERSION.GITVERSION.MAJORMINORPATCH) $(build.sourcesdirectory)/src/samples/Uno.Material.Samples/Uno.Material.Samples.Wasm/Uno.Material.Samples.Wasm.csproj + - bash: | + source ~/emsdk/emsdk_env.sh + msbuild /r /p:Configuration=Release /p:ApplicationVersion=$(USEGITVERSION.GITVERSION.MAJORMINORPATCH) src/samples/Uno.Material.Samples/Uno.Material.Samples.Wasm/Uno.Material.Samples.Wasm.csproj - task: CopyFiles@2 displayName: 'Copy version information' inputs: - Contents: $(build.sourcesdirectory)/src/samples/Uno.Material.Samples/Uno.Material.Samples.Wasm/Version.txt + Contents: src/samples/Uno.Material.Samples/Uno.Material.Samples.Wasm/Version.txt TargetFolder: $(build.artifactstagingdirectory) flattenFolders: true - task: PublishBuildArtifacts@1 - # https://developercommunity.visualstudio.com/content/problem/284991/public-vsts-previouw-cant-set-build-number-of-pr-b.html - condition: eq(variables['System.PullRequest.IsFork'], 'False') inputs: - PathtoPublish: $(build.artifactstagingdirectory) ArtifactName: $(ArtifactName) - ArtifactType: Container \ No newline at end of file diff --git a/build/stage-build.yml b/build/stage-build.yml index 6562395d..f5a16021 100644 --- a/build/stage-build.yml +++ b/build/stage-build.yml @@ -8,32 +8,26 @@ inputs: useConfigFile: true configFilePath: 'build/gitversion.yml' - displayName: 'Calculate version' - -- task: NuGetToolInstaller@0 - displayName: 'Install NuGet $(NUGET_VERSION)' - inputs: - versionSpec: $(NUGET_VERSION) - checkLatest: false + displayName: 'Calculate SemVer' - task: NuGetCommand@2 - displayName: 'Restore solution packages' + displayName: 'Restore NuGet packages' inputs: command: restore - solution: $(Build.SourcesDirectory)/$(SolutionFileName) + solution: Uno.Material.sln feedsToUse: 'config' nugetConfigPath: 'nuget.config' verbosityRestore: Normal noCache: true - task: MSBuild@1 - displayName: 'Build solution in $(ApplicationConfiguration) | $(ApplicationPlatform)' + displayName: 'Build solution in Release | $(ApplicationPlatform)' inputs: - solution: $(Build.SourcesDirectory)/$(SolutionFileName) + solution: Uno.Material.sln msbuildLocationMethod: version msbuildVersion: latest msbuildArchitecture: x86 - configuration: $(ApplicationConfiguration) + configuration: Release platform: $(ApplicationPlatform) clean: false maximumCpuCount: true @@ -43,9 +37,6 @@ msbuildArguments: /p:PackageVersion=$(SemVer) /p:ApplicationVersion=$(MajorMinorPatch) - task: PublishBuildArtifacts@1 - displayName: 'Publish artifact $(ApplicationConfiguration) | $(ApplicationPlatform)' + displayName: 'Publish artifact' inputs: - PathtoPublish: $(PackageOutputPath) ArtifactName: $(ArtifactName) - ArtifactType: Container - diff --git a/build/stage-release-appcenter.yml b/build/stage-release-appcenter.yml deleted file mode 100644 index 804b97bc..00000000 --- a/build/stage-release-appcenter.yml +++ /dev/null @@ -1,104 +0,0 @@ -jobs: -- job: Publish_AppCenter_UWA - pool: $(windowsPoolName) - - container: nventive/build-agent:vs16.6.0 - - steps: - - checkout: none - - - task: DownloadBuildArtifacts@0 - inputs: - buildType: current - downloadType: single - artifactName: $(UWPArtifactName) - - - task: AppCenterDistribute@3 - displayName: Deploy UWP to AppCenter - inputs: - serverEndpoint: AppCenter - appSlug: 'nventive/Uno-Material-UWP' - appFile: $(System.ArtifactsDirectory)/$(UWPArtifactName)/*.msixbundle - releaseNotesInput: | - Uno Material - isSilent: true - -- job: Publish_AppCenter_iOS - pool: - name: $(macOSPoolName) - demands: - - fastlane - - variables: - - group: apple.appstore.distribution # Import all variables for certificate from the library in azure devops - - steps: - - checkout: none - - - task: DownloadBuildArtifacts@0 - inputs: - buildType: current - downloadType: single - artifactName: $(iOSArtifactName) - - - task: InstallAppleCertificate@2 - displayName: Install Apple Certificate - name: Certificate - inputs: - certSecureFile: 'apple.appstore.distribution.p12' # Name of the p12 certificate in the secure files (in azure devops pipeline) - certPwd: '$(appleappstorecertificatepassword)' - keychain: 'temp' - deleteCert: true - - - task: InstallAppleProvisioningProfile@1 - displayName: 'Install Apple Provisioning Profile' - name: Profile - inputs: - provisioningProfileLocation: 'secureFiles' - provProfileSecureFile: 'UnoMaterial__Ad_Hoc.mobileprovision' # Name of the .mobileprovision file in the secure files. - - - task: IpaResign@1 - displayName: 'Resign IPA with latest certificates' - inputs: - ipaPath: '$(System.ArtifactsDirectory)/$(iOSArtifactName)/*.ipa' - signMethod: id - signIdIdentity: '$(Certificate.signingIdentity)' - provisionMethod: id - provIdProfileUuid: '$(Profile.provisioningProfileUuid)' - installFastlane: false - - - task: AppCenterDistribute@3 - displayName: Deploy iOS to AppCenter - inputs: - serverEndpoint: AppCenter - appSlug: 'nventive/Uno-Material-iOS' - appFile: $(System.ArtifactsDirectory)/$(iOSArtifactName)/*.ipa - symbolsDsymFiles: $(System.ArtifactsDirectory)/$(iOSArtifactName)/*.dSYM - symbolsIncludeParentDirectory: true - releaseNotesInput: | - Uno Material - isSilent: true - -- job: Publish_AppCenter_Android - pool: $(windowsPoolName) - - container: nventive/build-agent:vs16.6.0 - - steps: - - checkout: none - - - task: DownloadBuildArtifacts@0 - inputs: - buildType: current - downloadType: single - artifactName: $(AndroidArtifactName) - - - task: AppCenterDistribute@3 - displayName: Deploy Android to AppCenter - inputs: - serverEndpoint: AppCenter - appSlug: 'nventive/Uno-Material-Android' - appFile: $(System.ArtifactsDirectory)/$(AndroidArtifactName)/*.material-Signed.apk - releaseNotesInput: | - Uno Material - isSilent: true \ No newline at end of file diff --git a/build/stage-release-nuget.yml b/build/stage-release-nuget.yml deleted file mode 100644 index 97f511dc..00000000 --- a/build/stage-release-nuget.yml +++ /dev/null @@ -1,29 +0,0 @@ -jobs: -- job: Publish_NuGet_Internal - - pool: - name: $(windowsPoolName) - - container: nventive/build-agent:vs16.6.0 - - steps: - - checkout: none - - - task: DownloadBuildArtifacts@0 - inputs: - buildType: current - downloadType: single - artifactName: $(NugetPackagesArtifactName) - - - task: NuGetToolInstaller@0 - displayName: 'Install NuGet $(NUGET_VERSION)' - inputs: - versionSpec: $(NUGET_VERSION) - checkLatest: false - - - task: NuGetCommand@2 - inputs: - command: 'push' - packagesToPush: '$(Build.ArtifactStagingDirectory)/$(NugetPackagesArtifactName)/*.nupkg' - nuGetFeedType: 'internal' - publishVstsFeed: 'nventive' \ No newline at end of file diff --git a/build/stage-release-testflight.yml b/build/stage-release-testflight.yml deleted file mode 100644 index b104322d..00000000 --- a/build/stage-release-testflight.yml +++ /dev/null @@ -1,31 +0,0 @@ -jobs: -- job: Publish_TestFlight_iOS - - pool: - name: $(macOSPoolName) - demands: - - Xamarin.iOS -equals 13.16 - - variables: - - group: apple.appstore.distribution # import all variables for certificate from the library in azure devops - - steps: - - checkout: none - - - task: DownloadBuildArtifacts@0 - inputs: - buildType: current - downloadType: single - artifactName: $(iOSArtifactName) - - - task: AppStoreRelease@1 - displayName: 'Push to TestFlight' - inputs: - serviceEndpoint: 'apple appstore connection' - appIdentifier: 'uno.platform.material' - appType: 'iOS' - ipaPath: '$(PackageOutputPath)/$(iOSArtifactName)/Uno.Material.Samples.ipa' - releaseTrack: 'TestFlight' - shouldSkipWaitingForProcessing: true - teamId: $(appleTeamId) - teamName: $(appleTeamName) \ No newline at end of file diff --git a/build/stage-release-wasm.yml b/build/stage-release-wasm.yml deleted file mode 100644 index c279839d..00000000 --- a/build/stage-release-wasm.yml +++ /dev/null @@ -1,20 +0,0 @@ -jobs: -- job: Publish_WASM - pool: - vmImage: windows-2019 - - steps: - - checkout: none - - - task: DownloadBuildArtifacts@0 - inputs: - buildType: current - downloadType: single - artifactName: $(WASMArtifactName) - - - task: nventivecorp.nventive.nventive.websiteVersion.websiteVersion@5 - displayName: 'Deploy Uno Material to Azure' - inputs: - WebsitePath: '$(System.ArtifactsDirectory)/$(WASMArtifactName)' - AzureSubscription: 'Uno Platform' - AzureStorageAccount: unomaterial \ No newline at end of file diff --git a/build/templates/ios-build-select-version.yml b/build/templates/ios-build-select-version.yml deleted file mode 100644 index 03786597..00000000 --- a/build/templates/ios-build-select-version.yml +++ /dev/null @@ -1,13 +0,0 @@ -parameters: - xCodeRoot: '' - XamarinSDKVersion: '' - -steps: - - bash: > - /bin/bash -c "sudo $AGENT_HOMEDIRECTORY/scripts/select-xamarin-sdk.sh ${{parameters.XamarinSDKVersion}}" - displayName: Select Xamarin Version - - bash: | - echo 'xCode Root to ${{parameters.xCodeRoot}}' - echo '##vso[task.setvariable variable=MD_APPLE_SDK_ROOT;]'${{parameters.xCodeRoot}} - sudo xcode-select --switch ${{parameters.xCodeRoot}}/Contents/Developer - displayName: Select Xcode \ No newline at end of file