Skip to content

Commit

Permalink
Setup GitHub actions to build and publish sdist and wheels
Browse files Browse the repository at this point in the history
  • Loading branch information
hroncok committed Jul 26, 2020
1 parent 82f227d commit 4986ebf
Show file tree
Hide file tree
Showing 4 changed files with 149 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/pypi-mac.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Build Mac OS X package and upload it to PyPI

on:
- push
- pull_request

jobs:
build:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [macos-latest]
architecture: [x64]
python-version: [3.6, 3.7, 3.8]

steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
architecture: ${{ matrix.architecture }}
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel twine
- name: Build Python wheel
run: |
python setup.py bdist_wheel
- name: Upload artifacts for inspection
uses: actions/upload-artifact@v2
with:
name: wheel_${{ matrix.os }}_${{ matrix.architecture }}_${{ matrix.python-version }}
path: dist/*.whl
- name: Publish sdists and wheels to PyPI
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
twine upload dist/* || :
35 changes: 35 additions & 0 deletions .github/workflows/pypi-manylinux1.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Build manylinux1 x86_64 package and upload it to PyPI

on:
- push
- pull_request

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.x
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel twine
- name: Build manylinux Python wheels
uses: RalfG/python-wheels-manylinux-build@v0.3-manylinux1_x86_64
with:
python-versions: 'cp36-cp36m cp37-cp37m cp38-cp38'
build-requirements: 'cython'
- name: Upload artifacts for inspection
uses: actions/upload-artifact@v2
with:
name: manylinux1_wheels
path: dist/*.whl
- name: Publish sdists and wheels to PyPI
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
twine upload dist/* || :
33 changes: 33 additions & 0 deletions .github/workflows/pypi-sdist.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Create sdists package and upload it to PyPI

on:
- push
- pull_request

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.x
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel twine
- name: Create sdist
run: |
python setup.py sdist
- name: Upload artifacts for inspection
uses: actions/upload-artifact@v2
with:
name: sdist
path: dist/*.tar.gz
- name: Publish sdists and wheels to PyPI
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
twine upload dist/* || :
40 changes: 40 additions & 0 deletions .github/workflows/pypi-win.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Build Windows package and upload it to PyPI

on:
- push
- pull_request

jobs:
build:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [windows-latest]
architecture: [x64, x86]
python-version: [3.6, 3.7, 3.8]

steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.x
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel twine
- name: Build Python wheel
run: |
python setup.py bdist_wheel
- name: Upload artifacts for inspection
uses: actions/upload-artifact@v2
with:
name: wheel_${{ matrix.os }}_${{ matrix.architecture }}_${{ matrix.python-version }}
path: dist/*.whl
- name: Publish sdists and wheels to PyPI
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
twine upload dist/* || :

0 comments on commit 4986ebf

Please sign in to comment.