Chore: Upgrade Jenkins-job-builder to 6.3.0
[releng/global-jjb.git] / shell / pypi-dist-build.sh
1 #!/bin/bash
2 # SPDX-License-Identifier: EPL-1.0
3 ##############################################################################
4 # Copyright (c) 2019 The Linux Foundation and others.
5 #
6 # All rights reserved. This program and the accompanying materials
7 # are made available under the terms of the Eclipse Public License v1.0
8 # which accompanies this distribution, and is available at
9 # http://www.eclipse.org/legal/epl-v10.html
10 ##############################################################################
11 echo "---> pypi-dist-build.sh"
12
13 # Script to create Python source and binary distributions
14 # Requires project file "setup.py"
15
16 # Ensure we fail the job if any steps fail.
17 set -eu -o pipefail
18
19 # shellcheck disable=SC1090
20 source ~/lf-env.sh
21
22 # Version controlled by JJB_VERSION
23 lf-activate-venv setuptools==65.7.0 urllib3~=1.26.15 twine wheel readline
24
25 bdist=""
26 if $BUILD_BDIST_WHEEL; then
27     echo "INFO: adding wheel to build binary distribution"
28     bdist="bdist_wheel"
29 fi
30
31 echo "INFO: cd to tox-dir $TOX_DIR"
32 cd "$WORKSPACE/$TOX_DIR"
33
34 echo "INFO: creating distributions"
35 python3 setup.py sdist $bdist
36
37 echo "INFO: checking distributions"
38 twine check dist/*
39
40 echo "---> pypi-dist-build.sh ends"