32
32
exit 1
33
33
fi
34
34
35
- # Report the inferred directory whwere python is found
35
+ # Report the inferred directory where python is found
36
36
echo " PYTHON_DIR: ${PYTHON_DIR} "
37
37
38
+ # The pagmo version to be used for releases.
39
+ export PAGMO_VERSION_RELEASE=" 2.19.0"
40
+
41
+ # Check if this is a release build.
42
+ if [[ " ${GITHUB_REF} " == " refs/tags/v" * ]]; then
43
+ echo " Tag build detected"
44
+ export PYGMO_RELEASE_BUILD=" yes"
45
+ else
46
+ echo " Non-tag build detected"
47
+ fi
48
+
38
49
# Python mandatory deps.
39
50
/opt/python/${PYTHON_DIR} /bin/pip install cloudpickle numpy
40
51
# Python optional deps.
@@ -45,8 +56,14 @@ echo "PYTHON_DIR: ${PYTHON_DIR}"
45
56
cd /root/install
46
57
47
58
# Install pagmo
48
- git clone https://github.com/esa/pagmo2.git
49
- cd pagmo2
59
+ if [[ " ${PYGMO_RELEASE_BUILD} " == " yes" ]]; then
60
+ curl -L -o pagmo2.tar.gz https://github.com/esa/pagmo2/archive/refs/tags/v${PAGMO_VERSION_RELEASE} .tar.gz
61
+ tar xzf pagmo2.tar.gz
62
+ cd pagmo2-${PAGMO_VERSION_RELEASE}
63
+ else
64
+ git clone https://github.com/esa/pagmo2.git
65
+ cd pagmo2
66
+ fi
50
67
51
68
mkdir build
52
69
cd build
@@ -84,14 +101,23 @@ sleep 20
84
101
/opt/python/${PYTHON_DIR} /bin/python -c " import pygmo; pygmo.test.run_test_suite(1); pygmo.mp_island.shutdown_pool(); pygmo.mp_bfe.shutdown_pool()"
85
102
86
103
# Upload to pypi. This variable will contain something if this is a tagged build (vx.y.z), otherwise it will be empty.
87
- if [[ " ${PYGMO_RELEASE_VERSION} " != " " ]]; then
88
- echo " Release build detected, creating the source code archive."
89
- cd ${GITHUB_WORKSPACE}
90
- TARBALL_NAME=${GITHUB_WORKSPACE} /build/wheel/dist2/pygmo-${PYGMO_RELEASE_VERSION} .tar
91
- git archive --format=tar --prefix=pygmo2/ -o ${TARBALL_NAME} ${BRANCH_NAME}
92
- tar -rf ${TARBALL_NAME} --transform " s,^build/wheel/pygmo.egg-info,pygmo2," build/wheel/pygmo.egg-info/PKG-INFO
93
- gzip -9 ${TARBALL_NAME}
94
- echo " ... uploading all to PyPi."
104
+ # if [[ "${PYGMO_RELEASE_VERSION}" != "" ]]; then
105
+ # echo "Release build detected, creating the source code archive."
106
+ # cd ${GITHUB_WORKSPACE}
107
+ # TARBALL_NAME=${GITHUB_WORKSPACE}/build/wheel/dist2/pygmo-${PYGMO_RELEASE_VERSION}.tar
108
+ # git archive --format=tar --prefix=pygmo2/ -o ${TARBALL_NAME} ${BRANCH_NAME}
109
+ # tar -rf ${TARBALL_NAME} --transform "s,^build/wheel/pygmo.egg-info,pygmo2," build/wheel/pygmo.egg-info/PKG-INFO
110
+ # gzip -9 ${TARBALL_NAME}
111
+ # echo "... uploading all to PyPi."
112
+ # /opt/python/${PYTHON_DIR}/bin/pip install twine
113
+ # /opt/python/${PYTHON_DIR}/bin/twine upload -u ci4esa ${GITHUB_WORKSPACE}/build/wheel/dist2/pygmo*
114
+ # fi
115
+
116
+ # Upload to PyPI.
117
+ if [[ " ${PYGMO_RELEASE_BUILD} " == " yes" ]]; then
95
118
/opt/python/${PYTHON_DIR} /bin/pip install twine
96
119
/opt/python/${PYTHON_DIR} /bin/twine upload -u ci4esa ${GITHUB_WORKSPACE} /build/wheel/dist2/pygmo*
97
120
fi
121
+
122
+ set +e
123
+ set +x
0 commit comments