mirror of
https://github.com/microsoft/DirectXTex.git
synced 2026-02-04 04:16:12 +01:00
Added some helper scripts (#660)
Some checks failed
CMake (WSL) / build (x64-Debug-Linux, 14) (push) Failing after 4s
CMake (WSL) / build (x64-Debug-Linux, 12) (push) Failing after 4s
CMake (WSL) / build (x64-Debug-Linux, 13) (push) Failing after 3s
CMake (WSL) / build (x64-Release-Linux, 14) (push) Failing after 4s
CMake (WSL) / build (x64-Release-Linux, 12) (push) Failing after 3s
CMake (WSL) / build (x64-Release-Linux, 13) (push) Failing after 3s
CMake (Windows on ARM64) / build (arm64-Debug) (push) Has been cancelled
CMake (Windows on ARM64) / build (arm64-Debug-UWP) (push) Has been cancelled
CMake (Windows on ARM64) / build (arm64-Release) (push) Has been cancelled
CMake (Windows on ARM64) / build (arm64-Release-UWP) (push) Has been cancelled
BVTs (arm64) / build (arm64-Release) (push) Has been cancelled
BVTs (x64) / build (amd64, x64-Release, 14) (push) Has been cancelled
BVTs (x64) / build (amd64, x64-Release, 14.29) (push) Has been cancelled
CodeQL / Analyze (C/C++) (push) Has been cancelled
CMake (Windows) / build (amd64, x64-Debug, 14) (push) Has been cancelled
CMake (Windows) / build (amd64, x64-Debug, 14.29) (push) Has been cancelled
CMake (Windows) / build (amd64, x64-Debug-Clang, 14) (push) Has been cancelled
CMake (Windows) / build (amd64, x64-Debug-Win8, 14) (push) Has been cancelled
CMake (Windows) / build (amd64, x64-Release, 14) (push) Has been cancelled
CMake (Windows) / build (amd64, x64-Release, 14.29) (push) Has been cancelled
CMake (Windows) / build (amd64, x64-Release-Clang, 14) (push) Has been cancelled
CMake (Windows) / build (amd64, x64-Release-Win8, 14) (push) Has been cancelled
CMake (Windows) / build (amd64_arm64, arm64-Debug, 14) (push) Has been cancelled
CMake (Windows) / build (amd64_arm64, arm64-Debug-Clang, 14) (push) Has been cancelled
CMake (Windows) / build (amd64_arm64, arm64-Release, 14) (push) Has been cancelled
CMake (Windows) / build (amd64_arm64, arm64-Release-Clang, 14) (push) Has been cancelled
CMake (Windows) / build (amd64_arm64, arm64ec-Debug, 14) (push) Has been cancelled
CMake (Windows) / build (amd64_arm64, arm64ec-Release, 14) (push) Has been cancelled
CMake (Windows) / build (amd64_x86, x86-Debug, 14) (push) Has been cancelled
CMake (Windows) / build (amd64_x86, x86-Debug, 14.29) (push) Has been cancelled
CMake (Windows) / build (amd64_x86, x86-Debug-Clang, 14) (push) Has been cancelled
CMake (Windows) / build (amd64_x86, x86-Release, 14) (push) Has been cancelled
CMake (Windows) / build (amd64_x86, x86-Release, 14.29) (push) Has been cancelled
CMake (Windows) / build (amd64_x86, x86-Release-Clang, 14) (push) Has been cancelled
MSBuild / build (Debug, ARM64, 2022) (push) Has been cancelled
MSBuild / build (Debug, x64, 2019) (push) Has been cancelled
MSBuild / build (Debug, x64, 2022) (push) Has been cancelled
MSBuild / build (Debug, x86, 2019) (push) Has been cancelled
MSBuild / build (Debug, x86, 2022) (push) Has been cancelled
MSBuild / build (Release, ARM64, 2022) (push) Has been cancelled
MSBuild / build (Release, x64, 2019) (push) Has been cancelled
MSBuild / build (Release, x64, 2022) (push) Has been cancelled
MSBuild / build (Release, x86, 2019) (push) Has been cancelled
MSBuild / build (Release, x86, 2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-Clang-VCPKG, OFF, 14) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug, 14) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug, 14.29) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug-Clang, 14) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release, 14) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release, 14.29) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release-Clang, 14) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64-Debug, 14) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64-Release, 14) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64ec-Debug, 14) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64ec-Release, 14) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug, 14) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug, 14.29) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug-Clang, 14) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, 14) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, 14.29) (push) Has been cancelled
Microsoft C++ Code Analysis / Analyze (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release-Clang, 14) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Debug-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Debug-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Release-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Release-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Debug-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Debug-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Release-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Release-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Debug-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Debug-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Release-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Release-UWP-Clang) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-MinGW, OFF, 14) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-MinGW, ON, 14) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, OFF, 14) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, OFF, 14.29) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Release-MinGW, OFF, 14) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Release-MinGW, ON, 14) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_arm64, arm64-Debug-VCPKG, OFF, 14) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_arm64, arm64ec-Debug-VCPKG, OFF, 14) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_x86, x86-Debug-VCPKG, OFF, 14) (push) Has been cancelled
Some checks failed
CMake (WSL) / build (x64-Debug-Linux, 14) (push) Failing after 4s
CMake (WSL) / build (x64-Debug-Linux, 12) (push) Failing after 4s
CMake (WSL) / build (x64-Debug-Linux, 13) (push) Failing after 3s
CMake (WSL) / build (x64-Release-Linux, 14) (push) Failing after 4s
CMake (WSL) / build (x64-Release-Linux, 12) (push) Failing after 3s
CMake (WSL) / build (x64-Release-Linux, 13) (push) Failing after 3s
CMake (Windows on ARM64) / build (arm64-Debug) (push) Has been cancelled
CMake (Windows on ARM64) / build (arm64-Debug-UWP) (push) Has been cancelled
CMake (Windows on ARM64) / build (arm64-Release) (push) Has been cancelled
CMake (Windows on ARM64) / build (arm64-Release-UWP) (push) Has been cancelled
BVTs (arm64) / build (arm64-Release) (push) Has been cancelled
BVTs (x64) / build (amd64, x64-Release, 14) (push) Has been cancelled
BVTs (x64) / build (amd64, x64-Release, 14.29) (push) Has been cancelled
CodeQL / Analyze (C/C++) (push) Has been cancelled
CMake (Windows) / build (amd64, x64-Debug, 14) (push) Has been cancelled
CMake (Windows) / build (amd64, x64-Debug, 14.29) (push) Has been cancelled
CMake (Windows) / build (amd64, x64-Debug-Clang, 14) (push) Has been cancelled
CMake (Windows) / build (amd64, x64-Debug-Win8, 14) (push) Has been cancelled
CMake (Windows) / build (amd64, x64-Release, 14) (push) Has been cancelled
CMake (Windows) / build (amd64, x64-Release, 14.29) (push) Has been cancelled
CMake (Windows) / build (amd64, x64-Release-Clang, 14) (push) Has been cancelled
CMake (Windows) / build (amd64, x64-Release-Win8, 14) (push) Has been cancelled
CMake (Windows) / build (amd64_arm64, arm64-Debug, 14) (push) Has been cancelled
CMake (Windows) / build (amd64_arm64, arm64-Debug-Clang, 14) (push) Has been cancelled
CMake (Windows) / build (amd64_arm64, arm64-Release, 14) (push) Has been cancelled
CMake (Windows) / build (amd64_arm64, arm64-Release-Clang, 14) (push) Has been cancelled
CMake (Windows) / build (amd64_arm64, arm64ec-Debug, 14) (push) Has been cancelled
CMake (Windows) / build (amd64_arm64, arm64ec-Release, 14) (push) Has been cancelled
CMake (Windows) / build (amd64_x86, x86-Debug, 14) (push) Has been cancelled
CMake (Windows) / build (amd64_x86, x86-Debug, 14.29) (push) Has been cancelled
CMake (Windows) / build (amd64_x86, x86-Debug-Clang, 14) (push) Has been cancelled
CMake (Windows) / build (amd64_x86, x86-Release, 14) (push) Has been cancelled
CMake (Windows) / build (amd64_x86, x86-Release, 14.29) (push) Has been cancelled
CMake (Windows) / build (amd64_x86, x86-Release-Clang, 14) (push) Has been cancelled
MSBuild / build (Debug, ARM64, 2022) (push) Has been cancelled
MSBuild / build (Debug, x64, 2019) (push) Has been cancelled
MSBuild / build (Debug, x64, 2022) (push) Has been cancelled
MSBuild / build (Debug, x86, 2019) (push) Has been cancelled
MSBuild / build (Debug, x86, 2022) (push) Has been cancelled
MSBuild / build (Release, ARM64, 2022) (push) Has been cancelled
MSBuild / build (Release, x64, 2019) (push) Has been cancelled
MSBuild / build (Release, x64, 2022) (push) Has been cancelled
MSBuild / build (Release, x86, 2019) (push) Has been cancelled
MSBuild / build (Release, x86, 2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-Clang-VCPKG, OFF, 14) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug, 14) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug, 14.29) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug-Clang, 14) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release, 14) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release, 14.29) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release-Clang, 14) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64-Debug, 14) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64-Release, 14) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64ec-Debug, 14) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64ec-Release, 14) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug, 14) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug, 14.29) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug-Clang, 14) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, 14) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, 14.29) (push) Has been cancelled
Microsoft C++ Code Analysis / Analyze (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release-Clang, 14) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Debug-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Debug-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Release-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Release-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Debug-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Debug-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Release-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Release-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Debug-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Debug-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Release-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Release-UWP-Clang) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-MinGW, OFF, 14) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-MinGW, ON, 14) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, OFF, 14) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, OFF, 14.29) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Release-MinGW, OFF, 14) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Release-MinGW, ON, 14) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_arm64, arm64-Debug-VCPKG, OFF, 14) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_arm64, arm64ec-Debug-VCPKG, OFF, 14) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_x86, x86-Debug-VCPKG, OFF, 14) (push) Has been cancelled
This commit is contained in:
146
build/downloadbuild.ps1
Normal file
146
build/downloadbuild.ps1
Normal file
@@ -0,0 +1,146 @@
|
||||
<#
|
||||
|
||||
.NOTES
|
||||
Copyright (c) Microsoft Corporation.
|
||||
Licensed under the MIT License.
|
||||
|
||||
.SYNOPSIS
|
||||
Downloads build artifacts from Azure DevOps for DirectXTex.
|
||||
|
||||
.DESCRIPTION
|
||||
This script is used as part of the internal release process for DirectXTex.
|
||||
|
||||
.PARAMETER BuildId
|
||||
This is the specific build to get artifacts from.
|
||||
|
||||
.PARAMETER PAT
|
||||
Requires an ADO PAT with 'Build > Read' scope. Can be provided via the ADO_PERSONAL_ACCESS_TOKEN environment variable or as a parameter.
|
||||
|
||||
.LINK
|
||||
https://github.com/microsoft/DirectXTex/wiki
|
||||
|
||||
#>
|
||||
|
||||
param(
|
||||
[Parameter(Mandatory)]
|
||||
[int]$BuildId,
|
||||
[string]$PAT = ""
|
||||
)
|
||||
|
||||
# Parse PAT
|
||||
if ($PAT.Length -eq 0) {
|
||||
$PAT = $env:ADO_PERSONAL_ACCESS_TOKEN
|
||||
|
||||
if ($PAT.Length -eq 0) {
|
||||
Write-Error "##[error]This script requires a valid ADO Personal Access Token!" -ErrorAction Stop
|
||||
}
|
||||
}
|
||||
|
||||
# Initial REST query
|
||||
$headers = @{
|
||||
"Content-Type" = "application/json"
|
||||
Authorization = "Basic " + [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(":$PAT"))
|
||||
}
|
||||
|
||||
$uriFormat = "https://dev.azure.com/MSCodeHub/ca4f06c8-d88d-40fb-ada3-b70b24a98714/_apis/build/builds/{0}/artifacts?artifactName={1}&api-version=7.1"
|
||||
|
||||
$uriarm64 = $uriFormat -f $BuildId, "DirectXTex_Binaries_Release_ARM64"
|
||||
$uriamd64 = $uriFormat -f $BuildId, "DirectXTex_Binaries_Release_x64"
|
||||
|
||||
try
|
||||
{
|
||||
Write-Host "Checking if build and artifacts exist..."
|
||||
$responseamd64 = Invoke-RestMethod -Uri $uriamd64 -Method Get -Headers $headers
|
||||
$responsearm64 = Invoke-RestMethod -Uri $uriarm64 -Method Get -Headers $headers
|
||||
}
|
||||
catch
|
||||
{
|
||||
Write-Error "##[error]Build $BuildId not found!" -ErrorAction Continue
|
||||
}
|
||||
|
||||
$ProgressPreference = 'SilentlyContinue'
|
||||
|
||||
$tempFolderPath = Join-Path $Env:Temp $(New-Guid)
|
||||
New-Item -Type Directory -Path $tempFolderPath | Out-Null
|
||||
|
||||
Write-Host $tempFolderPath
|
||||
|
||||
$headers = @{
|
||||
Authorization = "Basic " + [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(":$PAT"))
|
||||
Accept = "application/zip"
|
||||
}
|
||||
|
||||
Add-Type -A System.IO.Compression.FileSystem
|
||||
|
||||
# Download artifacts for ARM64
|
||||
foreach ($artifact in $responsearm64) {
|
||||
$artifactName = $artifact.name
|
||||
$downloadUrl = $artifact.resource.downloadUrl
|
||||
$outputFile = Join-Path $tempFolderPath "$artifactName.zip"
|
||||
|
||||
try
|
||||
{
|
||||
Write-Host "Downloading $artifactName to $outputFile..."
|
||||
Invoke-WebRequest -Uri $downloadUrl -Headers $headers -OutFile $outputFile
|
||||
}
|
||||
catch
|
||||
{
|
||||
Write-Error "##[error]Failed to download $artifactName!" -ErrorAction Continue
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
Write-Host "Extracting $artifactName..."
|
||||
[IO.Compression.ZipFile]::ExtractToDirectory($outputFile, $tempFolderPath)
|
||||
}
|
||||
catch
|
||||
{
|
||||
Write-Error "##[error]Failed to extract $artifactName!" -ErrorAction Continue
|
||||
}
|
||||
}
|
||||
|
||||
# Download artifacts for X64
|
||||
foreach ($artifact in $responseamd64) {
|
||||
$artifactName = $artifact.name
|
||||
$downloadUrl = $artifact.resource.downloadUrl
|
||||
$outputFile = Join-Path $tempFolderPath "$artifactName.zip"
|
||||
|
||||
try
|
||||
{
|
||||
Write-Host "Downloading $artifactName to $outputFile..."
|
||||
Invoke-WebRequest -Uri $downloadUrl -Headers $headers -OutFile $outputFile
|
||||
}
|
||||
catch
|
||||
{
|
||||
Write-Error "##[error]Failed to download $artifactName!" -ErrorAction Continue
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
Write-Host "Extracting $artifactName..."
|
||||
[IO.Compression.ZipFile]::ExtractToDirectory($outputFile, $tempFolderPath)
|
||||
}
|
||||
catch
|
||||
{
|
||||
Write-Error "##[error]Failed to extract $artifactName!" -ErrorAction Continue
|
||||
}
|
||||
}
|
||||
|
||||
# Extract command-line tool binaries
|
||||
$exes = @(
|
||||
"Texassemble",
|
||||
"Texconv",
|
||||
"Texdiag"
|
||||
)
|
||||
|
||||
$binPath = Join-Path $tempFolderPath "DirectXTex_Binaries_Release_ARM64"
|
||||
foreach ($exe in $exes) {
|
||||
$srcPath = "{0}\{1}\Bin\Desktop_2022_Win10\ARM64\Release\{1}_arm64.exe" -f $binPath, $exe
|
||||
Copy-Item -Path $srcPath -Destination "." -ErrorAction Stop
|
||||
}
|
||||
|
||||
$binPath = Join-Path $tempFolderPath "DirectXTex_Binaries_Release_x64"
|
||||
foreach ($exe in $exes) {
|
||||
$srcPath = "{0}\{1}\Bin\Desktop_2022\x64\Release\{1}.exe" -f $binPath, $exe
|
||||
Copy-Item -Path $srcPath -Destination "." -ErrorAction Stop
|
||||
}
|
||||
132
build/promotenuget.ps1
Normal file
132
build/promotenuget.ps1
Normal file
@@ -0,0 +1,132 @@
|
||||
<#
|
||||
|
||||
.NOTES
|
||||
Copyright (c) Microsoft Corporation.
|
||||
Licensed under the MIT License.
|
||||
|
||||
.SYNOPSIS
|
||||
This promotes the NuGet packages on the project-scoped feed.
|
||||
|
||||
.DESCRIPTION
|
||||
This script promotes the views of the DirectXTex NuGet packages on the project-scoped feed. It always promotes to Prerelease view, and if the Release switch is set, it also promotes to Release view.
|
||||
|
||||
.PARAMETER Version
|
||||
Indicates which version of the packages to promote.
|
||||
|
||||
.PARAMETER PAT
|
||||
Requires an ADO PAT with 'Packaging > Read, write, and manage' scope. Can be provided via the ADO_PERSONAL_ACCESS_TOKEN environment variable or as a parameter.
|
||||
|
||||
.PARAMETER Release
|
||||
By default promotes to prerelease. If this switch is set, promotes to release as well.
|
||||
|
||||
.LINK
|
||||
https://github.com/microsoft/DirectXTex/wiki
|
||||
|
||||
#>
|
||||
|
||||
param(
|
||||
[Parameter(Mandatory)]
|
||||
[string]$Version,
|
||||
[string]$PAT = "",
|
||||
[switch]$Release
|
||||
)
|
||||
|
||||
# Parse PAT
|
||||
if ($PAT.Length -eq 0) {
|
||||
$PAT = $env:ADO_PERSONAL_ACCESS_TOKEN
|
||||
|
||||
if ($PAT.Length -eq 0) {
|
||||
Write-Error "##[error]This script requires a valid ADO Personal Access Token!" -ErrorAction Stop
|
||||
}
|
||||
}
|
||||
|
||||
# Project-scoped feed root (package name and version to be filled in later)
|
||||
$uriFormat = "https://pkgs.dev.azure.com/MSCodeHub/ca4f06c8-d88d-40fb-ada3-b70b24a98714/_apis/packaging/feeds/17d602ae-444a-46e6-ac3b-bb124bd0afa8/nuget/packages/{0}/versions/{1}?api-version=7.1"
|
||||
|
||||
$headers = @{
|
||||
"Content-Type" = "application/json"
|
||||
Authorization = "Basic " + [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(":$PAT"))
|
||||
}
|
||||
|
||||
$bodyPrerelease = @{
|
||||
views = @{
|
||||
op = "add"
|
||||
path = "/views/-"
|
||||
value = "Prerelease"
|
||||
}
|
||||
} | ConvertTo-Json
|
||||
|
||||
$bodyRelease = @{
|
||||
views = @{
|
||||
op = "add"
|
||||
path = "/views/-"
|
||||
value = "Release"
|
||||
}
|
||||
} | ConvertTo-Json
|
||||
|
||||
$packages = @('directxtex_desktop_2019', 'directxtex_desktop_win10', 'directxtex_uwp')
|
||||
|
||||
# Check if all packages exist
|
||||
$allPackagesSucceeded = $true
|
||||
foreach ($package in $packages) {
|
||||
$uri = $uriFormat -f $package, $Version
|
||||
|
||||
try
|
||||
{
|
||||
Write-Host "Checking if $package version $Version exists..."
|
||||
Invoke-RestMethod -Uri $uri -Method Get -Headers $headers
|
||||
}
|
||||
catch
|
||||
{
|
||||
Write-Error "##[error]Package $package version $Version not found!" -ErrorAction Continue
|
||||
$allPackagesSucceeded = $false
|
||||
}
|
||||
}
|
||||
|
||||
if (-not $allPackagesSucceeded) {
|
||||
Write-Error "##[error]Not all packages found. Aborting promotion." -ErrorAction Stop
|
||||
}
|
||||
|
||||
# Promote package to Prerelease view
|
||||
foreach ($package in $packages) {
|
||||
$uri = $uriFormat -f $package, $Version
|
||||
|
||||
try
|
||||
{
|
||||
# Promote to Prerelease view
|
||||
Write-Host "Promoting $package version $Version to Prerelease view..."
|
||||
Invoke-RestMethod -Uri $uri -Method Patch -Headers $headers -Body $bodyPrerelease
|
||||
}
|
||||
catch
|
||||
{
|
||||
Write-Error "##[error]Package $package version $Version failed to promote" -ErrorAction Continue
|
||||
$allPackagesSucceeded = $false
|
||||
}
|
||||
}
|
||||
|
||||
if (-not $allPackagesSucceeded) {
|
||||
Write-Error "##[error]Not all packages promoted to Prerelease." -ErrorAction Stop
|
||||
}
|
||||
|
||||
# Optionally promote package to Release view
|
||||
if ($Release.IsPresent) {
|
||||
foreach ($package in $packages) {
|
||||
$uri = $uriFormat -f $package, $Version
|
||||
|
||||
try
|
||||
{
|
||||
# Promote to Release view
|
||||
Write-Host "Promoting $package version $Version to Release view..."
|
||||
Invoke-RestMethod -Uri $uri -Method Patch -Headers $headers -Body $bodyRelease
|
||||
}
|
||||
catch
|
||||
{
|
||||
Write-Error "##[error]Package $package version $Version failed to promote" -ErrorAction Continue
|
||||
$allPackagesSucceeded = $false
|
||||
}
|
||||
}
|
||||
|
||||
if (-not $allPackagesSucceeded) {
|
||||
Write-Error "##[error]Not all packages promoted to Release." -ErrorAction Stop
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user