Skip to content

Commit

Permalink
Merge pull request #30 from ketozhang/add-binary-wheel-with-auditwheel
Browse files Browse the repository at this point in the history
Add manylinux binary distribution with auditwheel fix
  • Loading branch information
rpoleski authored Mar 21, 2022
2 parents f1516cd + 9bc713b commit a0d2057
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 3 deletions.
61 changes: 59 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,50 @@
# This workflow is triggered by a new release on GitHub and then uploads
# MulensModel package to PyPI.
#
# If the publish step finishes succesfully, the source distribution is
# guaranteed to be published. Binary distributions are published only if
# their respective build steps passes. If any binary distribution fails,
# package maintainers may manually debug, build, and publish without the
# automated workflow.
name: Upload Python Package to PyPI

on:
release:
types: [published]

jobs:
publish:
build_binary_manylinux:
runs-on: ubuntu-latest
container: quay.io/pypa/manylinux_2_24_x86_64

strategy:
matrix:
python-version:
- cp37-cp37m
- cp38-cp38
- cp39-cp39
- cp310-cp310

steps:
- uses: actions/checkout@v2

- name: Build Python wheels
# Build linux wheels with the image then use auditwheel
# to convert to it a manylinux wheel.
env:
PYTHON_VERSION: ${{ matrix.python-version }}
run: |
/opt/python/$PYTHON_VERSION/bin/python -m build --wheel
find dist/ -type f -name *.whl | xargs -L 1 auditwheel repair --wheel-dir dist/
- uses: actions/upload-artifact@v2
# Only upload manylinux wheels to artifact.
# Normal linux wheels is not allowed in PyPI
with:
name: dist
path: dist/*manylinux*.whl

build_source:
runs-on: ubuntu-latest

steps:
Expand All @@ -15,7 +53,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.9"
python-version: "3.10"

- name: Install dependencies
run: |
Expand All @@ -25,6 +63,25 @@ jobs:
- name: Build package
run: python setup.py sdist

- uses: actions/upload-artifact@v2
with:
name: dist
path: dist/*.tar.gz

publish:
# Publish to PyPI and update GitHub release
# Here we require only the source build to start publishing
needs: [build_source]
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- uses: actions/download-artifact@v2
with:
name: dist
path: dist/

- name: Publish package to PyPI
# All files in dist/ are published
uses: pypa/gh-action-pypi-publish@release/v1
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[build-system]
requires = [
"setuptools>=42",
"setuptools",
"wheel"
]
build-backend = "setuptools.build_meta"

0 comments on commit a0d2057

Please sign in to comment.