Skip to content
Advertisement

Upload to pypi from Gitlab Pipelines

I’m trying to upload a package to pypi using a Gitlab CI job, but I cannot make it work :/ Anyone has a working example?

What I have tried so far in my .gitlab-ci.yaml (from my local machine all of them are working):

  1. Twine with a .pypirc file

    JavaScript
  2. Same as before but with $VARIABLE

    JavaScript
  3. Two options before but using python setup.py ... upload

  4. twine upload dist/* -u $PYPI_USER -p $PYPI_PASSWORD
  5. twine upload dist/* wiht TWINE_USERNAME and TWINE_PASSWORD environment variables.

… and always get a 403 Client Error: Invalid or non-existent authentication information. I’m running out of options…

Advertisement

Answer

I got this working, using a modified version of your code:

JavaScript

The difference is I didn’t use the “‘” and got rid of the colons in the yaml; instead I set the values of the secrets as e.g., username: myuser

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement