Skip to content

Commit 8a381b2

Browse files
author
Chuck Walbourn
committed
Updates
1 parent e0f9dd9 commit 8a381b2

2 files changed

Lines changed: 245 additions & 0 deletions

File tree

‎.github/copilot-instructions.md‎

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,3 +296,33 @@ When reviewing documentation, do the following:
296296
- Review the public interface defined in `DirectXTex.h`.
297297
- Read the documentation on the wiki located in [this git repository](https://github.com/microsoft/DirectXTex.wiki.git).
298298
- Report any specific gaps in the documentation compared to the public interface.
299+
300+
## Release Process
301+
302+
1. Ensure all changes are merged into the `main` branch and that all tests pass.
303+
2. Git pull the local repository to ensure it is up to date with the `main` branch.
304+
3. Run the PowerShell script `build\preparerelease.ps1` which will generate a topic branch for the release, update the version number in `CMakeLists.txt`, the `README.md` file, the release notes in the nuspec files, and create a stub in the `CHANGELOG.md` file for the new release.
305+
4. Edit the `CHANGELOG.md` file to update it with a summary of changes.
306+
5. Submit the topic branch for review and merge into `main` once approved. Allow the GitHub Actions workflows and the Azure DevOps pipelines to complete successfully before proceeding.
307+
6. Run the PowerShell script `build\compilerelease.ps1` which will set a tag on the project repo and the test repo, and create a release on GitHub with the release notes from `CHANGELOG.md`.
308+
> Ensure you have set up GPG signing for your GitHub account so that the tags will be verified.
309+
7. Git pull the local repository to ensure it is up to date with the `main` branch. Be sure to include `--tags`.
310+
8. Push the `main` branch to the MSCodeHub mirror repository. Be sure to include `--tags`.
311+
9. Create a PR on MSCodeHub from the `main` branch to the `release` branch.
312+
10. Merge the PR on MSCodeHub to update the release branch, which will trigger the Azure DevOps pipeline to build signed binaries and the NuGet packages.
313+
11. Run the PowerShell script `build\downloadartifacts.ps1` to download the signed binaries from the Azure DevOps pipeline artifacts.
314+
12. Edit the GitHub release and upload the signed binaries to the release assets.
315+
13. Download the GitHub source .zip archive from the release. Unzip and compare to the local repo to ensure it matches — keep in mind there may be some CR/LF differences. Run minisign on the .zip to generate a signature file, and upload the signature file to the release assets.
316+
14. Validate the NuGet packages with <https://github.com/walbourn/contentexporter> by pushing the NuGet packages to a local Packages Source folder, updating the NuGet packages from that folder, and then build the project.
317+
15. Run the PowerShell script `build\promotenuget.ps1` with the `-Release` parameter to promote the version to the Release view on the project-scoped ADO feed.
318+
16. Run the MSCodeHub pipeline to publish the NuGet packages to nuget.org. The pipeline will automatically push the most recent package promoted to the Release view to nuget.org.
319+
17. Git pull a local repository of VCPKG to `d:\vcpkg` in sync with the `main` branch of the VCPKG repository.
320+
18. Run the PowerShell script `build\updatevcpkg.ps1` to update the DirectXTex port in VCPKG with the new release version. This will edit the files in `ports\directxtex`.
321+
19. Test the VCPKG port using all appropriate triplets and features.
322+
20. Run `.\vcpkg --x-add-version directxtex` to update the VCPKG versioning history.
323+
21. Submit a PR to the VCPKG repository to update the DirectXTex port back to the main GitHub repo. The PR will be reviewed and merged by the VCPKG maintainers.
324+
22. If relevant changes were made to the `texassemble`, `texconv` or `texdiag` tools, update the winget manifests for those tools in the `winget` repository.
325+
* Git pull a local repository to `D:\winget-pkgs` in sync with the `master` branch of the WinGet repository.
326+
* Run the PowerShell script `build\updatewinget.ps1` to update the winget manifests for the tools with the new release version.
327+
* Submit a PR to the `winget` repository to update the manifests for each tool — they must be done as distinct PRs. The PRs will be reviewed and merged by the winget maintainers.
328+
23. Update the GitHub release with links to the matching NuGet packages, the VCPKG port, and the winget manifests for the tools.

‎build/updatewinget.ps1‎

Lines changed: 215 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,215 @@
1+
<#
2+
3+
.NOTES
4+
Copyright (c) Microsoft Corporation.
5+
Licensed under the MIT License.
6+
7+
.SYNOPSIS
8+
Updates the winget manifests for texassemble, texconv, and texdiag to match a GitHub release.
9+
10+
.DESCRIPTION
11+
This script creates new winget manifest versions for texassemble, texconv, and texdiag under
12+
D:\winget-pkgs based on the most recent release date in README.md. It copies the previous
13+
version's manifests, then updates PackageVersion, ReleaseDate, InstallerSha256, InstallerUrl,
14+
and ReleaseNotesUrl to match the new release.
15+
16+
.PARAMETER Tag
17+
The GitHub release tag (e.g., 'may2026', 'mar2026'). Defaults to the latest tag.
18+
19+
.LINK
20+
https://github.com/microsoft/DirectXTex/wiki
21+
22+
#>
23+
24+
param(
25+
[string]$Tag = ""
26+
)
27+
28+
$repoRoot = Split-Path -Path $PSScriptRoot -Parent
29+
$readme = Join-Path $repoRoot "README.md"
30+
$wingetPkgs = "D:\winget-pkgs"
31+
32+
if (-Not (Test-Path $readme)) {
33+
Write-Error "ERROR: Cannot find README.md at $readme" -ErrorAction Stop
34+
}
35+
36+
if (-Not (Test-Path $wingetPkgs)) {
37+
Write-Error "ERROR: Cannot find winget-pkgs at $wingetPkgs" -ErrorAction Stop
38+
}
39+
40+
# Determine tag from latest git tag if not provided
41+
if ($Tag.Length -eq 0) {
42+
$Tag = (git --no-pager -C $repoRoot tag --sort=-creatordate | Select-Object -First 1).Trim()
43+
if ($Tag.Length -eq 0) {
44+
Write-Error "ERROR: Failed to determine latest tag!" -ErrorAction Stop
45+
}
46+
}
47+
48+
Write-Host "Release Tag: $Tag"
49+
50+
# Parse release date from README.md (format: "## Month Day, Year")
51+
$rawReleaseDate = (Get-Content $readme) | Select-String -Pattern "^##\s+[A-Z][a-z]+\s+\d+,?\s+\d{4}" | Select-Object -First 1
52+
if ([string]::IsNullOrEmpty($rawReleaseDate)) {
53+
Write-Error "ERROR: Failed to find release date in README.md!" -ErrorAction Stop
54+
}
55+
56+
$releaseDateStr = ($rawReleaseDate -replace '^##\s+', '').Trim()
57+
$releaseDate = [datetime]::Parse($releaseDateStr, [System.Globalization.CultureInfo]::InvariantCulture)
58+
59+
# winget version format: YYYY.M.D (no leading zeros)
60+
$packageVersion = $releaseDate.ToString("yyyy.M.d")
61+
62+
# winget ReleaseDate format: YYYY-MM-DD
63+
$releaseDateYaml = $releaseDate.ToString("yyyy-MM-dd")
64+
65+
Write-Host "Release Date: $releaseDateStr"
66+
Write-Host "Package Version: $packageVersion"
67+
Write-Host "Release Date (YAML): $releaseDateYaml"
68+
69+
# --- Tool definitions ---
70+
# Each tool has a manifest base path and a list of release assets (name + architecture)
71+
$tools = @(
72+
@{
73+
Name = "Texassemble"
74+
ManifestBase = Join-Path $wingetPkgs "manifests\m\Microsoft\DirectXTex\Texassemble"
75+
PackageId = "Microsoft.DirectXTex.Texassemble"
76+
Assets = @(
77+
@{ FileName = "texassemble.exe"; Arch = "x64" },
78+
@{ FileName = "texassemble_arm64.exe"; Arch = "arm64" }
79+
)
80+
},
81+
@{
82+
Name = "Texconv"
83+
ManifestBase = Join-Path $wingetPkgs "manifests\m\Microsoft\DirectXTex\Texconv"
84+
PackageId = "Microsoft.DirectXTex.Texconv"
85+
Assets = @(
86+
@{ FileName = "texconv.exe"; Arch = "x64" },
87+
@{ FileName = "texconv_arm64.exe"; Arch = "arm64" }
88+
)
89+
},
90+
@{
91+
Name = "Texdiag"
92+
ManifestBase = Join-Path $wingetPkgs "manifests\m\Microsoft\DirectXTex\Texdiag"
93+
PackageId = "Microsoft.DirectXTex.Texdiag"
94+
Assets = @(
95+
@{ FileName = "texdiag.exe"; Arch = "x64" },
96+
@{ FileName = "texdiag_arm64.exe"; Arch = "arm64" }
97+
)
98+
}
99+
)
100+
101+
# --- Find previous version directory ---
102+
function Get-LatestVersionDir {
103+
param([string]$BasePath)
104+
$dirs = Get-ChildItem -Path $BasePath -Directory | Sort-Object Name
105+
if ($dirs.Count -eq 0) {
106+
Write-Error "ERROR: No existing version directories found in $BasePath" -ErrorAction Stop
107+
}
108+
return $dirs[-1]
109+
}
110+
111+
# --- Download release assets and compute SHA256 hashes ---
112+
$ProgressPreference = 'SilentlyContinue'
113+
$tempDir = Join-Path $Env:Temp $(New-Guid)
114+
New-Item -Type Directory -Path $tempDir | Out-Null
115+
116+
$hashes = @{}
117+
118+
# Collect all unique asset filenames across tools
119+
$allAssets = $tools | ForEach-Object { $_.Assets } | ForEach-Object { $_ }
120+
121+
foreach ($asset in $allAssets) {
122+
$url = "https://github.com/microsoft/DirectXTex/releases/download/$Tag/$($asset.FileName)"
123+
$outPath = Join-Path $tempDir $asset.FileName
124+
Write-Host "`nDownloading $($asset.FileName) from $url..."
125+
try {
126+
Invoke-WebRequest -Uri $url -OutFile $outPath -ErrorAction Stop
127+
}
128+
catch {
129+
Write-Error "ERROR: Failed to download $($asset.FileName)!" -ErrorAction Stop
130+
}
131+
$hash = (Get-FileHash -Path $outPath -Algorithm SHA256).Hash.ToLower()
132+
$hashes[$asset.FileName] = $hash
133+
Write-Host " SHA256: $hash"
134+
}
135+
136+
# --- Create new manifests for each tool ---
137+
$newDirs = @()
138+
139+
foreach ($tool in $tools) {
140+
$prevDir = Get-LatestVersionDir $tool.ManifestBase
141+
$newDir = Join-Path $tool.ManifestBase $packageVersion
142+
143+
Write-Host "`nPrevious $($tool.Name) version: $($prevDir.Name)"
144+
145+
if (Test-Path $newDir) {
146+
Write-Error "ERROR: $($tool.Name) version $packageVersion already exists at $newDir" -ErrorAction Stop
147+
}
148+
149+
Write-Host "Creating $($tool.Name) $packageVersion manifests..."
150+
Copy-Item -Path $prevDir.FullName -Destination $newDir -Recurse
151+
152+
foreach ($file in Get-ChildItem -Path $newDir -Filter "*.yaml") {
153+
$content = Get-Content $file.FullName -Raw
154+
$content = $content -replace "PackageVersion:\s+\S+", "PackageVersion: $packageVersion"
155+
156+
if ($file.Name -match "installer") {
157+
$content = $content -replace "ReleaseDate:\s+\S+", "ReleaseDate: $releaseDateYaml"
158+
159+
# Update installer URLs
160+
foreach ($asset in $tool.Assets) {
161+
$escapedFileName = [regex]::Escape($asset.FileName)
162+
$content = $content -replace "(InstallerUrl:\s+).+$escapedFileName", "`${1}https://github.com/microsoft/DirectXTex/releases/download/$Tag/$($asset.FileName)"
163+
}
164+
165+
# Update SHA256 hashes per architecture block
166+
$lines = $content -split "`n"
167+
$currentArch = ""
168+
for ($i = 0; $i -lt $lines.Count; $i++) {
169+
if ($lines[$i] -match "Architecture:\s+(\S+)") {
170+
$currentArch = $Matches[1]
171+
}
172+
173+
if ($lines[$i] -match "InstallerSha256:") {
174+
$matchingAsset = $tool.Assets | Where-Object { $_.Arch -eq $currentArch }
175+
if ($matchingAsset) {
176+
$lines[$i] = " InstallerSha256: $($hashes[$matchingAsset.FileName])"
177+
}
178+
}
179+
}
180+
$content = $lines -join "`n"
181+
}
182+
183+
if ($file.Name -match "locale") {
184+
$content = $content -replace "(ReleaseNotesUrl:\s+).+", "`${1}https://github.com/microsoft/DirectXTex/releases/tag/$Tag"
185+
}
186+
187+
Set-Content -Path $file.FullName -Value $content -NoNewline
188+
}
189+
190+
foreach ($file in Get-ChildItem -Path $newDir -Filter "*.yaml") {
191+
Write-Host " $($file.Name)"
192+
}
193+
194+
$newDirs += $newDir
195+
}
196+
197+
# --- Cleanup ---
198+
Remove-Item -Recurse -Force $tempDir
199+
200+
Write-Host "`nwinget manifests created successfully!"
201+
Write-Host "`nNew manifest directories:"
202+
foreach ($dir in $newDirs) {
203+
Write-Host " $dir"
204+
}
205+
Write-Host "`nNext steps:"
206+
Write-Host " 1. Review the generated manifest files"
207+
foreach ($dir in $newDirs) {
208+
Write-Host " 2. Validate with: winget validate $dir"
209+
}
210+
foreach ($dir in $newDirs) {
211+
Write-Host " 3. Test with: winget install --manifest $dir"
212+
}
213+
Write-Host " 4. Submit PRs to the winget-pkgs repository"
214+
Write-Host ""
215+
Write-Host " NOTE: Each tool must be submitted as its own separate PR per winget-pkgs policy."

0 commit comments

Comments
 (0)