Skip to content
This repository was archived by the owner on Apr 25, 2022. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions push_wheels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ git config --global user.email "[email protected]"
git config --global user.name "travis-ci"
git clone --quiet --branch=master \
"https://${GH_OAUTH_TOKEN}@github.com//${GH_OWNER}/${GH_PROJECT_NAME}" \
${FRESH_REPO_DIR}
"${FRESH_REPO_DIR}"
# NOTE: Assumes ${GH_OAUTH_TOKEN}, ${GH_OWNER} and ${GH_PROJECT_NAME} are
# set in Travis build settings for project.
cd ${FRESH_REPO_DIR}
cd "${FRESH_REPO_DIR}"

###############################################
# (Optionally) make wheelhouse in fresh repo. #
Expand All @@ -53,11 +53,15 @@ NEW_WHEELS=$(comm -13 <(ls -b wheelhouse/) <(ls -b "${WHEELHOUSE}"))
#####################################
# Add new wheels to the wheelhouse. #
#####################################
# NOTE: We explicitly don't use "set -e" because we allow "git add"
# below to fail on ignored files.
set +e
for NEW_WHEEL in ${NEW_WHEELS}
do
cp "${WHEELHOUSE}/${NEW_WHEEL}" wheelhouse/
git add "wheelhouse/${NEW_WHEEL}"
done
set -e

##########################################
# Remove old wheels from the wheelhouse. #
Expand All @@ -72,7 +76,11 @@ done
# Display git status and push wheels. #
#######################################
git status
# H/T: http://stackoverflow.com/a/13730477/1068170
git commit -m "Latest wheels build by travis-ci. [ci skip]"
git status
git push origin master
# H/T: http://stackoverflow.com/a/5139346/1068170
if [[ -n "$(git status --porcelain)" ]]; then
git commit -m "Latest wheels build by travis-ci. [ci skip]"
git status
git push origin master
else
echo "Nothing to commit. Exiting without pushing changes."
fi