-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #43 from biolab/build_wheels
CI: add build_wheels workflow [skip ci]
- Loading branch information
Showing
1 changed file
with
110 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
name: Build wheels | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
# Enable manual run | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build_wheels: | ||
name: Build wheels on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-20.04, windows-2019, macOS-10.15] | ||
|
||
steps: | ||
- name: Check out the repo | ||
uses: actions/checkout@v2 | ||
|
||
# Used to host cibuildwheel | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
|
||
- name: Install cibuildwheel | ||
run: python -m pip install cibuildwheel==1.9.0 | ||
|
||
- name: Build wheels | ||
run: python -m cibuildwheel --output-dir wheelhouse | ||
env: | ||
CIBW_SKIP: "cp27-* cp35-* pp*" | ||
|
||
- uses: actions/upload-artifact@v2 | ||
with: | ||
path: ./wheelhouse/*.whl | ||
name: bdist_files | ||
|
||
build_sdist: | ||
name: Build source distribution | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Check out the repo | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
|
||
- name: Build sdist (pep517) | ||
run: | | ||
python -m pip install pep517 | ||
python -m pep517.build -s . | ||
- name: Upload sdist | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: sdist_files | ||
path: dist/*.tar.gz | ||
|
||
upload_release_assets: | ||
name: Upload Release Assets | ||
needs: [build_wheels] | ||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
- name: Download bdist files | ||
id: download_artifact | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: bdist_files | ||
path: ~/downloads | ||
|
||
- name: List downloaded artifacts | ||
run: ls -la ~/downloads | ||
|
||
- name: Upload to release | ||
uses: shogo82148/[email protected] | ||
with: | ||
upload_url: ${{ github.event.release.upload_url }} | ||
asset_path: ${{ steps.download_artifact.outputs.download-path }}/*.whl | ||
|
||
pypi_publish: | ||
name: PyPI Publish | ||
needs: [build_wheels, build_sdist] | ||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
- name: Download bdist files | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: bdist_files | ||
path: downloads/ | ||
|
||
- name: Download sdist files | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: sdist_files | ||
path: downloads/ | ||
|
||
- name: Display structure of downloaded files | ||
run: ls -R downloads/ | ||
|
||
- name: Publish packages to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_API_TOKEN }} | ||
packages_dir: downloads/ | ||
# repository_url: https://test.pypi.org/legacy/ | ||
# verbose: true |