Skip to content

Commit

Permalink
Remove WiX install (PowerShell#16834)
Browse files Browse the repository at this point in the history
# Conflicts:
#	tools/releaseBuild/azureDevOps/templates/windows-packaging.yml
  • Loading branch information
TravisEz13 committed Mar 8, 2022
1 parent 079066d commit 5b7ae7d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 43 deletions.
3 changes: 2 additions & 1 deletion tools/releaseBuild/azureDevOps/releasePipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@ stages:
- deployment: AzureBlobPublic
displayName: Make Azure Blob Public

pool: PowerShell1ES
pool:
name: PowerShell1ES
demands:
- ImageOverride -equals PSMMS2019-Secure

Expand Down
64 changes: 22 additions & 42 deletions tools/releaseBuild/azureDevOps/templates/windows-packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ parameters:
default: ''

jobs:
- job: sign_windows_${{ parameters.Architecture }}
displayName: Package Windows - ${{ parameters.Architecture }}
- job: sign_windows_${{ parameters.Architecture }}_${{ parameters.BuildConfiguration }}
displayName: Package Windows - ${{ parameters.Architecture }} ${{ parameters.BuildConfiguration }}
condition: succeeded()
dependsOn: ${{ parameters.parentJob }}
pool:
Expand All @@ -36,18 +36,14 @@ jobs:
- checkout: ComplianceRepo
clean: true

- template: shouldSign.yml
- template: SetVersionVariables.yml
parameters:
ReleaseTagVar: $(ReleaseTagVar)

- powershell: |
$pkgFilter = if ( '$(Architecture)' -eq 'arm' ) {
"arm32"
}
else {
'$(Architecture)'
}
- template: shouldSign.yml

- pwsh: |
$pkgFilter = if ( '$(Architecture)' -eq 'arm' ) { "arm32" } else { '$(Architecture)' }
$vstsCommandString = "vso[task.setvariable variable=PkgFilter]$pkgFilter"
Write-Host ("sending " + $vstsCommandString)
Expand All @@ -63,27 +59,16 @@ jobs:
- template: cloneToOfficialPath.yml

- pwsh: |
# cleanup previous install
if((Test-Path "${env:ProgramFiles(x86)}\WiX Toolset xcopy")) {
Remove-Item "${env:ProgramFiles(x86)}\WiX Toolset xcopy" -Recurse -Force
$zipPathString = '$(System.ArtifactsDirectory)\Symbols\results\*$(PkgFilter).zip'
Write-Verbose -Verbose "Zip Path: $zipPathString"
$zipPath = Get-Item $zipPathString
if(@($zipPath).Count -eq 0) {
throw "No files found at '$zipPathString'"
}
elseif(@($zipPath).Count -ne 1) {
$names = $zipPath.Name -join "', '"
throw "multiple files '${names}' found with '${zipPathString}'"
}
$toolsDir = New-Item -ItemType Directory -Path '$(Build.ArtifactStagingDirectory)\tools'
$wixUri = 'https://github.com/wixtoolset/wix3/releases/download/wix311rtm/wix311-binaries.zip'
Invoke-RestMethod -Uri $wixUri -OutFile '$(Build.ArtifactStagingDirectory)\tools\wix.zip' -MaximumRetryCount 5 -RetryIntervalSec 10
Import-Module '$(PowerShellRoot)/tools/releaseBuild/Images/microsoft_powershell_windowsservercore/wix.psm1'
Install-WixZip -zipPath '$(Build.ArtifactStagingDirectory)\tools\wix.zip'
$msixUrl = '$(makeappUrl)'
Invoke-RestMethod -Uri $msixUrl -OutFile '\makeappx.zip'
Expand-Archive '\makeappx.zip' -destination '\' -Force
displayName: Install packaging tools
- powershell: |
$zipPath = Get-Item '$(System.ArtifactsDirectory)\Symbols\results\*$(PkgFilter).zip'
Write-Verbose -Verbose "Zip Path: $zipPath"
$expandedFolder = $zipPath.BaseName
Write-Host "sending.. vso[task.setvariable variable=SymbolsFolder]$expandedFolder"
Expand Down Expand Up @@ -202,13 +187,14 @@ jobs:
**\*.dll
useMinimatch: true
shouldSign: $(SHOULD_SIGN)
displayName: Sign ThirdParty binaries

- powershell: |
- pwsh: |
Get-ChildItem '$(System.ArtifactsDirectory)\thirdPartySigned\*'
displayName: Captrue ThirdParty Signed files
condition: and(succeeded(), eq(variables['SHOULD_SIGN'], 'true'))
- powershell: |
- pwsh: |
Import-Module $(PowerShellRoot)/build.psm1 -Force
Import-Module $(PowerShellRoot)/tools/packaging -Force
$signedFilesPath = '$(System.ArtifactsDirectory)\thirdPartySigned'
Expand All @@ -226,7 +212,7 @@ jobs:
PackageVersion: $(Version)
sourceScanPath: '$(PowerShellRoot)\tools'

- powershell: |
- pwsh: |
Import-Module $(PowerShellRoot)/build.psm1 -Force
Import-Module $(PowerShellRoot)/tools/packaging -Force
Expand All @@ -245,7 +231,7 @@ jobs:
Write-Host "##$vstsCommandString"
displayName: Compress signed files
- powershell: |
- pwsh: |
$runtime = switch ($env:Architecture)
{
"x64" { "win7-x64" }
Expand All @@ -257,13 +243,12 @@ jobs:
}
$signedPkg = "$(BuildPackagePath)"
Write-Verbose -Verbose -Message "signedPkg = $signedPkg"
$(PowerShellRoot)/tools/releaseBuild/Images/microsoft_powershell_windowsservercore/PowerShellPackage.ps1 -BuildZip $signedPkg -location '$(PowerShellRoot)' -destination '$(System.ArtifactsDirectory)\pkgSigned' -Runtime $runtime -ReleaseTag '$(ReleaseTagVar)'
displayName: 'Build Windows Universal - $(Architecture) Package'
- powershell: |
- pwsh: |
Get-ChildItem '$(System.ArtifactsDirectory)\pkgSigned' | ForEach-Object {
$packagePath = $_.FullName
Write-Host "Uploading $packagePath"
Expand All @@ -277,17 +262,12 @@ jobs:
sourceScanPath: '$(PowerShellRoot)\tools'
snapshotForceEnabled: true

- powershell: |
- pwsh: |
if ((Test-Path "\PowerShell")) {
Remove-Item -Path "\PowerShell" -Force -Recurse -Verbose
}
else {
Write-Verbose -Verbose -Message "No cleanup required."
}
if((Test-Path "${env:ProgramFiles(x86)}\WiX Toolset xcopy")) {
Write-Verbose -Verbose "Cleaning up Wix tools"
Remove-Item "${env:ProgramFiles(x86)}\WiX Toolset xcopy" -Recurse -Force
}
displayName: Clean up local Clone
condition: always()

0 comments on commit 5b7ae7d

Please sign in to comment.