What is the correct TWINE_REPOSITORY_URL for GitLab pipeline upload?

103 Views Asked by At

I've been trying to create my very first GitLab pipeline and have read numerous articles and questions on this topic such as:

Upload to pypi from Gitlab Pipelines

and

https://medium.com/packagr/integrating-packagr-with-gitlab-ci-f56c1b33e789

but so far I cannot seem to get the correct TWINE_REPOSITORY_URL as my pipeline returns

$ twine upload dist/*
Uploading distributions to https://gitlab.com/glicka/merlot/-/packages
Uploading merlot-0.0.1-py3-none-any.whl
100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 5.6/5.6 kB • 00:00 • ?
WARNING  Received "500: Internal Server Error"                                  
         Package upload appears to have failed. Retry 1 of 5.                   
Uploading merlot-0.0.1-py3-none-any.whl
100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 5.6/5.6 kB • 00:00 • ?
WARNING  Received "500: Internal Server Error"                                  
         Package upload appears to have failed. Retry 2 of 5.                   
Uploading merlot-0.0.1-py3-none-any.whl
100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 5.6/5.6 kB • 00:00 • ?
WARNING  Received "500: Internal Server Error"                                  
         Package upload appears to have failed. Retry 3 of 5.                   
Uploading merlot-0.0.1-py3-none-any.whl
100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 5.6/5.6 kB • 00:00 • ?
WARNING  Received "500: Internal Server Error"                                  
         Package upload appears to have failed. Retry 4 of 5.                   
Uploading merlot-0.0.1-py3-none-any.whl
100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 5.6/5.6 kB • 00:00 • ?
WARNING  Received "500: Internal Server Error"                                  
         Package upload appears to have failed. Retry 5 of 5.                   
WARNING  Error during upload. Retry with the --verbose option for more details. 
ERROR    HTTPError: 500 Internal Server Error from                              
         https://gitlab.com/glicka/merlot/-/packages                            
         Internal Server Error                                                  
Cleaning up project directory and file based variables
00:01
ERROR: Job failed: exit code 1

My .gitlab-ci.yml file looks like

variables:
  TWINE_PASSWORD: "#MerlotCICDPW1"
  TWINE_REPOSITORY_URL: "https://gitlab.com/glicka/merlot/-/packages"
  TWINE_USERNAME: "merlot"

stages:          # List of stages for jobs, and their order of execution
  - build

build-job:       # This job runs in the build stage, which runs first.
  stage: build
  image: python:3.11-bullseye
  # only:
  #   - tags
  script:
    - echo "Compiling the code..."
    - pip install twine wheel
    - python setup.py sdist bdist_wheel
    - twine upload dist/*
    - echo "Compile complete."

I can't seem to get the correct ingredients for my pipeline to publish a build successfully. Can you please help guide me?

My project exists here: https://gitlab.com/glicka/merlot/-/tree/glicka-setup-pipeline?ref_type=heads

0

There are 0 best solutions below