-
Notifications
You must be signed in to change notification settings - Fork 210
/
Jenkinsfile-pypi
43 lines (27 loc) · 1.01 KB
/
Jenkinsfile-pypi
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
@Library("platform") _
properties([disableConcurrentBuilds()])
// from shared library - uses tags to set the platform name
// (this is a pretty stupid way to set a parameter, but I don't
// know of a better way to parameterize a multibranch pipeline)
platform = pypi_platform()
py_version = pypi_py_version()
currentBuild.description = "PyPI deployment " + platform
docker_image = "jenkins-manylinux2014_x86_64-pypi"
target = platform + ".whl"
node("linux") {
stage("Checkout sources") {
checkout scm
}
stage("Building target ${target}") {
sh("rm -rf wheelhouse ; mkdir -p wheelhouse")
withDockerContainer(image: docker_image, args: "-v " + pwd() + ":/io") {
sh("PY_VERSION=" + py_version + " /io/ci-scripts/docker/docker_build_jenkins.sh")
}
}
stage("Publish and test") {
// publish for release tags
if (BRANCH_NAME.startsWith('pypi_')) {
sh("twine upload --skip-existing wheelhouse/klayout-*manylinux2014*.whl wheelhouse/*.zip")
}
}
}