Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upload wheels to GitHub Releases #156

Merged
merged 3 commits into from
Aug 7, 2020
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
40 changes: 27 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ env:
- BUILD_DEPENDS=""
- TEST_DEPENDS="pytest pytest-cov"
- MACOSX_DEPLOYMENT_TARGET=10.10
- 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.


language: python
# Default Python version is usually 3.6
Expand Down Expand Up @@ -110,17 +106,20 @@ jobs:
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.

env:
- MB_PYTHON_VERSION=3.6
- LATEST="true"

- name: "3.6 Xenial latest"
os: linux
if: tag IS blank
env:
- MB_PYTHON_VERSION=3.6
- LATEST="true"
- name: "3.6 Xenial 32-bit latest"
os: linux
if: tag IS blank
env:
- MB_PYTHON_VERSION=3.6
- PLAT=i686
Expand All @@ -130,35 +129,41 @@ jobs:
os: osx
osx_image: xcode9.3
language: generic
if: tag IS blank
env:
- MB_PYTHON_VERSION=3.7
- LATEST="true"
- name: "3.8 macOS latest"
os: osx
osx_image: xcode9.3
language: generic
if: tag IS blank
env:
- MB_PYTHON_VERSION=3.8
- LATEST="true"

- name: "3.7 Xenial latest"
os: linux
if: tag IS blank
env:
- MB_PYTHON_VERSION=3.7
- LATEST="true"
- name: "3.7 Xenial 32-bit latest"
os: linux
if: tag IS blank
env:
- MB_PYTHON_VERSION=3.7
- PLAT=i686
- LATEST="true"
- name: "3.8 Xenial latest"
os: linux
if: tag IS blank
env:
- MB_PYTHON_VERSION=3.8
- LATEST="true"
- name: "3.8 Xenial 32-bit latest"
os: linux
if: tag IS blank
env:
- MB_PYTHON_VERSION=3.8
- PLAT=i686
Expand All @@ -168,12 +173,14 @@ jobs:
os: osx
osx_image: xcode9.3
language: generic
if: tag IS blank
env:
- MB_PYTHON_VERSION=pypy3.6-7.3
- MB_PYTHON_OSX_VER=10.9
- LATEST="true"
- name: "3.6 Xenial 64-bit PyPy latest"
os: linux
if: tag IS blank
env:
- MB_PYTHON_VERSION=pypy3.6-7.3
- MB_ML_VER=2010
Expand All @@ -183,6 +190,7 @@ jobs:
- name: "3.6 Xenial aarch64 latest"
os: linux
arch: arm64
if: tag IS blank
env:
- PLAT=aarch64
- MB_ML_VER=2014
Expand All @@ -192,6 +200,7 @@ jobs:
- name: "3.7 Xenial aarch64 latest"
os: linux
arch: arm64
if: tag IS blank
env:
- PLAT=aarch64
- MB_ML_VER=2014
Expand All @@ -201,6 +210,7 @@ jobs:
- name: "3.8 Xenial aarch64 latest"
os: linux
arch: arm64
if: tag IS blank
env:
- PLAT=aarch64
- MB_ML_VER=2014
Expand All @@ -219,16 +229,20 @@ install:
- if [[ -n "$LATEST" ]]; then BUILD_COMMIT=master; fi
- clean_code $REPO_DIR $BUILD_COMMIT
- build_wheel $REPO_DIR $PLAT
- ls -l "${TRAVIS_BUILD_DIR}/${WHEEL_SDIR}/"

script:
- install_run $PLAT

after_success:
# Upload wheels to Rackspace container
- if [[ -z "$LATEST" ]]; then
pip install wheelhouse-uploader;
python -m wheelhouse_uploader upload --local-folder
${TRAVIS_BUILD_DIR}/wheelhouse/
--no-update-index
wheels;
fi
# Upload wheels to GitHub Releases
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.

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).

https://docs.travis-ci.com/user/deployment/releases/#authenticating-with-an-oauth-token

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: "${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.

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.

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.

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.

Finally, tell Travis not to delete all the files, including wheels, before deploy.

https://docs.travis-ci.com/user/deployment#uploading-files-and-skip_cleanup