Files
GithubRepoRemover/scripts/create-release.ps1

30 lines
967 B
PowerShell

# PowerShell script to create a release tag using nbgv
param(
[switch]$WhatIf
)
# Get the current version from nbgv
$version = nbgv get-version --format json | ConvertFrom-Json
$versionString = $version.SemVer2
Write-Host "Current version: $versionString" -ForegroundColor Green
if ($WhatIf) {
Write-Host "Would create tag: v$versionString" -ForegroundColor Yellow
exit 0
}
# Confirm with user
$confirm = Read-Host "Create and push tag v$versionString? (y/N)"
if ($confirm -ne 'y' -and $confirm -ne 'Y') {
Write-Host "Cancelled" -ForegroundColor Red
exit 1
}
# Create and push the tag
Write-Host "Creating tag v$versionString..." -ForegroundColor Blue
git tag "v$versionString"
git push origin "v$versionString"
Write-Host "Tag v$versionString created and pushed!" -ForegroundColor Green
Write-Host "You can now create a GitHub release at: https://github.com/mtfarkas/GithubRepoRemover/releases/new?tag=v$versionString" -ForegroundColor Cyan