Skip to content

Commit e1068f0

Browse files
authored
Add linux aarch64 wheel build support and wheel build for Github Actions (GH-13)
1 parent 48ad548 commit e1068f0

File tree

2 files changed

+43
-7
lines changed

2 files changed

+43
-7
lines changed

.github/workflows/ci.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Build & Publish wheel
2+
3+
on: push
4+
5+
jobs:
6+
build:
7+
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@v2
12+
- name: Set up Python 3.8
13+
uses: actions/setup-python@v2
14+
with:
15+
python-version: 3.8
16+
- name: Install Dependency
17+
run: |
18+
pip install cython
19+
- name: Building wheel
20+
run: |
21+
make wheel_manylinux
22+
- name: Copy wheels in dist
23+
run: cp wheelhouse*/fastrlock*.whl dist/
24+
- name: Push build artifacts to PyPI
25+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
26+
uses: pypa/[email protected]
27+
with:
28+
skip_existing: true
29+
user: __token__
30+
password: ${{ secrets.PYPI_API_TOKEN }}

Makefile

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@ VERSION=$(shell python -c 'import re; f=open("fastrlock/__init__.py"); print(re.
77
PYTHON_WITH_CYTHON=$(shell $(PYTHON) -c 'import Cython.Compiler' >/dev/null 2>/dev/null && echo " --with-cython" || true)
88
PY3_WITH_CYTHON=$(shell $(PYTHON3) -c 'import Cython.Compiler' >/dev/null 2>/dev/null && echo " --with-cython" || true)
99

10-
MANYLINUX_IMAGE_X86_64=quay.io/pypa/manylinux2010_x86_64
11-
MANYLINUX_IMAGE_686=quay.io/pypa/manylinux2010_i686
10+
MANYLINUX_IMAGES= \
11+
manylinux2010_x86_64 \
12+
manylinux2010_i686 \
13+
manylinux2014_aarch64
1214

13-
.PHONY: all version inplace sdist build clean wheel_manylinux wheel_manylinux32 wheel_manylinux64 wheel
15+
.PHONY: all version inplace sdist build clean wheel_manylinux wheel
1416

1517
all: inplace
1618

@@ -30,21 +32,25 @@ build:
3032
wheel:
3133
$(PYTHON) setup.py $(SETUPFLAGS) bdist_wheel $(PYTHON_WITH_CYTHON)
3234

33-
wheel_manylinux: sdist wheel_manylinux64 wheel_manylinux32
35+
qemu-user-static:
36+
docker run --rm --privileged hypriot/qemu-register
3437

35-
wheel_manylinux32 wheel_manylinux64: dist/$(PACKAGENAME)-$(VERSION).tar.gz
38+
wheel_manylinux: sdist $(addprefix wheel_,$(MANYLINUX_IMAGES))
39+
$(addprefix wheel_,$(filter-out %_x86_64, $(filter-out %_i686, $(MANYLINUX_IMAGES)))): qemu-user-static
40+
41+
wheel_%: dist/$(PACKAGENAME)-$(VERSION).tar.gz
3642
echo "Building wheels for $(PACKAGENAME) $(VERSION)"
3743
mkdir -p wheelhouse$(subst wheel_manylinux,,$@)
3844
time docker run --rm -t \
3945
-v $(shell pwd):/io \
4046
-e CFLAGS="-O3 -g1 -mtune=generic -pipe -fPIC" \
4147
-e LDFLAGS="$(LDFLAGS) -fPIC" \
4248
-e WHEELHOUSE=wheelhouse$(subst wheel_manylinux,,$@) \
43-
$(if $(patsubst %32,,$@),$(MANYLINUX_IMAGE_X86_64),$(MANYLINUX_IMAGE_686)) \
49+
quay.io/pypa/$(subst wheel_,,$@) \
4450
bash -c '\
4551
rm -fr $(PACKAGENAME)-$(VERSION)/; \
4652
tar zxf /io/$< && cd $(PACKAGENAME)-$(VERSION)/ || exit 1; \
47-
for PYBIN in /opt/python/*/bin; do \
53+
for PYBIN in /opt/python/cp*/bin; do \
4854
PYVER="$$($$PYBIN/python -V)"; \
4955
PROFDIR="prof-$${PYVER// /_}"; \
5056
echo $$PYVER; \

0 commit comments

Comments
 (0)