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

Automatically build Linux, Mac, and Windows wheels with GitHub Actions #421

Merged
merged 44 commits into from
Apr 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
333564b
Add environment.yml file for wheel build [ci skip]
jobovy Apr 23, 2020
964156f
Move conda environment file used in workflow out of the workflows dir…
jobovy Apr 23, 2020
e2ad2d4
Start on action to create Mac wheels [ci skip]
jobovy Apr 23, 2020
a6b9088
Actions clang does not support OpenMP [ci skip]
jobovy Apr 23, 2020
85e3116
Add llvm-openmp to try to get clang to work with OpenMP [ci skip]
jobovy Apr 23, 2020
94ceb3a
Try uploading artifact again, with v2-preview for wildcards [ci skip]
jobovy Apr 23, 2020
a2d96fc
Install conda-forge compilers to get OpenMP working on Mac actions [c…
jobovy Apr 23, 2020
e3dc730
Explicitly set CFLAGS, LDFLAGS, and LD_LIBRARY_PATH for GSL [ci skip]
jobovy Apr 23, 2020
7a33b4f
Create wheels for different python versions [ci skip]
jobovy Apr 23, 2020
e27c5ba
Combine all mac wheels into a single artifact for easier downloading …
jobovy Apr 23, 2020
5eaf86d
Fix workflow syntax errors [ci skip]
jobovy Apr 23, 2020
adda6e5
Need -l {0} in bash? [ci skip]
jobovy Apr 23, 2020
5d2856b
Fix wheel output directory, flatten artifact directories before re-up…
jobovy Apr 23, 2020
0ff8de9
Fix tmp_wheelhouse path for artifact downloads [ci skip]
jobovy Apr 23, 2020
2407055
Simplify build environment [ci skip]
jobovy Apr 23, 2020
1dc3c45
Try building manylinux2014 wheels [ci skip]
jobovy Apr 23, 2020
d81d5b7
Make entrypoint executable [ci skip]
jobovy Apr 23, 2020
3a2abcb
Fix errors [ci skip]
jobovy Apr 23, 2020
4f725f4
Only build wheels for galpy, upload as artifact [ci skip]
jobovy Apr 23, 2020
3e4a2be
Only upload manylinux wheels [ci skip]
jobovy Apr 23, 2020
7a51eed
Better names [ci skip]
jobovy Apr 23, 2020
f90dd57
Try also creating windows wheels [ci skip]
jobovy Apr 23, 2020
f539d92
Don't build windows 3.5; be more specific about when to run [ci skip]
jobovy Apr 23, 2020
0c73a72
Use separate build environment files for mac and windows [ci skip]
jobovy Apr 23, 2020
06748a8
intel-openmp is in anaconda channel, not conda-forge [ci skip]
jobovy Apr 23, 2020
767a930
Set environment variables separately on mac and win [ci skip]
jobovy Apr 23, 2020
ec5a2fa
Need to set shell [ci skip]
jobovy Apr 23, 2020
e120242
Try setting environment variables again [ci skip]
jobovy Apr 23, 2020
88cdf7e
Try setting environment variables again [ci skip]
jobovy Apr 23, 2020
7a799b7
Fix win environment variables [ci skip]
jobovy Apr 23, 2020
7afdf0d
Exclude py35 build for Windows, because hard to build on gh-a [ci skip]
jobovy Apr 24, 2020
27386ec
Rename workflow to reflect that it now also build windows wheels [ci …
jobovy Apr 24, 2020
4405dc8
Try uploading to testPyPI [ci skip]
jobovy Apr 24, 2020
72252c3
Upload to PyPI from wheelhouse directory [ci skip]
jobovy Apr 24, 2020
f9f5711
Also upload manyllinux wheels [ci skip]
jobovy Apr 24, 2020
981eb27
Edit to actually upload to PyPI [ci skip]
jobovy Apr 24, 2020
648a89e
Remove regular linux wheel [ci skip]
jobovy Apr 24, 2020
132114a
Actually upload to PyPI [ci skip]
jobovy Apr 24, 2020
3ba9473
Merge branch 'linuxwheels' into gawheels [ci skip]
jobovy Apr 24, 2020
88c82df
Also build and release source distribution [ci skip]
jobovy Apr 24, 2020
11a1692
Remove run on old branches [ci skip]
jobovy Apr 24, 2020
848d988
Don't need conda for sdist [ci skip]
jobovy Apr 24, 2020
ceee0a1
Only build and publish source distribution upon release [ci skip]
jobovy Apr 24, 2020
bffbf1a
Add some comments to avoid future mistakes
jobovy Apr 24, 2020
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
11 changes: 11 additions & 0 deletions .github/conda-build-environment-macos-latest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: galpywheels
channels:
- conda-forge
dependencies:
- numpy
- scipy
- matplotlib
- setuptools
- conda-forge::gsl
- conda-forge::compilers
- conda-forge::llvm-openmp
10 changes: 10 additions & 0 deletions .github/conda-build-environment-windows-latest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: galpywheels
channels:
- conda-forge
dependencies:
- numpy
- scipy
- matplotlib
- setuptools
- conda-forge::gsl
- anaconda::intel-openmp
16 changes: 16 additions & 0 deletions .github/workflows/actions/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/sh

yum -y install gsl-devel

PYTHON_VERSIONS=("cp35-cp35m" "cp36-cp36m" "cp37-cp37m" "cp38-cp38")

for PYTHON_VERSION in ${PYTHON_VERSIONS[@]}; do
/opt/python/${PYTHON_VERSION}/bin/pip install --upgrade pip
/opt/python/${PYTHON_VERSION}/bin/pip install -U wheel auditwheel
/opt/python/${PYTHON_VERSION}/bin/python setup.py bdist_wheel -d wheelhouse
done

for whl in /github/workspace/wheelhouse/*.whl; do
auditwheel repair $whl
rm $whl
done
7 changes: 7 additions & 0 deletions .github/workflows/actions/manylinux2014_x86_64/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: 'build wheels with manylinux2014_x86_64'
description: 'build wheels with manylinux2014_x86_64'
runs:
using: 'docker'
image: docker://quay.io/pypa/manylinux2014_x86_64
args:
- .github/workflows/actions/entrypoint.sh
94 changes: 94 additions & 0 deletions .github/workflows/build_macosx_windows_wheels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: Build Mac OS X & Windows wheels and upload to PyPI upon release

# Update on every push and PR to master, and upon release creation
on:
push:
branches:
- master
paths-ignore:
- 'doc/**'
pull_request:
branches:
- master
paths-ignore:
- 'doc/**'
release:
types: [created]

jobs:
build:
name: Build wheels
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest,windows-latest]
python-version: [3.5,3.6,3.7, 3.8]
exclude:
- os: windows-latest
python-version: 3.5
steps:
# check-out this repository
- uses: actions/checkout@v2
# Install Miniconda, as specificed by this repository's environment.yml
- uses: goanpeca/setup-miniconda@v1
with:
activate-environment: galpywheels
environment-file: .github/conda-build-environment-${{ matrix.os }}.yml
python-version: ${{ matrix.python-version }}
- name: Install pip dependencies
shell: bash -l {0}
run: |
python -m pip install --upgrade pip
pip install wheel
- name: Set environment variables on Mac OS
if: matrix.os == 'macos-latest'
shell: bash -l {0}
run: |
echo ::set-env name=CFLAGS::-I$CONDA_PREFIX/include
echo ::set-env name=LDFLAGS::-I$CONDA_PREFIX/lib
echo ::set-env name=LD_LIBRARY_PATH::-I$CONDA_PREFIX/lib
- name: Set environment variables on Windows
if: matrix.os == 'windows-latest'
shell: bash -l {0}
run: |
echo ::set-env name=INCLUDE::$CONDA_PREFIX\\Library\\include
echo ::set-env name=LIB::$CONDA_PREFIX\\Library\\lib
echo ::set-env name=LIBPATH::$CONDA_PREFIX\\Library\\lib
- name: Build extension
shell: bash -l {0}
run: |
mkdir wheelhouse
python setup.py build_ext
- name: Build wheel
shell: bash -l {0}
run: python setup.py bdist_wheel -d wheelhouse
# Upload wheel as artifact
- uses: actions/upload-artifact@v2-preview
with:
name: galpy-wheel-python-${{ matrix.python-version }}-${{ matrix.os }}
path: wheelhouse/*.whl
# We need to run on Ubuntu for pypa/gh-action-pypi-publish action
# so might as well also combine
combine:
name: Combine wheels into single artifact and upload to PyPI upon release
needs: build
runs-on: ubuntu-latest
steps:
- run: |
mkdir tmp_wheelhouse
mkdir wheelhouse
- uses: actions/download-artifact@v2-preview
with:
path: tmp_wheelhouse/
- run: find tmp_wheelhouse/ -mindepth 2 -type f -exec mv -i '{}' wheelhouse/ ';'
- uses: actions/upload-artifact@v2-preview
with:
name: galpy-wheels-macos-windows-latest
path: wheelhouse/*.whl
# Upload to PyPI if this is a release
- name: Publish distribution to PyPI
if: github.event_name == 'release' && github.event.action == 'created'
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.pypi_token }}
packages_dir: wheelhouse/
36 changes: 36 additions & 0 deletions .github/workflows/build_manylinux_wheels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Build manylinux wheels, upload to PyPI upon release

# Update on every push or PR to master (except when only docs) and upon releases
on:
push:
branches:
- master
paths-ignore:
- 'doc/**'
pull_request:
branches:
- master
paths-ignore:
- 'doc/**'
release:
types: [created]

jobs:
build:
name: Build manylinux wheels, upload to PyPI upon release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build manylinux2014_x86_64 wheels
uses: ./.github/workflows/actions/manylinux2014_x86_64/
- uses: actions/upload-artifact@v2-preview
with:
name: galpy-wheels-manylinux
path: wheelhouse/*manylinux*.whl
# Upload to PyPI if this is a release
- name: Publish distribution to PyPI
if: github.event_name == 'release' && github.event.action == 'created'
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.pypi_token }}
packages_dir: wheelhouse/
26 changes: 26 additions & 0 deletions .github/workflows/build_sdist.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Build source directory for release

on:
release:
types: [created]

jobs:
build:
name: Build source directory for release
runs-on: ubuntu-latest
steps:
# check-out this repository
- uses: actions/checkout@v2
# Setup python
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Build sdist
shell: bash -l {0}
run: python setup.py sdist
# Upload to PyPI if this is a release
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.pypi_token }}