Skip to content

Commit

Permalink
Update the vmImage and PowerShell root directory for macOS builds (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
adityapatwardhan committed Dec 14, 2021
1 parent bb7e0e3 commit a54b9a2
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -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")) {
Expand Down
14 changes: 9 additions & 5 deletions tools/releaseBuild/azureDevOps/templates/mac-package-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -36,6 +36,8 @@ jobs:
- template: shouldSign.yml

- template: cloneToOfficialPath.yml
parameters:
nativePathRoot: '$(Agent.TempDirectory)'

- task: DownloadBuildArtifacts@0
displayName: Download macosBinResults
Expand Down Expand Up @@ -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
Expand Down
10 changes: 6 additions & 4 deletions tools/releaseBuild/azureDevOps/templates/mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit a54b9a2

Please sign in to comment.