Skip to content

Commit

Permalink
Add workflow actions to build wheels for linux, macos, win32, and win64.
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanhillyer committed Jun 7, 2020
1 parent 0c3cc25 commit 5d693fb
Show file tree
Hide file tree
Showing 4 changed files with 134 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/python-package-linux.yml
@@ -0,0 +1,33 @@
name: Linux Package

on:
push:
branches: [ master ]
paths:
- 'mahotas/mahotas_version.py'

jobs:
build:

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.6
uses: actions/setup-python@v2
with:
python-version: '3.6'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install twine
- name: Build manylinux Python wheels
uses: RalfG/python-wheels-manylinux-build@v0.2.2-manylinux2010_x86_64
with:
python-versions: 'cp36-cp36m cp37-cp37m cp38-cp38'
build-requirements: 'numpy'
- name: Publish wheels to PyPI
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
twine upload wheelhouse/*-manylinux*.whl
33 changes: 33 additions & 0 deletions .github/workflows/python-package-macos.yml
@@ -0,0 +1,33 @@
name: macOS Package

on:
push:
branches: [ master ]
paths:
- 'mahotas/mahotas_version.py'

jobs:
build:

runs-on: macos-latest
strategy:
matrix:
python-version: [3.6, 3.7, 3.8]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine numpy
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py bdist_wheel
twine upload dist/*
34 changes: 34 additions & 0 deletions .github/workflows/python-package-win32.yml
@@ -0,0 +1,34 @@
name: Windows Package (x86)

on:
push:
branches: [ master ]
paths:
- 'mahotas/mahotas_version.py'

jobs:
build:

runs-on: windows-latest
strategy:
matrix:
python-version: [3.6, 3.7, 3.8]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
architecture: 'x86'
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine numpy
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py bdist_wheel
twine upload dist/*
34 changes: 34 additions & 0 deletions .github/workflows/python-package-win64.yml
@@ -0,0 +1,34 @@
name: Windows Package (x64)

on:
push:
branches: [ master ]
paths:
- 'mahotas/mahotas_version.py'

jobs:
build:

runs-on: windows-latest
strategy:
matrix:
python-version: [3.6, 3.7, 3.8]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
architecture: 'x64'
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine numpy
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py bdist_wheel
twine upload dist/*

0 comments on commit 5d693fb

Please sign in to comment.