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

Build and upload Linux wheels on tag #619

Draft
wants to merge 32 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
15babf9
Create python-publish.yml
abitrolly Jun 13, 2022
974cb93
Specify correct `package-dir`
abitrolly Jun 13, 2022
9230353
Run `cmake` before package build
abitrolly Jun 14, 2022
e0d3171
Try BEFORE_ALL to avoid setup.py not found error
abitrolly Jun 14, 2022
766170c
Stub `setup.py` check
abitrolly Jun 14, 2022
d238dcf
`cmake` wants `<path-to-source>`
abitrolly Jun 14, 2022
ba5daf8
`cd python` to cmake files in that dir
abitrolly Jun 14, 2022
a11a516
No module named 'Cython'
abitrolly Jun 14, 2022
112a38e
`wheels` are build on RedHat-like systems
abitrolly Jun 18, 2022
a6c5464
Enforce `dnf` based `manylinux_2_28` image
abitrolly Jun 18, 2022
70b1c5a
Add `dependencies.txt` for maintaining Linux builds
abitrolly Jun 18, 2022
037e24f
Use Python way of installing Cython
abitrolly Jun 18, 2022
4dd763c
The comment accidentally disables the job
abitrolly Jun 18, 2022
8011ddf
Empty `dependencies.txt` makes `dnf` fail
abitrolly Jun 18, 2022
cc563f0
Use BEFORE_BUILD to run inside `virtualenv`
abitrolly Jun 19, 2022
0cc57b1
CMake project needs to be built from the top
abitrolly Jun 19, 2022
0d0ba75
Return back `dependencies.txt` for system libs
abitrolly Jun 19, 2022
a24f843
`msgpack-devel` is in EPEL repo
abitrolly Jun 19, 2022
f265995
Add `readline-devel` to dependencies
abitrolly Jun 19, 2022
e103e6c
`libargon2-devel` is needed
abitrolly Jun 20, 2022
75573b0
Installing `asio-devel` was painful
abitrolly Jun 20, 2022
2223efa
Python needs to be explicitly enabled
abitrolly Jun 20, 2022
f412050
`make` the lib before making Python binding
abitrolly Jun 20, 2022
f3214bc
Need newer version of `asio-devel` to compile successfully
abitrolly Jun 20, 2022
3d42bae
Fix ValueError: Cannot repair wheel
abitrolly Jun 21, 2022
fd0e076
`LD_LIBRARY_PATH=.` fails, trying `LD_LIBRARY_PATH=$PWD`
abitrolly Jun 21, 2022
eaf20b7
Build only x86_64 wheels for Python 3.9 and Python 3.10
abitrolly Jun 21, 2022
9996bd7
Do not build `musllinux` wheels and use braces mask for selector
abitrolly Jun 21, 2022
5d43869
Download wheels before publishing
abitrolly Jun 21, 2022
a2bfbdb
Publish to PyPI only when a tagged commit is pushed
abitrolly Jun 21, 2022
b3d17ff
Rename artifact to `opendht-wheels-linux`
abitrolly Jun 21, 2022
5114597
Update `dependencies.txt` description
abitrolly Jun 21, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 71 additions & 0 deletions .github/workflows/python-wheels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Python Package

on:
release:
types: [published]
push:
workflow_dispatch:


permissions:
contents: read

jobs:
build_wheels:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Stub `setup.py` check
# It will be generated during CMake run
# https://github.com/pypa/cibuildwheel/issues/1139
run: touch python/setup.py

- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_BUILD: cp3{9,10}-manylinux_x86_64
CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28
# installing packages in AlmaLinux is a quest
# https://bugs.almalinux.org/view.php?id=208&nbn=3
CIBW_BEFORE_ALL: >
dnf install -y epel-release &&
dnf module enable -y mariadb-devel &&
dnf install -y $(grep "^[^#]" dependencies.txt) &&
echo "need newer asio-devel version" &&
curl -OL https://download.sourceforge.net/asio/asio-1.21.0.tar.bz2 &&
tar xf asio-1.21.0.tar.bz2 &&
cd asio-1.21.0 &&
./configure &&
make &&
make install &&
cd ..
CIBW_BEFORE_BUILD: >
pip install Cython &&
cmake -DOPENDHT_PYTHON=ON . &&
make
# The way to point `auditwheel` to "libopendht.so.2" in the current dir
CIBW_REPAIR_WHEEL_COMMAND_LINUX: >
LD_LIBRARY_PATH=$PWD auditwheel repair -w {dest_dir} {wheel}
with:
package-dir: python

- uses: actions/upload-artifact@v3
with:
name: opendht-wheels-linux
path: ./wheelhouse/*.whl

publish:
runs-on: ubuntu-latest
needs: build_wheels
steps:
- uses: actions/download-artifact@v3
with:
name: opendht-wheels-linux

- name: Publish package
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
12 changes: 12 additions & 0 deletions dependencies.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# System dependencies for building OpenDHT wheels on AlmaLinux 8
#
# dnf install -y $(grep "^[^#]" dependencies.txt)

gnutls-devel
msgpack-devel
readline-devel
libargon2-devel

# asio-devel 1.10.x in AlmaLinux 8 is too old and OpenDHT needs 1.12+
#
#asio-devel