2
0

Release.ps1 716 B

123456789101112131415161718192021222324252627282930
  1. param(
  2. [Parameter(Mandatory=$true)]
  3. [int]$Version
  4. )
  5. $branch = "v2_develop"
  6. $tag = "v2.0.0-alpha.$Version"
  7. $releaseMessage = "Release $tag"
  8. try {
  9. Write-Host "Switching to branch $branch"
  10. git checkout $branch
  11. Write-Host "Pulling latest from upstream branch $branch"
  12. git pull upstream $branch
  13. Write-Host "Tagging release with tag $tag"
  14. git tag $tag -a -m $releaseMessage
  15. Write-Host "Creating empty commit with message $releaseMessage"
  16. git commit --allow-empty -m $releaseMessage
  17. Write-Host "Pushing changes to upstream"
  18. git push --atomic upstream $branch $tag
  19. } catch {
  20. Write-Host "An error occurred: $_"
  21. exit 1
  22. }
  23. Write-Host "Script executed successfully"