Skip to content

Avoid race condition in CI during Github releases #21

@jluethi

Description

@jluethi

The newly added feature of triggering the CI during Github releases (see #20) sometimes leads to the following race condition:

If the Github release is made before the CI in main has finished running, the CI in main will then deploy the whls to the Github release & the PyPI. However, the release also triggers the CI to run again (necessary because the CI in main my have finished & there was no tag when that ran).
In that case, the publish CI run can run into errors like:
Publish to PyPI fails:

Uploading distributions to https://upload.pypi.org/legacy/
Uploading fractal_lif_converters-0.3.4-py3-none-any.whl
Uploading fractal_lif_converters-0.3.4.tar.gz
WARNING  Error during upload. Retry with the --verbose option for more details. 
ERROR    HTTPError: 400 Bad Request from https://upload.pypi.org/legacy/        
         The digest supplied does not match a digest calculated from the        
         uploaded file.  

or adding to release fails:

Found release v0.1.3 (with id=190475854)
⬆️ Uploading fractal_helper_tasks-0.1.3.tar.gz...
⬆️ Uploading fractal_helper_tasks-0.1.3-py3-none-any.whl...
Error: Validation Failed: {"resource":"ReleaseAsset","code":"already_exists","field":"name"} - https://docs.github.com/rest

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions