Upload wheels to GitHub Releases#156
Conversation
| - 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=" |
There was a problem hiding this comment.
Not needed, no longer using wheelhouse_uploader.
| os: osx | ||
| osx_image: xcode9.3 | ||
| language: generic | ||
| if: tag IS blank |
There was a problem hiding this comment.
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/" |
There was a problem hiding this comment.
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= |
There was a problem hiding this comment.
This is an encrypted OAuth token created using travis setup releases on my account when inside a local checkout of the https://github.com/python-pillow/pillow-wheels/ repo (ie. not my fork).
| provider: releases | ||
| api_key: | ||
| secure: PTgVG7DrYa2FTSQOq0eDaHDZb1vy0vf6MulyuoXMg8rssPQgJ/mYxRpNDK4V0EKolpN7f8s/OGg+fpNNtp5pOCJGsx0Okcf+YB2ac+Xl7DQPBucbDKFXs1ndf/ny6umk0TXX8JTrDp/mJDJf401yx1+qsZ6X/PFvchXvXVrQ+SQ= | ||
| file_glob: true |
There was a problem hiding this comment.
So we can use *.whl in the next line.
| file_glob: true | ||
| file: "${TRAVIS_BUILD_DIR}/${WHEEL_SDIR}/*.whl" | ||
| on: | ||
| condition: -z "$LATEST" |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
This makes sure the deploy is only run from this repo.
| on: | ||
| condition: -z "$LATEST" | ||
| repo: python-pillow/pillow-wheels | ||
| tags: true |
| condition: -z "$LATEST" | ||
| repo: python-pillow/pillow-wheels | ||
| tags: true | ||
| skip_cleanup: true |
There was a problem hiding this comment.
Finally, tell Travis not to delete all the files, including wheels, before deploy.
|
And here's a test build on my fork (ignore the release is 7.2.1 and the files are 7.2.0, was just for test): |
Co-authored-by: Andrew Murray <[email protected]>
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:
RELEASING.mdchecklist,README.mdupdate-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 uploadwith 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:
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.