Skip to content

Commit 484d6e8

Browse files
committed
Remove function call
1 parent 41af3bd commit 484d6e8

File tree

1 file changed

+0
-45
lines changed

1 file changed

+0
-45
lines changed

build.ps1

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ param(
1919
[switch]$UpdateLockFile,
2020
[switch]$Audit,
2121
[switch]$UseCFSAuth,
22-
[switch]$SubmitWinGetManifest,
23-
[switch]$PreRelease,
24-
[string]$GitToken,
2522
[switch]$Clean,
2623
[switch]$Verbose
2724
)
@@ -783,46 +780,4 @@ if ($packageType -eq 'msixbundle') {
783780
Write-Host -ForegroundColor Green "`ntar.gz file is created at $tarFile"
784781
}
785782

786-
function Submit-DSCWinGetAssets {
787-
param(
788-
[string]$GitToken,
789-
[switch] $IsPreRelease
790-
)
791-
792-
$project = 'PowerShell/DSC'
793-
$packageId = 'Microsoft.DSC'
794-
$restParameters = @{
795-
SslProtocol = 'Tls13'
796-
Headers = @{'X-GitHub-Api-Version' = '2022-11-28' }
797-
}
798-
799-
$assets = ((Invoke-RestMethod -uri "https://api.github.com/repos/$Project/releases" -Headers $restParameters) |
800-
Where-Object -Property prerelease -EQ $IsPreRelease.IsPresent |
801-
Select-Object -First 1 -Property assets).assets # ExpandProperty did not work
802-
# Grab the download URLs for supported WinGet
803-
804-
$downloadUrls = $assets.Where({ $_.content_type -in @('application/zip', 'application/octet-stream') }).browser_download_url
805-
806-
if (-not (Get-Command wingetcreate -ErrorAction SilentlyContinue)) {
807-
Invoke-RestMethod https://aka.ms/wingetcreate/latest -OutFile wingetcreate.exe
808-
}
809-
810-
# TODO: Version number might change in the future
811-
$url = $downloadUrls[0]
812-
if ($url -match 'v(\d+\.\d+\.\d+)-preview\.(\d+)') {
813-
$firstPart = $matches[1].Remove(3) # Remove the last digit
814-
$lastPart = $matches[2] + ".0"
815-
$version = "$firstPart.$lastPart"
816-
817-
$packageId = "$packageId.Preview"
818-
}
819-
820-
821-
& wingetcreate.exe update $packageId --version $version --urls $downloadUrls --submit --token $GitToken
822-
}
823-
824-
if ($SubmitWinGetManifest) {
825-
Submit-DSCWinGetAssets -GitToken $GitToken -IsPreRelease:$PreRelease
826-
}
827-
828783
$env:RUST_BACKTRACE = 1

0 commit comments

Comments
 (0)