Skip to content
This repository was archived by the owner on Oct 8, 2024. It is now read-only.

Upload wheels to GitHub Releases#156

Merged
radarhere merged 3 commits intopython-pillow:masterfrom
hugovk:github-releases
Aug 7, 2020
Merged

Upload wheels to GitHub Releases#156
radarhere merged 3 commits intopython-pillow:masterfrom
hugovk:github-releases

Conversation

@hugovk
Copy link
Member

@hugovk hugovk commented Jul 7, 2020

Fixes #146, using one of @mattip's suggestions.

Based on Cython's config:

Travis CI docs:

The wheels are only built for tags, and the workflow will change a bit so we'll need to update:

  • the main RELEASING.md checklist,
  • this README.md
  • and update-pillow-tag.sh.

When releasing, we add and push a tag. It builds as normal (and also skips the "latest" jobs, we don't need to build/deploy them). The wheels are uploaded to a matching tag release here in this repo.

We can then download the wheels from the release, and can twine upload with the separately-built Windows wheels, and source (this looks handy for downloading).

(We could delete the release/files from here if we wanted to ensure PyPI is the place to go, not sure if that's necessary.)

Here's an example:

diff --git a/update-pillow-tag.sh b/update-pillow-tag.sh
index a48d6ca..c3000f1 100755
--- a/update-pillow-tag.sh
+++ b/update-pillow-tag.sh
@@ -15,4 +15,5 @@ git fetch --all
 git checkout $1
 cd ..
 git commit -m "Pillow -> $1" Pillow
-git push
+git tag "$1"
+git push --tags

Note we'd still need a normal git push (without --tags), but that will do a normal build of latest and non-latest (and no wheels), so that could come in the post-release thing, to avoid eating up CI time.

I'll annotate some lines too with some extra info.

@hugovk hugovk mentioned this pull request Jul 7, 2020
- WHEELHOUSE_UPLOADER_USERNAME=travis-worker
# Following generated with
# travis encrypt -r python-pillow/pillow-wheels WHEELHOUSE_UPLOADER_SECRET=<the api key>
- secure: "ky76goiK6n4k8V9/uG340GSFVwmjE7G76l9xbhhGZkcph4eTwN5VRM/tqyJvlNs/HZOhKSILfyGBeaG8qf7gHmwr0touPT+EjWn4TNV8iyVj75ZshgRE9DuaIAfdH89gW2m+BmvBDyzi0JE3KVCu55NcGm8h7Ecl6nmQ/c2iROY="
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed, no longer using wheelhouse_uploader.

os: osx
osx_image: xcode9.3
language: generic
if: tag IS blank
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prevent the latest jobs building for tag builds.

.travis.yml Outdated
- if [[ -n "$LATEST" ]]; then BUILD_COMMIT=master; fi
- clean_code $REPO_DIR $BUILD_COMMIT
- build_wheel $REPO_DIR $PLAT
- ls -l "${TRAVIS_BUILD_DIR}/wheelhouse/"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For info to confirm a wheel was built.

deploy:
provider: releases
api_key:
secure: PTgVG7DrYa2FTSQOq0eDaHDZb1vy0vf6MulyuoXMg8rssPQgJ/mYxRpNDK4V0EKolpN7f8s/OGg+fpNNtp5pOCJGsx0Okcf+YB2ac+Xl7DQPBucbDKFXs1ndf/ny6umk0TXX8JTrDp/mJDJf401yx1+qsZ6X/PFvchXvXVrQ+SQ=
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

provider: releases
api_key:
secure: PTgVG7DrYa2FTSQOq0eDaHDZb1vy0vf6MulyuoXMg8rssPQgJ/mYxRpNDK4V0EKolpN7f8s/OGg+fpNNtp5pOCJGsx0Okcf+YB2ac+Xl7DQPBucbDKFXs1ndf/ny6umk0TXX8JTrDp/mJDJf401yx1+qsZ6X/PFvchXvXVrQ+SQ=
file_glob: true
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we can use *.whl in the next line.

file_glob: true
file: "${TRAVIS_BUILD_DIR}/${WHEEL_SDIR}/*.whl"
on:
condition: -z "$LATEST"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant with if: tag IS blank, but a useful extra guard to make sure we don't build wheels for latest.

file: "${TRAVIS_BUILD_DIR}/${WHEEL_SDIR}/*.whl"
on:
condition: -z "$LATEST"
repo: python-pillow/pillow-wheels
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes sure the deploy is only run from this repo.

on:
condition: -z "$LATEST"
repo: python-pillow/pillow-wheels
tags: true
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And only for tags.

condition: -z "$LATEST"
repo: python-pillow/pillow-wheels
tags: true
skip_cleanup: true
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hugovk
Copy link
Member Author

hugovk commented Jul 7, 2020

Co-authored-by: Andrew Murray <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Do not upload to rackspace

2 participants