Chandan Singh pushed to branch chandan/automate-pypi-release at BuildStream / buildstream
Commits:
-
2a29cd62
by Chandan Singh at 2018-08-24T21:22:50Z
1 changed file:
Changes:
| ... | ... | @@ -281,3 +281,26 @@ 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 |
+ only:
|
|
| 306 |
+ - tags
|
