pyxem / diffsims

An open-source Python library providing utilities for simulating diffraction
https://diffsims.readthedocs.io
GNU General Public License v3.0
46 stars 26 forks source link

Invalid-publisher error in publish workflow #217

Closed hakonanes closed 4 months ago

hakonanes commented 4 months ago

We get an invalid-publisher error when trying to upload our latest 0.6rc1 build to TestPyPI: https://github.com/pyxem/diffsims/actions/runs/9084675533/job/24966176388

Error: Trusted publishing exchange failure: 
Token request failed: the server refused the request for the following reasons:

* `invalid-publisher`: valid token, but no corresponding publisher (All lookup strategies exhausted)

This generally indicates a trusted publisher configuration error, but could
also indicate an internal error on GitHub or PyPI's part.

The claims rendered below are **for debugging purposes only**. You should **not**
use them to configure a trusted publisher unless they already match your expectations.

If a claim is not present in the claim set, then it is rendered as `MISSING`.

* `sub`: `repo:pyxem/diffsims:ref:refs/tags/v0.6rc1`
* `repository`: `pyxem/diffsims`
* `repository_owner`: `pyxem`
* `repository_owner_id`: `16704128`
* `job_workflow_ref`: `pyxem/diffsims/.github/workflows/python-publish.yml@refs/tags/v0.6rc1`
* `ref`: `refs/tags/v0.6rc1`

See https://docs.pypi.org/trusted-publishers/troubleshooting/ for more help.

Haven't seen this before. And I cannot see the error cause. Any suggestions?

CSSFrancis commented 4 months ago

@hakonanes Have you tried just rerunning it? It could just be that some part of the workflow was down for a little bit.

Edit: Should this be fixed by #218?

hakonanes commented 4 months ago

Rerun after about 20 minutes failed.

I've updated the workflow in #218, but would like to keep it open for a day to have a closer look at this tomorrow. Don't think the changes in that PR fixes it, unfortunately.

CSSFrancis commented 4 months ago

@hakonanes can you log into diffsims on pypi and adjust the Trusted Publishers? It might need ot be adjusted to allow GitHub to push.

CSSFrancis commented 4 months ago

Maybe Relevent? Although I assume you've checked that :) https://github.com/pyxem/pyxem/issues/974

hakonanes commented 4 months ago

can you log into diffsims on pypi and adjust the Trusted Publishers

I assumed we had set it up correctly... We had not. The trusted publisher entry pointed to the orix repository. Thanks for nudging me to check! I should of course have done that in the first place 😅

I'll merge #218 once checks pass and re-try publishing to PyPI.