Update the vmImage and PowerShell root directory for macOS builds (#16611)

This commit is contained in:
Aditya Patwardhan
2021-12-13 16:13:17 -08:00
committed by GitHub
parent bb7e0e3ba9
commit a54b9a2c44
3 changed files with 19 additions and 10 deletions
@@ -1,7 +1,10 @@
parameters:
nativePathRoot: ''
steps:
- powershell: |
$dirSeparatorChar = [system.io.path]::DirectorySeparatorChar
$nativePath = "${env:HOME}${dirSeparatorChar}PowerShell"
$nativePath = "${{parameters.nativePathRoot }}${dirSeparatorChar}PowerShell"
Write-Host "##vso[task.setvariable variable=PowerShellRoot]$nativePath"
if ((Test-Path "$nativePath")) {
@@ -8,7 +8,7 @@ jobs:
dependsOn: MacFileSigningJob_${{ parameters.buildArchitecture }}
condition: succeeded()
pool:
vmImage: internal-macos-11
vmImage: macos-latest
variables:
# Turn off Homebrew analytics
- name: HOMEBREW_NO_ANALYTICS
@@ -23,11 +23,11 @@ jobs:
- pwsh: |
# create folder
sudo mkdir /PowerShell
sudo mkdir "$(Agent.TempDirectory)/PowerShell"
# make the current user the owner
sudo chown $env:USER /PowerShell
displayName: 'Create /PowerShell'
sudo chown $env:USER "$(Agent.TempDirectory)/PowerShell"
displayName: 'Create $(Agent.TempDirectory)/PowerShell'
- template: SetVersionVariables.yml
parameters:
@@ -36,6 +36,8 @@ jobs:
- template: shouldSign.yml
- template: cloneToOfficialPath.yml
parameters:
nativePathRoot: '$(Agent.TempDirectory)'
- task: DownloadBuildArtifacts@0
displayName: Download macosBinResults
@@ -108,7 +110,9 @@ jobs:
displayName: 'Bootstrap VM'
- pwsh: |
$(Build.SourcesDirectory)/tools/releaseBuild/macOS/PowerShellPackageVsts.ps1 -ReleaseTag $(ReleaseTagVar) -Destination $(System.ArtifactsDirectory) -location $(PowerShellRoot) -ArtifactName macosPkgResults -BuildZip $(BuildPackagePath) -ExtraPackage "tar" -Runtime 'osx-${{ parameters.buildArchitecture }}'
# Add -SkipReleaseChecks as a mitigation to unblock release.
# macos-10.15 does not allow creating a folder under root. Hence, moving the folder.
$(Build.SourcesDirectory)/tools/releaseBuild/macOS/PowerShellPackageVsts.ps1 -ReleaseTag $(ReleaseTagVar) -Destination $(System.ArtifactsDirectory) -location $(PowerShellRoot) -ArtifactName macosPkgResults -BuildZip $(BuildPackagePath) -ExtraPackage "tar" -Runtime 'osx-${{ parameters.buildArchitecture }}' -SkipReleaseChecks
displayName: 'Package'
- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
@@ -6,7 +6,7 @@ jobs:
displayName: Build macOS ${{ parameters.buildArchitecture }}
condition: succeeded()
pool:
vmImage: internal-macos-11
vmImage: macos-latest
variables:
# Turn off Homebrew analytics
- name: HOMEBREW_NO_ANALYTICS
@@ -28,13 +28,15 @@ jobs:
- pwsh: |
# create folder
sudo mkdir "${env:HOME}/PowerShell"
sudo mkdir "$(Agent.TempDirectory)/PowerShell"
# make the current user the owner
sudo chown $env:USER "${env:HOME}/PowerShell"
displayName: 'Create ${env:HOME}/PowerShell'
sudo chown $env:USER "$(Agent.TempDirectory)/PowerShell"
displayName: 'Create $(Agent.TempDirectory)/PowerShell'
- template: cloneToOfficialPath.yml
parameters:
nativePathRoot: '$(Agent.TempDirectory)'
- pwsh: |
tools/releaseBuild/macOS/PowerShellPackageVsts.ps1 -location $(PowerShellRoot) -BootStrap