-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request h5py#2004 from takluyver/aarch64-wheels-refine
Refine how aarch64 wheels are named for upload to anaconda.org
- Loading branch information
Showing
2 changed files
with
23 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,29 @@ | ||
ANACONDA_ORG="scipy-wheels-nightly"; | ||
pip install git+https://github.com/Anaconda-Server/anaconda-client; | ||
|
||
# rename wheels | ||
# appending timestamp to wheels package name | ||
# e.g. h5py-3.3.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl to h5py-3.3.0-20211004151033-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl | ||
for whl in ${TRAVIS_BUILD_DIR}/wheelhouse/h5py-*.whl; do | ||
newname=$(echo "$whl" | sed "s/\(h5py-[0-9][0-9]*[.[0-9]*]*-\)\(cp*\)/\1$(date '+%Y%m%d%H%M%S')-\2/") | ||
if [ "$newname" != "$whl" ]; then | ||
mv $whl $newname | ||
fi | ||
done | ||
if [[ "$TRAVIS_EVENT_TYPE" != "cron" && -z "$TRAVIS_TAG" ]] ; then | ||
echo "Not uploading wheels (build not for cron or git tag)" | ||
exit 0 | ||
fi | ||
|
||
# rename wheels if not on a tag | ||
# inserting commit count & hash from git describe | ||
# e.g. h5py-3.3.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl to | ||
# h5py-3.3.0-3-g4320f2ea-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl | ||
if [[ -z "$TRAVIS_TAG" ]] ; then | ||
descr=$(git describe --tags) | ||
descr=${descr#*-} # Chop off tag (should be version number) | ||
build_tag=${descr//-/_} # Convert - to _ for build tag | ||
echo "Setting build tag to ${build_tag}" | ||
for whl in "${TRAVIS_BUILD_DIR}"/wheelhouse/h5py-*.whl; do | ||
newname=$(echo "$whl" | sed "s/\(h5py-[0-9][0-9]*[.[0-9]*]*-\)\(cp*\)/\1${build_tag}-\2/") | ||
if [ "$newname" != "$whl" ]; then | ||
mv "$whl" "$newname" | ||
fi | ||
done | ||
fi | ||
|
||
# upload wheels | ||
if [[ -n "${ANACONDA_ORG_UPLOAD_TOKEN}" ]] ; then | ||
anaconda -t ${ANACONDA_ORG_UPLOAD_TOKEN} upload --force -u ${ANACONDA_ORG} ${TRAVIS_BUILD_DIR}/wheelhouse/h5py-*.whl; | ||
anaconda -t ${ANACONDA_ORG_UPLOAD_TOKEN} upload -u ${ANACONDA_ORG} "${TRAVIS_BUILD_DIR}"/wheelhouse/h5py-*.whl; | ||
fi; |