Skip to content

Commit

Permalink
ci: build python wheels for manylinux2014 (x86_64)
Browse files Browse the repository at this point in the history
Partially revert commit 43a7440

Closes #453

Signed-off-by: Yuki Kishimoto <[email protected]>
  • Loading branch information
yukibtc committed Jun 6, 2024
1 parent 4e7cd81 commit 2eb3d8e
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 34 deletions.
34 changes: 19 additions & 15 deletions .github/workflows/publish-python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,23 @@ on: [workflow_dispatch]

jobs:
build-linux-x86_64:
name: "Build manylinux_2_31 x86_64 wheel"
name: "Build manylinux_2_28_x86_64 wheel"
runs-on: ubuntu-20.04
strategy:
matrix:
python: ["3.9", "3.10", "3.11", "3.12"]
python:
- cp39-cp39
- cp310-cp310
- cp311-cp311
- cp312-cp312
defaults:
run:
working-directory: bindings/nostr-ffi/bindings-python
container:
image: quay.io/pypa/manylinux_2_28_x86_64
env:
PLAT: manylinux_2_28_x86_64
PYBIN: "/opt/python/${{ matrix.python }}/bin"
steps:
- name: "Checkout"
uses: actions/checkout@v3
Expand All @@ -20,20 +29,15 @@ jobs:
with:
toolchain: stable

- name: "Setup Python"
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}

- name: "Generate nostr.py and binaries"
run: bash ./scripts/generate-linux-x86_64.sh

- name: "Build wheel"
run: python3 setup.py bdist_wheel --plat-name manylinux_2_31_x86_64 --verbose
run: ${PYBIN}/python setup.py bdist_wheel --plat-name manylinux_2_28_x86_64 --verbose

- uses: actions/upload-artifact@v3
with:
name: nostr_sdk-manylinux_2_31_x86_64-${{ matrix.python }}
name: nostr_sdk-manylinux_2_28_x86_64-${{ matrix.python }}
path: /home/runner/work/nostr/nostr/bindings/nostr-ffi/bindings-python/dist/*.whl

build-linux-aarch64:
Expand Down Expand Up @@ -187,9 +191,9 @@ jobs:
with:
path: dist/

- name: "Publish on PyPI"
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
packages-dir: dist/*/
# - name: "Publish on PyPI"
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# user: __token__
# password: ${{ secrets.PYPI_API_TOKEN }}
# packages-dir: dist/*/
34 changes: 19 additions & 15 deletions .github/workflows/publish-sdk-python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,23 @@ on: [workflow_dispatch]

jobs:
build-linux-x86_64:
name: "Build manylinux_2_31 x86_64 wheel"
name: "Build manylinux_2_28_x86_64 wheel"
runs-on: ubuntu-20.04
strategy:
matrix:
python: ["3.9", "3.10", "3.11", "3.12"]
python:
- cp39-cp39
- cp310-cp310
- cp311-cp311
- cp312-cp312
defaults:
run:
working-directory: bindings/nostr-sdk-ffi/bindings-python
container:
image: quay.io/pypa/manylinux_2_28_x86_64
env:
PLAT: manylinux_2_28_x86_64
PYBIN: "/opt/python/${{ matrix.python }}/bin"
steps:
- name: "Checkout"
uses: actions/checkout@v3
Expand All @@ -20,20 +29,15 @@ jobs:
with:
toolchain: stable

- name: "Setup Python"
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}

- name: "Generate nostr_sdk.py and binaries"
run: bash ./scripts/generate-linux-x86_64.sh

- name: "Build wheel"
run: python3 setup.py bdist_wheel --plat-name manylinux_2_31_x86_64 --verbose
run: ${PYBIN}/python setup.py bdist_wheel --plat-name manylinux_2_28_x86_64 --verbose

- uses: actions/upload-artifact@v3
with:
name: nostr_sdk-manylinux_2_31_x86_64-${{ matrix.python }}
name: nostr_sdk-manylinux_2_28_x86_64-${{ matrix.python }}
path: /home/runner/work/nostr/nostr/bindings/nostr-sdk-ffi/bindings-python/dist/*.whl

build-linux-aarch64:
Expand Down Expand Up @@ -187,9 +191,9 @@ jobs:
with:
path: dist/

- name: "Publish on PyPI"
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
packages-dir: dist/*/
# - name: "Publish on PyPI"
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# user: __token__
# password: ${{ secrets.PYPI_API_TOKEN }}
# packages-dir: dist/*/
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/usr/bin/env bash

set -euo pipefail
python --version
pip install -r requirements.txt
${PYBIN}/python --version
${PYBIN}/pip install -r requirements.txt

cd ../

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/usr/bin/env bash

set -euo pipefail
python --version
pip install -r requirements.txt
${PYBIN}/python --version
${PYBIN}/pip install -r requirements.txt

echo "Generating native binaries..."
cargo build --release
Expand Down

0 comments on commit 2eb3d8e

Please sign in to comment.