2
0

Release.ps1 783 B

1234567891011121314151617181920212223242526272829303132
  1. # Script for doing a Release of Terminal.Gui
  2. # For now just does Alpha
  3. param(
  4. [Parameter(Mandatory=$true)]
  5. [int]$Version
  6. )
  7. $branch = "v2_release"
  8. $tag = "$Version-prealpha"
  9. $releaseMessage = "Release $tag"
  10. try {
  11. Write-Host "Switching to branch $branch"
  12. git checkout $branch
  13. Write-Host "Pulling latest from upstream branch $branch"
  14. git pull upstream $branch
  15. Write-Host "Tagging release with tag $tag"
  16. git tag $tag -a -m $releaseMessage
  17. Write-Host "Creating empty commit with message $releaseMessage"
  18. git commit --allow-empty -m $releaseMessage
  19. Write-Host "Pushing changes to upstream"
  20. git push --atomic upstream $branch $tag
  21. } catch {
  22. Write-Host "An error occurred: $_"
  23. exit 1
  24. }
  25. Write-Host "Script executed successfully"