Skip to content

Commit b08a414

Browse files
committed
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 21f3179) Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgZwVgk Service-Version: 1.22
1 parent 8fad47d commit b08a414

File tree

2 files changed

+20
-5
lines changed

2 files changed

+20
-5
lines changed

build/pipelines/templates-v2/job-merge-msix-into-bundle.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,10 @@ jobs:
147147
ValidateSignature: true
148148
Verbosity: 'Verbose'
149149

150+
- pwsh: |-
151+
tar -c -v --format=zip -f "$(JobOutputDirectory)/GroupPolicyTemplates_$(XES_APPXMANIFESTVERSION).zip" -C "$(Build.SourcesDirectory)/policies" *
152+
displayName: Package GPO Templates
153+
150154
- ${{ parameters.afterBuildSteps }}
151155

152156
- ${{ if eq(parameters.publishArtifacts, true) }}:

tools/ReleaseEngineering/Draft-TerminalReleases.ps1

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ Enum AssetType {
3030
Unknown
3131
ApplicationBundle
3232
PreinstallKit
33+
GroupPolicy
3334
Zip
3435
}
3536

@@ -83,14 +84,17 @@ Class Asset {
8384
$local:bundlePath = Join-Path $local:directory $local:bundleName
8485
$this.Type = [AssetType]::PreinstallKit
8586
$this.Architecture = "all"
87+
} ElseIf (".zip" -eq $local:ext -and $local:filename -like 'GroupPolicy*') {
88+
$this.Type = [AssetType]::GroupPolicy
89+
$this.Architecture = "all"
8690
} ElseIf (".zip" -eq $local:ext) {
8791
$this.Type = [AssetType]::Zip
8892
} ElseIf (".msixbundle" -eq $local:ext) {
8993
$this.Type = [AssetType]::ApplicationBundle
9094
$this.Architecture = "all"
9195
}
9296

93-
If ($this.Type -Ne [AssetType]::Zip) {
97+
If ($this.Type -In ([AssetType]::ApplicationBundle, [AssetType]::PreinstallKit)) {
9498
Write-Verbose "Cracking bundle $($local:bundlePath)"
9599
$local:firstMsixName = & $script:tar -t -f $local:bundlePath |
96100
Select-String 'Cascadia.*\.msix' |
@@ -105,8 +109,10 @@ Class Asset {
105109
$local:Manifest = [xml](Get-Content (Join-Path $local:directory AppxManifest.xml))
106110
$this.ParseManifest($local:Manifest)
107111
} Else {
108-
& $script:tar -x -f $this.Path -C $local:directory --strip-components=1 '*/wt.exe'
109-
$this.ExpandedVersion = (Get-Item (Join-Path $local:directory wt.exe)).VersionInfo.ProductVersion
112+
If ($this.Type -Ne [AssetType]::GroupPolicy) {
113+
& $script:tar -x -f $this.Path -C $local:directory --strip-components=1 '*/wt.exe'
114+
$this.ExpandedVersion = (Get-Item (Join-Path $local:directory wt.exe)).VersionInfo.ProductVersion
115+
}
110116

111117
# Zip files just encode everything in their filename. Not great, but workable.
112118
$this.ParseFilename($local:filename)
@@ -133,7 +139,9 @@ Class Asset {
133139
$parts = [IO.Path]::GetFileNameWithoutExtension($filename).Split("_")
134140
$this.Name = $parts[0]
135141
$this.Version = $parts[1]
136-
$this.Architecture = $parts[2]
142+
If ($parts.Length -Ge 3) {
143+
$this.Architecture = $parts[2]
144+
}
137145
}
138146

139147
[string]IdealFilename() {
@@ -149,6 +157,9 @@ Class Asset {
149157
Zip {
150158
"{0}_{1}_{2}.zip" -f ($this.Name, $this.Version, $this.Architecture)
151159
}
160+
GroupPolicy {
161+
"{0}_{1}.zip" -f ($this.Name, $this.Version)
162+
}
152163
Default {
153164
Throw "Unknown type $($_.Type)"
154165
}
@@ -174,7 +185,7 @@ class Release {
174185

175186
Release([Asset[]]$a) {
176187
$this.Assets = $a
177-
$this.Branding = $a[0].Branding
188+
$this.Branding = $a | Where-Object Branding -Ne ([Branding]::Unknown) | Select -Unique -First 1 -Expand Branding
178189
$this.Name = Switch($this.Branding) {
179190
Release { "Windows Terminal" }
180191
Preview { "Windows Terminal Preview" }

0 commit comments

Comments
 (0)