ci: add support to aarch64
python wheels
#17
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish nostr-protocol to PyPI | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
# We use manylinux2014 because older CentOS versions used by 2010 and 1 have a very old glibc version, which | |
# makes it very hard to use GitHub's javascript actions (checkout, upload-artifact, etc). | |
# They mount their own nodejs interpreter inside your container, but since that's not statically linked it | |
# tries to load glibc and fails because it requires a more recent version. | |
jobs: | |
build-manylinux2014-x86_64-wheels: | |
name: "Build Manylinux 2014 x86_64 wheel" | |
runs-on: ubuntu-20.04 | |
defaults: | |
run: | |
working-directory: bindings/nostr-ffi/bindings-python | |
container: | |
image: quay.io/pypa/manylinux2014_x86_64 | |
env: | |
PLAT: manylinux2014_x86_64 | |
PYBIN: "/opt/python/${{ matrix.python }}/bin" | |
strategy: | |
matrix: | |
python: # Update this list whenever the docker image is updated (check /opt/python/) | |
- cp38-cp38 | |
- cp39-cp39 | |
- cp310-cp310 | |
steps: | |
- name: "Checkout" | |
uses: actions/checkout@v3 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
- name: "Generate nostr.py and binaries" | |
run: bash ./scripts/generate-linux.sh | |
- name: "Build wheel" | |
# Specifying the plat-name argument is necessary to build a wheel with the correct name, | |
# see issue #350 for more information | |
run: ${PYBIN}/python setup.py bdist_wheel --plat-name manylinux_2_17_x86_64 --verbose | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: nostr_protocol-manylinux2014-x86_64-${{ matrix.python }} | |
path: /home/runner/work/nostr/nostr/bindings/nostr-ffi/bindings-python/dist/*.whl | |
build-manylinux2014-aarch64-wheels: | |
name: "Build Manylinux 2014 aarch64 wheel" | |
runs-on: ubuntu-20.04 | |
defaults: | |
run: | |
working-directory: bindings/nostr-ffi/bindings-python | |
container: | |
image: quay.io/pypa/manylinux2014_x86_64 | |
env: | |
PLAT: manylinux2014_aarch64 | |
PYBIN: "/opt/python/${{ matrix.python }}/bin" | |
CC: aarch64-linux-gnu-gcc | |
CXX: aarch64-linux-gnu-g++ | |
strategy: | |
matrix: | |
python: # Update this list whenever the docker image is updated (check /opt/python/) | |
- cp38-cp38 | |
- cp39-cp39 | |
- cp310-cp310 | |
steps: | |
- name: "Checkout" | |
uses: actions/checkout@v3 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
- name: "Install gcc-aarch64-linux-gnu" | |
run: yum groupinstall -y "Development Tools" && yum install -y gcc-aarch64-linux-gnu | |
- name: "Generate nostr.py and binaries" | |
run: bash ./scripts/generate-linux-aarch64.sh | |
- name: "Build wheel" | |
# Specifying the plat-name argument is necessary to build a wheel with the correct name, | |
# see issue #350 for more information | |
run: ${PYBIN}/python setup.py bdist_wheel --plat-name manylinux_2_17_aarch64 --verbose | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: nostr_protocol-manylinux2014-aarch64-${{ matrix.python }} | |
path: /home/runner/work/nostr/nostr/bindings/nostr-ffi/bindings-python/dist/*.whl |