forked from xtream1101/humblebundle-downloader
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
48 lines (41 loc) · 1.01 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
image: python:3.7
stages:
- test
- release
- package
flake8:
stage: test
except:
- tags
script:
- pip install tox
- tox -e flake8
pytest:
stage: test
except:
- tags
script:
- pip install tox
- tox -e py37
pypi-package:
stage: package
only:
- tags
script:
- pip install twine
- rm -f dist/*
- python setup.py sdist
- twine upload -u ${PYPI_USER} -p ${PYPI_PASS} dist/*
.write_permission: &write_permission |
git config --global user.email "gitlab-ci"; git config --global user.name "gitlab-ci"
url_host=`git remote get-url origin | sed -e "s/https:\/\/gitlab-ci-token:.*@//g"`
git remote set-url origin "https://gitlab-ci-token:${CI_TAG_UPLOAD_TOKEN}@${url_host}"
tag:
stage: release
only:
- main
script:
- *write_permission
- export VERSION=$(echo $(python -c "import humblebundle_downloader._version as v; print(v.__version__)"))
- git tag -a $VERSION -m "Version created by gitlab-ci Build"
- git push origin $VERSION