Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upload to PyPI job in build workflow failing #259

Open
matt-graham opened this issue Dec 19, 2024 · 0 comments
Open

Upload to PyPI job in build workflow failing #259

matt-graham opened this issue Dec 19, 2024 · 0 comments
Labels
infrastructure Issues related to infrastructure for repository and project

Comments

@matt-graham
Copy link
Collaborator

The upload_pypi job in the Actions workflow defined in .github/workflows/build.yml, which is triggered on new releases, is failing with an error

Attestation generation failure:

/github/workspace/dist/s2fft-1.2.0.tar.gz already has a publish attestation: /github/workspace/dist/s2fft-1.2.0.tar.gz.publish.attestation

You're seeing this because the action attempted to generated PEP 740
attestations for its inputs, but failed to do so.

Specifically this happens in the Publish package distribution to PyPI step after the previous Publish package distribution to Test PyPI step successfully completes.

I think we are hitting against the issue described in pypa/gh-action-pypi-publish#283 (comment), specifically that the step publishing to Test PyPI creates an attestation file (used to sign / verify the package upload as far as I can tell), which a subsequent twine upload command in the step publishing to PyPI finds and raises an error (as it expects there to be no existing attestation file present).

From the discussion in the issue thread it appears there are a couple of possible resolutions:

  • Disable attestations being generated on one of two steps (probably the test PyPI) by setting attestations: false in with block for step.
  • Refactor the workflow to use separate jobs for publishing to Test PyPI and PyPI. This appears to be the recommended approach as then they each can be operated in a separate environment with its own restrictions.
@matt-graham matt-graham added the infrastructure Issues related to infrastructure for repository and project label Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
infrastructure Issues related to infrastructure for repository and project
Projects
None yet
Development

No branches or pull requests

1 participant