Skip to content

Publishing script should fail when Maven upload requests fail #268

@Alibehram11

Description

@Alibehram11

Hi,

I noticed that the Maven publishing script currently prints an error message when a PUT request fails, but it does not exit with a non-zero status code.

For example, if uploading the .zip, .sha256, or .md5 file fails, the script only does:

print(f"Error: {response.status_code} - {response.content.decode()}")

Because of this, CI/CD workflows may still treat the publish step as successful even though one or more artifacts were not actually uploaded.

Suggested improvement:

  • Track whether any upload failed
  • Exit with a non-zero status code if any request fails
  • Optionally skip checksum uploads if the main .zip upload fails
  • Consider accepting other successful status codes such as 204
  • Add a request timeout to avoid hanging indefinitely

Example behavior:

if response_zip.status_code not in (200, 201, 204):
    print(...)
    exit(1)

This would make failures easier to detect in automated release workflows and prevent partially published artifacts from being treated as successful.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions