diff --git a/eng/pipelines/common/device-tests-steps.yml b/eng/pipelines/common/device-tests-steps.yml index bce89c46a0ed..b2353ff21a97 100644 --- a/eng/pipelines/common/device-tests-steps.yml +++ b/eng/pipelines/common/device-tests-steps.yml @@ -36,10 +36,10 @@ steps: installDefaultAndroidApi: ${{ or(eq(parameters.platform, 'ios'), eq(parameters.platform, 'catalyst')) }} provisionatorChannel: ${{ parameters.provisionatorChannel }} ${{ if not(parameters.skipProvisioning) }}: - skipProvisioning: false + skipProvisionator : false gitHubToken: $(github--pat--vs-mobiletools-engineering-service2) ${{ else }}: - skipProvisioning: true + skipProvisionator: true - pwsh: ./build.ps1 --target=dotnet --configuration="Release" --verbosity=diagnostic displayName: 'Install .NET' diff --git a/eng/pipelines/common/provision.yml b/eng/pipelines/common/provision.yml index 5898e926e4f6..099e457575cd 100644 --- a/eng/pipelines/common/provision.yml +++ b/eng/pipelines/common/provision.yml @@ -2,7 +2,7 @@ parameters: poolName: '' clearCaches: true skipXcode: false - skipProvisioning: true + skipProvisionator: true skipAndroidSdks: false skipAndroidImages: false installDefaultAndroidApi: false @@ -66,39 +66,28 @@ steps: condition: and(succeeded(), eq(variables['Agent.OS'], 'Darwin')) timeoutInMinutes: 30 - # Provision Additional Software - - ${{ if ne(parameters.skipProvisioning, 'true') }}: - - ${{ if eq(variables['System.TeamProject'], 'devdiv') }}: - - task: xamops.azdevex.provisionator-task.provisionator@2 - displayName: 'Provision Additional Software' - condition: and(succeeded(), eq(variables['Agent.OS'], 'Darwin')) - continueOnError: true - inputs: - provisioning_script: ${{ parameters.checkoutDirectory }}/${{ parameters.provisionatorPath }} - provisioning_extra_args: ${{ parameters.provisionatorExtraArguments }} - github_token: ${{ parameters.gitHubToken }} - env: - PROVISIONATOR_CHANNEL: ${{ parameters.provisionatorChannel }} - AUTH_TOKEN_COMPONENTS_MAC_IOS_CERTIFICATE_P12: ${{ parameters.certPass }} - ${{ if eq(parameters.skipAndroidSdks, true) }}: - SKIP_ANDROID_API_SDKS: 'true' - ${{ if eq(parameters.skipAndroidImages, true) }}: - SKIP_ANDROID_API_IMAGES: 'true' - ${{ if eq(parameters.installDefaultAndroidApi, true) }}: - INSTALL_DEFAULT_ANDROID_API: 'true' - - # Setup JDK Paths (gradle needs it) - - bash: | - echo "##vso[task.setvariable variable=JI_JAVA_HOME]$(JAVA_HOME_17_X64)" - echo "##vso[task.setvariable variable=JAVA_HOME]$(JAVA_HOME_17_X64)" - # brew install --cask microsoft-openjdk@17 - displayName: 'Setup JDK Paths' - condition: and(succeeded(), eq(variables['Agent.OS'], 'Darwin')) + - ${{ if ne(parameters.skipProvisionator, true) }}: + # Prepare macOS + - task: xamops.azdevex.provisionator-task.provisionator@2 + displayName: 'Provision Additional Software' + condition: and(succeeded(), eq(variables['Agent.OS'], 'Darwin')) + continueOnError: true + inputs: + provisioning_script: ${{ parameters.checkoutDirectory }}/${{ parameters.provisionatorPath }} + provisioning_extra_args: ${{ parameters.provisionatorExtraArguments }} + github_token: ${{ parameters.gitHubToken }} + env: + PROVISIONATOR_CHANNEL: ${{ parameters.provisionatorChannel }} + AUTH_TOKEN_COMPONENTS_MAC_IOS_CERTIFICATE_P12: ${{ parameters.certPass }} + ${{ if eq(parameters.skipAndroidSdks, true) }}: + SKIP_ANDROID_API_SDKS: 'true' + ${{ if eq(parameters.skipAndroidImages, true) }}: + SKIP_ANDROID_API_IMAGES: 'true' + ${{ if eq(parameters.installDefaultAndroidApi, true) }}: + INSTALL_DEFAULT_ANDROID_API: 'true' - # Prepare Windows - # Provision Additional Software - - ${{ if ne(parameters.skipProvisioning, 'true') }}: + # Prepare Windows - task: xamops.azdevex.provisionator-task.provisionator@2 displayName: 'Provision Additional Software' condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT')) @@ -115,6 +104,15 @@ steps: ${{ if eq(parameters.installDefaultAndroidApi, true) }}: INSTALL_DEFAULT_ANDROID_API: 'true' + # Prepare Both + # Setup JDK Paths (gradle needs it) + - bash: | + echo "##vso[task.setvariable variable=JI_JAVA_HOME]$(JAVA_HOME_17_X64)" + echo "##vso[task.setvariable variable=JAVA_HOME]$(JAVA_HOME_17_X64)" + # brew install --cask microsoft-openjdk@17 + displayName: 'Setup JDK Paths' + condition: and(succeeded(), eq(variables['Agent.OS'], 'Darwin')) + - pwsh: | if ($env:JAVA_HOME_17_X64) { $env:JAVA_HOME = $env:JAVA_HOME_17_X64 @@ -133,7 +131,6 @@ steps: displayName: 'Setup JDK Paths' condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT')) - # Prepare Both - task: UseDotNet@2 displayName: 'Use .NET SDK $(DOTNET_VERSION)' inputs: diff --git a/eng/pipelines/common/ui-tests-build-sample.yml b/eng/pipelines/common/ui-tests-build-sample.yml index bbb9922503b8..33b02df6aaf3 100644 --- a/eng/pipelines/common/ui-tests-build-sample.yml +++ b/eng/pipelines/common/ui-tests-build-sample.yml @@ -7,6 +7,7 @@ parameters: version: '' #the iOS version' provisionatorChannel: 'latest' agentPoolAccessToken: '' + skipProvisioning: true configuration : "Release" testFilter: '' runtimeVariant: 'Mono' @@ -22,11 +23,15 @@ steps: - template: provision.yml parameters: - skipProvisioning: true # FIXME: 'Build the MSBuild Tasks' step fails for net9.0-android35 without API 35 skipAndroidSdks: false skipXcode: ${{ or(eq(parameters.platform, 'android'), eq(parameters.platform, 'windows')) }} provisionatorChannel: ${{ parameters.provisionatorChannel }} + ${{ if parameters.skipProvisioning }}: + skipProvisionator: true + ${{ else }}: + skipProvisionator: false + gitHubToken: $(github--pat--vs-mobiletools-engineering-service2) - task: PowerShell@2 condition: ne('${{ parameters.platform }}' , 'windows') diff --git a/eng/pipelines/common/ui-tests-compatibility-steps.yml b/eng/pipelines/common/ui-tests-compatibility-steps.yml index 6f3db291af75..a9d1d8ffcec6 100644 --- a/eng/pipelines/common/ui-tests-compatibility-steps.yml +++ b/eng/pipelines/common/ui-tests-compatibility-steps.yml @@ -26,10 +26,10 @@ steps: parameters: ${{ if eq(parameters.platform, 'windows') }}: platform: windows - skipProvisioning: true + skipProvisionator: true ${{ if ne(parameters.platform, 'windows') }}: platform: macos - skipProvisioning: false + skipProvisionator: false skipXcode: ${{ or(eq(parameters.platform, 'android'), eq(parameters.platform, 'windows')) }} provisionatorChannel: ${{ parameters.provisionatorChannel }} diff --git a/eng/pipelines/common/ui-tests-steps.yml b/eng/pipelines/common/ui-tests-steps.yml index 75bc8cbb3bf3..66caed80239f 100644 --- a/eng/pipelines/common/ui-tests-steps.yml +++ b/eng/pipelines/common/ui-tests-steps.yml @@ -42,11 +42,11 @@ steps: skipAndroidSdks: ${{ ne(parameters.platform, 'android') }} skipXcode: ${{ or(eq(parameters.platform, 'android'), eq(parameters.platform, 'windows')) }} provisionatorChannel: ${{ parameters.provisionatorChannel }} - ${{ if not(parameters.skipProvisioning) }}: - skipProvisioning: false - gitHubToken: $(github--pat--vs-mobiletools-engineering-service2) + ${{ if parameters.skipProvisioning }}: + skipProvisionator: true ${{ else }}: - skipProvisioning: true + skipProvisionator: false + gitHubToken: $(github--pat--vs-mobiletools-engineering-service2) - task: PowerShell@2 condition: ne('${{ parameters.platform }}' , 'windows') diff --git a/eng/pipelines/common/variables.yml b/eng/pipelines/common/variables.yml index 901efbd7319d..d989d502e78a 100644 --- a/eng/pipelines/common/variables.yml +++ b/eng/pipelines/common/variables.yml @@ -43,6 +43,8 @@ variables: value: 'eng/provisioning/xcode.csx' - name: provisionator.path value: 'eng/provisioning/provisioning.csx' +- name: internalProvisioning + value: false - name: provisionator.extraArguments value: '-vvvv' - name: DotNet.Dir @@ -67,7 +69,9 @@ variables: - group: Xamarin-Secrets - ${{ if or(eq(variables['System.TeamProject'], 'DevDiv'), eq(variables['Build.DefinitionName'], 'dotnet-maui')) }}: - - ${{ if notin(variables['Build.Reason'], 'PullRequest') }}: + - name: internalProvisioning + value: true + - ${{ if notin(variables['Build.Reason'], 'PullRequest') }}: - name: PrivateBuild value: false - name: _RunAsPublic @@ -78,8 +82,6 @@ variables: value: real # - name: PostBuildSign # value: true - # For eng/common/SetupNugetSources.ps1 - # - group: Xamarin-Secrets - group: DotNetBuilds storage account read tokens - group: AzureDevOps-Artifact-Feeds-Pats diff --git a/eng/pipelines/handlers.yml b/eng/pipelines/handlers.yml index 1ac742ae881b..1a3645d50d86 100644 --- a/eng/pipelines/handlers.yml +++ b/eng/pipelines/handlers.yml @@ -197,11 +197,12 @@ stages: skipAndroidImages: true installDefaultAndroidApi: false skipXcode: ${{ ne(BuildPlatform.name , 'macOS') }} - ${{ if parameters.UseProvisionator }}: - skipProvisioning: false + ${{ if or(eq(parameters.UseProvisionator, true), eq(variables['internalProvisioning'],'True') ) }}: + skipProvisionator: false gitHubToken: $(github--pat--vs-mobiletools-engineering-service2) - ${{ else }}: - skipProvisioning: true + ${{ else }}: + skipProvisionator: true + - pwsh: ./build.ps1 --target=dotnet --configuration="${{ BuildConfiguration }}" --verbosity=diagnostic displayName: 'Install .NET' retryCountOnTaskFailure: 3 @@ -270,11 +271,11 @@ stages: skipAndroidImages: true installDefaultAndroidApi: true skipXcode: ${{ ne(PackPlatform.name , 'macOS') }} - ${{ if parameters.UseProvisionator }}: - skipProvisioning: false + ${{ if or(eq(parameters.UseProvisionator, 'True'), eq(variables['internalProvisioning'],'True') )}}: + skipProvisionator: false gitHubToken: $(github--pat--vs-mobiletools-engineering-service2) ${{ else }}: - skipProvisioning: true + skipProvisionator: true - stage: samples_net displayName: Test .NET MAUI Samples @@ -298,11 +299,11 @@ stages: skipAndroidImages: true installDefaultAndroidApi: true skipXcode: ${{ ne(BuildPlatform.name , 'macOS') }} - ${{ if parameters.UseProvisionator }}: - skipProvisioning: false + ${{ if or(eq(parameters.UseProvisionator, true), eq(variables['internalProvisioning'],'True') ) }}: + skipProvisionator: false gitHubToken: $(github--pat--vs-mobiletools-engineering-service2) ${{ else }}: - skipProvisioning: true + skipProvisionator: true - task: DownloadBuildArtifacts@0 displayName: 'Download Packages' inputs: @@ -343,14 +344,13 @@ stages: RunPlatforms: ${{ parameters.RunTemplatePlatforms }} BuildPlatforms: ${{ parameters.BuildTemplatePlatforms }} MacBuildPool: ${{ parameters.MacTemplatePool }} - ${{ if parameters.UseProvisionator }}: - skipProvisioning: false - ${{ else }}: - skipProvisioning: true conditionMacTemplates: or( ${{ parameters.BuildEverything }}, ne(variables['Build.Reason'], 'PullRequest'), eq(variables['System.TeamProject'], 'devdiv')) - + ${{ if or(eq(parameters.UseProvisionator, true), eq(variables['internalProvisioning'],'True') ) }}: + skipProvisioning: false + + - ${{ if eq(variables['System.TeamProject'], 'devdiv') }}: - template: common/localization-handoff.yml # Process outgoing strings [Localization Handoff] diff --git a/eng/pipelines/ui-tests.yml b/eng/pipelines/ui-tests.yml index 886c082d4d30..2401c51c8427 100644 --- a/eng/pipelines/ui-tests.yml +++ b/eng/pipelines/ui-tests.yml @@ -144,14 +144,17 @@ stages: androidApiLevels: [ 30 ] iosVersions: [ '18.0' ] provisionatorChannel: ${{ parameters.provisionatorChannel }} - skipProvisioning: ${{ or(not(parameters.UseProvisionator), false) }} ${{ else }}: androidApiLevels: [ 30 ] iosVersions: [ '18.0' ] provisionatorChannel: ${{ parameters.provisionatorChannel }} - skipProvisioning: ${{ not(parameters.UseProvisionator) }} ${{ if parameters.CompatibilityTests }}: runCompatibilityTests: true + ${{ if or(eq(parameters.UseProvisionator, true), eq(variables['internalProvisioning'],'True') ) }}: + skipProvisioning: false + gitHubToken: $(github--pat--vs-mobiletools-engineering-service2) + ${{ else }}: + skipProvisioning: true projects: - name: controls desc: Controls