3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-27 04:59:24 +01:00

drone: add PyPI push, build Docker on a branch to allow for weekly cron

This commit is contained in:
James Lu 2021-12-30 11:19:35 -08:00
parent ca2d603fa1
commit 499a0dd403
2 changed files with 31 additions and 4 deletions

View File

@ -4,8 +4,8 @@
VERSION="$1"
if test -z "$VERSION"; then
echo "Usage: $0 <version>"
exit 1
echo "Reading version from VERSION file" >&2
VERSION=$(<VERSION)
fi
if [[ "$VERSION" == *"alpha"* || "$VERSION" == *"dev"* ]]; then

View File

@ -44,7 +44,31 @@ local build_docker(py_version) = {
}
}
],
"depends_on": ["test-" + py_version],
"trigger": {
"event": [
"push"
],
"branch": ["release"],
},
"depends_on": ["test-" + py_version]
};
local deploy_pypi(py_version) = {
"kind": "pipeline",
"type": "docker",
"name": "deploy_pypi",
"steps": [
{
"name": "pypi_publish",
"image": "plugins/pypi",
"settings": {
"username": "__token__",
"password": {
"from_secret": "pypi_token"
}
}
}
],
"trigger": {
"event": [
"tag"
@ -52,10 +76,12 @@ local build_docker(py_version) = {
"ref": {
"exclude": [
"refs/tags/*alpha*",
"refs/tags/*beta*",
"refs/tags/*dev*"
]
}
}
},
"depends_on": ["test-" + py_version]
};
[
@ -63,5 +89,6 @@ local build_docker(py_version) = {
test("3.8"),
test("3.9"),
test("3.10"),
deploy_pypi("3.10"),
build_docker("3.10"),
]