-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add workflow for generating and uploading wheels to pypi
- Loading branch information
Showing
1 changed file
with
94 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,94 @@ | ||
name: Create pycompadre wheels | ||
|
||
on: workflow_dispatch | ||
|
||
jobs: | ||
|
||
manylinux: | ||
name: wheel_creation_linux | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest] | ||
python-version: [3.7] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install twine wheel setuptools | ||
- name: Build manylinux Python wheels | ||
uses: RalfG/[email protected]_x86_64 | ||
with: | ||
python-versions: 'cp36-cp36m cp37-cp37m cp38-cp38 cp39-cp39' | ||
build-requirements: 'cython' | ||
package-path: '' | ||
pip-wheel-args: '' | ||
# When locally testing, --no-deps flag is necessary (PyUtilib dependency will trigger an error otherwise) | ||
- name: Consolidate wheels | ||
run: | | ||
sudo test -d dist || mkdir -v dist | ||
sudo find . -name \*.whl | grep -v /dist/ | xargs -n1 -i mv -v "{}" dist/ | ||
- name: Delete linux wheels | ||
run: | | ||
sudo rm -rfv dist/*-linux_x86_64.whl | ||
rm ${{github.workspace}}/dist/cmake* | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: manylinux-wheels | ||
path: dist/ | ||
retention-days: 1 | ||
|
||
|
||
osx: | ||
name: wheel_creation_osx | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [macos-latest] | ||
python-version: [ 3.6,]# 3.7, 3.8, 3.9 ] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install twine wheel setuptools cython | ||
- name: Build OSX Python wheels | ||
run: | | ||
python setup.py bdist_wheel | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: osx-wheels | ||
path: dist/ | ||
retention-days: 1 | ||
|
||
pypi: | ||
name: upload all wheels to pypi | ||
needs: [manylinux, osx] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/download-artifact@v2 | ||
with: | ||
name: osx-wheels | ||
path: dist/ | ||
- uses: actions/download-artifact@v2 | ||
with: | ||
name: manylinux-wheels | ||
path: dist/ | ||
# https://packaging.python.org/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/ | ||
- name: Publish distribution 📦 to PyPI | ||
uses: pypa/gh-action-pypi-publish@master | ||
with: | ||
password: ${{ secrets.PIP_PYCOMPADRE_SECRET }} |