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

Update GitHub Action examples #1135

Merged
merged 3 commits into from Jun 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Expand Up @@ -83,10 +83,10 @@ jobs:
os: [ubuntu-20.04, windows-2019, macOS-10.15]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

# Used to host cibuildwheel
- uses: actions/setup-python@v2
- uses: actions/setup-python@v3

- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.7.0
Expand All @@ -97,7 +97,7 @@ jobs:
# env:
# CIBW_SOME_OPTION: value

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
```
Expand Down
8 changes: 4 additions & 4 deletions docs/deliver-to-pypi.md
Expand Up @@ -46,15 +46,15 @@ well as several useful actions. Alongside your existing job(s) that runs cibuild
name: Make SDist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Optional, use if you use setuptools_scm
submodules: true # Optional, use if you have submodules

- name: Build SDist
run: pipx run build --sdist

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
path: dist/*.tar.gz
```
Expand All @@ -69,12 +69,12 @@ This requires a [PyPI upload token](https://pypi.org/manage/account/token/), sto
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist

- uses: pypa/gh-action-pypi-publish@v1.4.2
- uses: pypa/gh-action-pypi-publish@v1.5.0
with:
user: __token__
password: ${{ secrets.pypi_password }}
Expand Down
17 changes: 8 additions & 9 deletions docs/setup.md
Expand Up @@ -154,10 +154,9 @@ To build Linux, Mac, and Windows wheels using GitHub Actions, create a `.github/
{% include "../examples/github-minimal.yml" %}
```


You can use `env:` with the action just like you would with `run:`; you can
also use `with:` to set the command line options: `package-dir: .` and
`output-dir: wheelhouse` (those values are the defaults).
Use `env:` to pass [build options](options.md) and `with:` to set
`package-dir: .`, `output-dir: wheelhouse` and `config-file: ''`
locations (those values are the defaults).

!!! tab "pipx"
The GitHub Actions runners have pipx installed, so you can easily build in
Expand All @@ -180,12 +179,12 @@ To build Linux, Mac, and Windows wheels using GitHub Actions, create a `.github/
os: [ubuntu-20.04, windows-2019, macos-10.15]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Build wheels
run: pipx run cibuildwheel==2.7.0

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
```
Expand All @@ -212,18 +211,18 @@ To build Linux, Mac, and Windows wheels using GitHub Actions, create a `.github/
os: [ubuntu-20.04, windows-2019, macos-10.15]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

# Used to host cibuildwheel
- uses: actions/setup-python@v2
- uses: actions/setup-python@v3

- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.7.0

- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
```
Expand Down
4 changes: 2 additions & 2 deletions examples/github-apple-silicon.yml
Expand Up @@ -7,13 +7,13 @@ jobs:
name: Build wheels on macos-10.15
runs-on: macos-10.15
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Build wheels
uses: pypa/cibuildwheel@v2.7.0
env:
CIBW_ARCHS_MACOS: x86_64 universal2

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
14 changes: 8 additions & 6 deletions examples/github-deploy.yml
Expand Up @@ -19,25 +19,25 @@ jobs:
os: [ubuntu-20.04, windows-2019, macos-10.15]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Build wheels
uses: pypa/cibuildwheel@v2.7.0

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl

build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Build sdist
run: pipx run build --sdist

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
path: dist/*.tar.gz

Expand All @@ -49,12 +49,14 @@ jobs:
# alternatively, to publish when a GitHub Release is created, use the following rule:
# if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v3
with:
# unpacks default artifact into dist/
# if `name: artifact` is omitted, the action will create extra parent dir
name: artifact
path: dist

- uses: pypa/gh-action-pypi-publish@v1.4.2
- uses: pypa/gh-action-pypi-publish@v1.5.0
with:
user: __token__
password: ${{ secrets.pypi_password }}
Expand Down
10 changes: 7 additions & 3 deletions examples/github-minimal.yml
Expand Up @@ -11,14 +11,18 @@ jobs:
os: [ubuntu-20.04, windows-2019, macos-10.15]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Build wheels
uses: pypa/cibuildwheel@v2.7.0
# to supply options, put them in 'env', like:
# env:
# CIBW_SOME_OPTION: value
# ...
# with:
# package-dir: .
# output-dir: wheelhouse
# config-file: {package}/pyproject.toml

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
6 changes: 3 additions & 3 deletions examples/github-with-qemu.yml
Expand Up @@ -11,9 +11,9 @@ jobs:
os: [ubuntu-20.04, windows-2019, macos-10.15]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: actions/setup-python@v2
- uses: actions/setup-python@v3
name: Install Python
with:
python-version: '3.7'
Expand All @@ -31,6 +31,6 @@ jobs:
# emulated ones
CIBW_ARCHS_LINUX: auto aarch64 ppc64le s390x

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl