[Notes] [Git][BuildStream/buildstream][chandan/automate-pypi-release] .gitlab-ci.yml: Publish to PyPI when new tags are pushed



Title: GitLab

Chandan Singh pushed to branch chandan/automate-pypi-release at BuildStream / buildstream

Commits:

1 changed file:

Changes:

  • .gitlab-ci.yml
    ... ... @@ -281,3 +281,27 @@ pages:
    281 281
       # See https://gitlab.com/gitlab-org/gitlab-ce/issues/35141
    
    282 282
       #
    
    283 283
       - master
    
    284
    +
    
    285
    +# Release to PyPI, only for tags.
    
    286
    +#
    
    287
    +# TODO: To begin with, we only upload to test.pypi. Later we should also push
    
    288
    +# to real PyPI after verifying that it can be installed correctly.
    
    289
    +#
    
    290
    +pypi_release:
    
    291
    +  stage: post
    
    292
    +  dependencies:
    
    293
    +  - source_dist
    
    294
    +  variables:
    
    295
    +    TEST_PYPI_UPLOAD_URL: https://test.pypi.org/legacy/
    
    296
    +    TEST_PYPI_INDEX_URL: https://test.pypi.org/simple/
    
    297
    +    PYPI_UPLOAD_URL: https://upload.pypi.org/legacy/
    
    298
    +  script:
    
    299
    +  # Credentials for PyPI are defined in secret CI variables "TWINE_USERNAME"
    
    300
    +  # and "TWINE_PASSWORD".
    
    301
    +  - pip3 install twine
    
    302
    +  - twine upload --repository-url "$TEST_PYPI_UPLOAD_URL" dist/*.tar.gz
    
    303
    +  - pip3 install --extra-index-url "$TEST_PYPI_INDEX_URL" "BuildStream==$CI_COMMIT_TAG"
    
    304
    +  - bst --version
    
    305
    +
    
    306
    +  only:
    
    307
    +  - tags



  • [Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]