mirror of
https://github.com/microsoft/terminal.git
synced 2025-12-11 22:48:41 -06:00
release-engineering: package (during build) and upload GPO templates (#18841)
I've been doing this manually. It is time for me to do it not-manually. (cherry picked from commit 21f31793263d411c17ae676855f431b357211b64) Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgZwVgk Service-Version: 1.22
This commit is contained in:
parent
8fad47d9c7
commit
b08a414791
@ -147,6 +147,10 @@ jobs:
|
|||||||
ValidateSignature: true
|
ValidateSignature: true
|
||||||
Verbosity: 'Verbose'
|
Verbosity: 'Verbose'
|
||||||
|
|
||||||
|
- pwsh: |-
|
||||||
|
tar -c -v --format=zip -f "$(JobOutputDirectory)/GroupPolicyTemplates_$(XES_APPXMANIFESTVERSION).zip" -C "$(Build.SourcesDirectory)/policies" *
|
||||||
|
displayName: Package GPO Templates
|
||||||
|
|
||||||
- ${{ parameters.afterBuildSteps }}
|
- ${{ parameters.afterBuildSteps }}
|
||||||
|
|
||||||
- ${{ if eq(parameters.publishArtifacts, true) }}:
|
- ${{ if eq(parameters.publishArtifacts, true) }}:
|
||||||
|
|||||||
@ -30,6 +30,7 @@ Enum AssetType {
|
|||||||
Unknown
|
Unknown
|
||||||
ApplicationBundle
|
ApplicationBundle
|
||||||
PreinstallKit
|
PreinstallKit
|
||||||
|
GroupPolicy
|
||||||
Zip
|
Zip
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -83,6 +84,9 @@ Class Asset {
|
|||||||
$local:bundlePath = Join-Path $local:directory $local:bundleName
|
$local:bundlePath = Join-Path $local:directory $local:bundleName
|
||||||
$this.Type = [AssetType]::PreinstallKit
|
$this.Type = [AssetType]::PreinstallKit
|
||||||
$this.Architecture = "all"
|
$this.Architecture = "all"
|
||||||
|
} ElseIf (".zip" -eq $local:ext -and $local:filename -like 'GroupPolicy*') {
|
||||||
|
$this.Type = [AssetType]::GroupPolicy
|
||||||
|
$this.Architecture = "all"
|
||||||
} ElseIf (".zip" -eq $local:ext) {
|
} ElseIf (".zip" -eq $local:ext) {
|
||||||
$this.Type = [AssetType]::Zip
|
$this.Type = [AssetType]::Zip
|
||||||
} ElseIf (".msixbundle" -eq $local:ext) {
|
} ElseIf (".msixbundle" -eq $local:ext) {
|
||||||
@ -90,7 +94,7 @@ Class Asset {
|
|||||||
$this.Architecture = "all"
|
$this.Architecture = "all"
|
||||||
}
|
}
|
||||||
|
|
||||||
If ($this.Type -Ne [AssetType]::Zip) {
|
If ($this.Type -In ([AssetType]::ApplicationBundle, [AssetType]::PreinstallKit)) {
|
||||||
Write-Verbose "Cracking bundle $($local:bundlePath)"
|
Write-Verbose "Cracking bundle $($local:bundlePath)"
|
||||||
$local:firstMsixName = & $script:tar -t -f $local:bundlePath |
|
$local:firstMsixName = & $script:tar -t -f $local:bundlePath |
|
||||||
Select-String 'Cascadia.*\.msix' |
|
Select-String 'Cascadia.*\.msix' |
|
||||||
@ -105,8 +109,10 @@ Class Asset {
|
|||||||
$local:Manifest = [xml](Get-Content (Join-Path $local:directory AppxManifest.xml))
|
$local:Manifest = [xml](Get-Content (Join-Path $local:directory AppxManifest.xml))
|
||||||
$this.ParseManifest($local:Manifest)
|
$this.ParseManifest($local:Manifest)
|
||||||
} Else {
|
} Else {
|
||||||
& $script:tar -x -f $this.Path -C $local:directory --strip-components=1 '*/wt.exe'
|
If ($this.Type -Ne [AssetType]::GroupPolicy) {
|
||||||
$this.ExpandedVersion = (Get-Item (Join-Path $local:directory wt.exe)).VersionInfo.ProductVersion
|
& $script:tar -x -f $this.Path -C $local:directory --strip-components=1 '*/wt.exe'
|
||||||
|
$this.ExpandedVersion = (Get-Item (Join-Path $local:directory wt.exe)).VersionInfo.ProductVersion
|
||||||
|
}
|
||||||
|
|
||||||
# Zip files just encode everything in their filename. Not great, but workable.
|
# Zip files just encode everything in their filename. Not great, but workable.
|
||||||
$this.ParseFilename($local:filename)
|
$this.ParseFilename($local:filename)
|
||||||
@ -133,7 +139,9 @@ Class Asset {
|
|||||||
$parts = [IO.Path]::GetFileNameWithoutExtension($filename).Split("_")
|
$parts = [IO.Path]::GetFileNameWithoutExtension($filename).Split("_")
|
||||||
$this.Name = $parts[0]
|
$this.Name = $parts[0]
|
||||||
$this.Version = $parts[1]
|
$this.Version = $parts[1]
|
||||||
$this.Architecture = $parts[2]
|
If ($parts.Length -Ge 3) {
|
||||||
|
$this.Architecture = $parts[2]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[string]IdealFilename() {
|
[string]IdealFilename() {
|
||||||
@ -149,6 +157,9 @@ Class Asset {
|
|||||||
Zip {
|
Zip {
|
||||||
"{0}_{1}_{2}.zip" -f ($this.Name, $this.Version, $this.Architecture)
|
"{0}_{1}_{2}.zip" -f ($this.Name, $this.Version, $this.Architecture)
|
||||||
}
|
}
|
||||||
|
GroupPolicy {
|
||||||
|
"{0}_{1}.zip" -f ($this.Name, $this.Version)
|
||||||
|
}
|
||||||
Default {
|
Default {
|
||||||
Throw "Unknown type $($_.Type)"
|
Throw "Unknown type $($_.Type)"
|
||||||
}
|
}
|
||||||
@ -174,7 +185,7 @@ class Release {
|
|||||||
|
|
||||||
Release([Asset[]]$a) {
|
Release([Asset[]]$a) {
|
||||||
$this.Assets = $a
|
$this.Assets = $a
|
||||||
$this.Branding = $a[0].Branding
|
$this.Branding = $a | Where-Object Branding -Ne ([Branding]::Unknown) | Select -Unique -First 1 -Expand Branding
|
||||||
$this.Name = Switch($this.Branding) {
|
$this.Name = Switch($this.Branding) {
|
||||||
Release { "Windows Terminal" }
|
Release { "Windows Terminal" }
|
||||||
Preview { "Windows Terminal Preview" }
|
Preview { "Windows Terminal Preview" }
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user