docs: use GitHub example in readme (#479)
* docs: use GitHub example in readme * Apply suggestions from code review Co-authored-by: Joe Rickerby <joerick@mac.com> * Copy/style tweaks Co-authored-by: Joe Rickerby <joerick@mac.com>
This commit is contained in:
co-authored by
Joe Rickerby
parent
4f4dae27fb
commit
d83daa3958
@@ -9,7 +9,7 @@ cibuildwheel
|
|||||||
|
|
||||||
Python wheels are great. Building them across **Mac, Linux, Windows**, on **multiple versions of Python**, is not.
|
Python wheels are great. Building them across **Mac, Linux, Windows**, on **multiple versions of Python**, is not.
|
||||||
|
|
||||||
`cibuildwheel` is here to help. `cibuildwheel` runs on your CI server - currently it supports Azure Pipelines, Travis CI, AppVeyor, GitHub Actions and CircleCI - and it builds and tests your wheels across all of your platforms.
|
`cibuildwheel` is here to help. `cibuildwheel` runs on your CI server - currently it supports GitHub Actions, Azure Pipelines, Travis CI, AppVeyor, and CircleCI - and it builds and tests your wheels across all of your platforms.
|
||||||
|
|
||||||
|
|
||||||
What does it do?
|
What does it do?
|
||||||
@@ -58,49 +58,41 @@ Usage
|
|||||||
Example setup
|
Example setup
|
||||||
-------------
|
-------------
|
||||||
|
|
||||||
To build manylinux, macOS, and Windows wheels on Travis CI and upload them to PyPI whenever you tag a version, you could use this `.travis.yml`:
|
To build manylinux, macOS, and Windows wheels on Github Actions, you could use this `.github/workflows/wheels.yml`:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
language: python
|
name: Build
|
||||||
|
|
||||||
|
on: [push, pull_request]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
include:
|
build_wheels:
|
||||||
# perform a linux build
|
name: Build wheels on ${{ matrix.os }}
|
||||||
- services: docker
|
runs-on: ${{ matrix.os }}
|
||||||
# and a mac build
|
strategy:
|
||||||
- os: osx
|
matrix:
|
||||||
language: shell
|
os: [ubuntu-20.04, windows-2019, macOS-10.15]
|
||||||
# and a windows build
|
|
||||||
- os: windows
|
|
||||||
language: shell
|
|
||||||
before_install:
|
|
||||||
- choco install python --version 3.8.0
|
|
||||||
- export PATH="/c/Python38:/c/Python38/Scripts:$PATH"
|
|
||||||
# make sure it's on PATH as 'python3'
|
|
||||||
- ln -s /c/Python38/python.exe /c/Python38/python3.exe
|
|
||||||
|
|
||||||
env:
|
steps:
|
||||||
global:
|
- uses: actions/checkout@v2
|
||||||
- TWINE_USERNAME=__token__
|
|
||||||
# Note: TWINE_PASSWORD is set to a PyPI API token in Travis settings
|
|
||||||
|
|
||||||
install:
|
- uses: actions/setup-python@v2
|
||||||
- python3 -m pip install cibuildwheel==1.7.1
|
name: Install Python
|
||||||
|
|
||||||
script:
|
- name: Install cibuildwheel
|
||||||
# build the wheels, put them into './wheelhouse'
|
run: python -m pip install cibuildwheel==1.7.1
|
||||||
- python3 -m cibuildwheel --output-dir wheelhouse
|
|
||||||
|
|
||||||
after_success:
|
- name: Build wheels
|
||||||
# if the release was tagged, upload them to PyPI
|
run: python -m cibuildwheel --output-dir wheelhouse
|
||||||
- |
|
env:
|
||||||
if [[ $TRAVIS_TAG ]]; then
|
CIBW_SKIP: "cp27-* pp27-*" # skip Python 2.7 wheels
|
||||||
python3 -m pip install twine
|
|
||||||
python3 -m twine upload wheelhouse/*.whl
|
- uses: actions/upload-artifact@v2
|
||||||
fi
|
with:
|
||||||
|
path: ./wheelhouse/*.whl
|
||||||
```
|
```
|
||||||
|
|
||||||
For more information, including how to build on GitHub Actions, Appveyor, Azure Pipelines, or CircleCI, check out the [documentation](https://cibuildwheel.readthedocs.org) and the [examples](https://github.com/joerick/cibuildwheel/tree/master/examples).
|
For more information, including building on Python 2, PyPI deployment, and the use of other CI services like Travis CI, Appveyor, Azure Pipelines, or CircleCI, check out the [documentation](https://cibuildwheel.readthedocs.org) and the [examples](https://github.com/joerick/cibuildwheel/tree/master/examples).
|
||||||
|
|
||||||
Options
|
Options
|
||||||
-------
|
-------
|
||||||
|
|||||||
@@ -19,11 +19,6 @@ jobs:
|
|||||||
# make sure it's on PATH as 'python3'
|
# make sure it's on PATH as 'python3'
|
||||||
- ln -s /c/Python38/python.exe /c/Python38/python3.exe
|
- ln -s /c/Python38/python.exe /c/Python38/python3.exe
|
||||||
|
|
||||||
env:
|
|
||||||
global:
|
|
||||||
- TWINE_USERNAME=__token__
|
|
||||||
# Note: TWINE_PASSWORD is set to a PyPI API token in Travis settings
|
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- python3 -m pip install cibuildwheel==1.7.1
|
- python3 -m pip install cibuildwheel==1.7.1
|
||||||
|
|
||||||
@@ -31,10 +26,11 @@ script:
|
|||||||
# build the wheels, put them into './wheelhouse'
|
# build the wheels, put them into './wheelhouse'
|
||||||
- python3 -m cibuildwheel --output-dir wheelhouse
|
- python3 -m cibuildwheel --output-dir wheelhouse
|
||||||
|
|
||||||
after_success:
|
deploy:
|
||||||
# if the release was tagged, upload them to PyPI
|
provider: pypi
|
||||||
- |
|
username: "__token__"
|
||||||
if [[ $TRAVIS_TAG ]]; then
|
skip_cleanup: true
|
||||||
python3 -m pip install twine
|
on:
|
||||||
python3 -m twine upload wheelhouse/*.whl
|
tags: true
|
||||||
fi
|
password:
|
||||||
|
secure: "" # Set to an encrypted API token. See https://docs.travis-ci.com/user/deployment/pypi/
|
||||||
|
|||||||
Reference in New Issue
Block a user