forked from getpopper/popper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.popper.yml
64 lines (56 loc) · 1.59 KB
/
.popper.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
steps:
- id: filter build
uses: docker://docker:19.03.3
runs: [sh, -exc]
secrets: [ENGINE, TRAVIS_PYTHON_VERSION, TRAVIS_PULL_REQUEST]
args:
- |
# build does not correspond to the docker,python-3.7 element of the matrix
if [[ "$ENGINE" != "docker" || "$TRAVIS_PYTHON_VERSION" != "3.7" ]]; then
exit 78
fi
# it's a build for a PR
if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then
exit 78
fi
# build is not for upstream (getpopper/popper) repo
if [[ "$GIT_REMOTE_ORIGIN_URL" != "https://github.com/getpopper/popper" ]]; then
exit 78
fi
# not on master
if [[ "$GIT_BRANCH" != "master" ]]; then
exit 78
fi
- id: dockerhub release
uses: docker://docker:19.03
secrets: [DOCKER_USERNAME, DOCKER_PASSWORD]
runs: [sh, -ec]
args:
- |
docker build -t getpopper/popper src/
docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD"
docker tag getpopper/popper getpopper/popper:$GIT_SHA_SHORT
docker push getpopper/popper
docker push getpopper/popper:$GIT_SHA_SHORT
if [[ "$GIT_TAG" != "" ]]; then
docker tag getpopper/popper getpopper/popper:$GIT_TAG
docker push getpopper/popper:$GIT_TAG
fi
- id: filter pypi if not a tagged release
uses: docker://docker:19.03
runs: [sh, -ec]
args:
- |
if [[ "$GIT_TAG" == "" ]]; then
exit 78
fi
- id: pypi release
uses: docker://python:3.7-buster
secrets: [PYPI_USERNAME, PYPI_PASSWORD]
runs: [bash, -ec]
args:
- |
pip install twine
cd src/
python setup.py sdist
twine upload -u "$PYPI_USERNAME" -p "$PYPI_PASSWORD" dist/*