publish-pypi.ps1 686 B

1234567891011121314151617181920212223242526272829
  1. # Set error handling
  2. $ErrorActionPreference = "Stop"
  3. # Get the root directory and third_party directory
  4. $ROOT_DIR = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent | Split-Path -Parent | Split-Path -Parent -Resolve
  5. # Include the common functions
  6. . "$ROOT_DIR/hack/lib/windows/init.ps1"
  7. function Publish-Pypi {
  8. uv run twine check dist/*.whl
  9. uv run twine upload dist/*.whl
  10. if ($LASTEXITCODE -ne 0) {
  11. GPUStack.Log.Fatal "twine upload failed."
  12. }
  13. }
  14. #
  15. # main
  16. #
  17. GPUStack.Log.Info "+++ Publish Pypi +++"
  18. try {
  19. Publish-Pypi
  20. }
  21. catch {
  22. GPUStack.Log.Fatal "failed to publish Pypi: $($_.Exception.Message)"
  23. }
  24. GPUStack.Log.Info "--- Publish Pypi ---"