-
Notifications
You must be signed in to change notification settings - Fork 61
/
.popper.yml
64 lines (56 loc) · 1.58 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, PYTHON_VERSION, IS_PULL_REQUEST]
args:
- |
# build does not correspond to the docker,python-3.8 element of the matrix
if [[ "$ENGINE" != "docker" || "$PYTHON_VERSION" != "3.8" ]]; then
exit 78
fi
# a build for a PR
if [[ "$IS_PULL_REQUEST" == "true" ]]; 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: [DOCKERHUB_USERNAME, DOCKERHUB_PASSWORD]
runs: [sh, -ec]
args:
- |
docker build -t getpopper/popper src/
docker login -u "$DOCKERHUB_USERNAME" -p "$DOCKERHUB_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/*