mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-26 15:57:56 +01:00
Moved scripts
This commit is contained in:
32
Scripts/Release.ps1
Normal file
32
Scripts/Release.ps1
Normal file
@@ -0,0 +1,32 @@
|
||||
# Script for doing a Release of Terminal.Gui
|
||||
# For now just does Alpha
|
||||
param(
|
||||
[Parameter(Mandatory=$true)]
|
||||
[int]$Version
|
||||
)
|
||||
|
||||
$branch = "v2_release"
|
||||
$tag = "$Version-prealpha"
|
||||
$releaseMessage = "Release $tag"
|
||||
|
||||
try {
|
||||
Write-Host "Switching to branch $branch"
|
||||
git checkout $branch
|
||||
|
||||
Write-Host "Pulling latest from upstream branch $branch"
|
||||
git pull upstream $branch
|
||||
|
||||
Write-Host "Tagging release with tag $tag"
|
||||
git tag $tag -a -m $releaseMessage
|
||||
|
||||
Write-Host "Creating empty commit with message $releaseMessage"
|
||||
git commit --allow-empty -m $releaseMessage
|
||||
|
||||
Write-Host "Pushing changes to upstream"
|
||||
git push --atomic upstream $branch $tag
|
||||
} catch {
|
||||
Write-Host "An error occurred: $_"
|
||||
exit 1
|
||||
}
|
||||
|
||||
Write-Host "Script executed successfully"
|
||||
31
Scripts/delist-nuget.ps1
Normal file
31
Scripts/delist-nuget.ps1
Normal file
@@ -0,0 +1,31 @@
|
||||
$apiKey = "key" # Replace with your actual API key
|
||||
# Unlist all packages matching "2.0.0-v2-develop.*"
|
||||
# PowerShell script to unlist NuGet packages using dotnet CLI
|
||||
$packageId = "terminal.gui" # Ensure this is the correct package name (case-sensitive)
|
||||
$packagePattern = "^2\.0\.0-v2-develop\..*$" # Regex pattern for filtering versions
|
||||
$nugetSource = "https://api.nuget.org/v3/index.json"
|
||||
|
||||
# Fetch package versions from NuGet API
|
||||
$nugetApiUrl = "https://api.nuget.org/v3-flatcontainer/$packageId/index.json"
|
||||
Write-Host "Fetching package versions for '$packageId'..."
|
||||
|
||||
try {
|
||||
$versionsResponse = Invoke-RestMethod -Uri $nugetApiUrl
|
||||
$matchingVersions = $versionsResponse.versions | Where-Object { $_ -match $packagePattern }
|
||||
} catch {
|
||||
Write-Host "Error fetching package versions: $_"
|
||||
exit 1
|
||||
}
|
||||
|
||||
if ($matchingVersions.Count -eq 0) {
|
||||
Write-Host "No matching packages found for '$packageId' with pattern '$packagePattern'."
|
||||
exit 0
|
||||
}
|
||||
|
||||
# Unlist each matching package version
|
||||
foreach ($version in $matchingVersions) {
|
||||
Write-Host "Unlisting package: $packageId - $version"
|
||||
dotnet nuget delete $packageId $version --source $nugetSource --api-key $apiKey --non-interactive
|
||||
}
|
||||
|
||||
Write-Host "Operation complete."
|
||||
Reference in New Issue
Block a user