fix: revert workflows to reach any platform and any arch

This commit is contained in:
Alpha Nerd 2026-04-13 17:48:10 +02:00
parent 57998fd84c
commit 5040d181d2
Signed by: alpha-nerd
SSH key fingerprint: SHA256:QkkAgVoYi9TQ0UKPkiKSfnerZy2h4qhi3SVPXJmBN+M
3 changed files with 14 additions and 56 deletions

View file

@ -7,16 +7,10 @@ on:
workflow_dispatch: workflow_dispatch:
jobs: jobs:
build-and-publish: publish:
name: Build & Publish (${{ matrix.runner }}, py${{ matrix.python }}) runs-on: docker-amd64
runs-on: ${{ matrix.runner }}
container: container:
image: python:${{ matrix.python }}-bookworm image: python:3.12-bookworm
strategy:
matrix:
python: ["3.10", "3.11", "3.12"]
runner: [docker-amd64, docker-arm64]
steps: steps:
- name: Checkout repository - name: Checkout repository
@ -26,21 +20,13 @@ jobs:
. .
- name: Install build tools - name: Install build tools
run: | run: pip install build twine
apt-get update -qq && apt-get install -y patchelf
pip install build Cython twine auditwheel
- name: Build wheel - name: Build package
run: python -m build --wheel run: python -m build
- name: Repair wheel to manylinux
run: auditwheel repair dist/*.whl --wheel-dir wheelhouse/
- name: Check wheel metadata
run: twine check wheelhouse/*.whl
- name: Publish to PyPI - name: Publish to PyPI
env: env:
TWINE_USERNAME: __token__ TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: twine upload --verbose wheelhouse/*.whl run: twine upload dist/*

View file

@ -1,6 +1,6 @@
[build-system] [build-system]
requires = ["setuptools>=68", "wheel", "Cython>=3.0"] requires = ["hatchling>=1.0.0", "wheel"]
build-backend = "setuptools.build_meta" build-backend = "hatchling.build"
[project] [project]
name = "nomyo" name = "nomyo"
@ -46,5 +46,8 @@ Documentation = "https://bitfreedom.net/code/nomyo-ai/nomyo/wiki/NOMYO-Secure-Cl
Repository = "https://bitfreedom.net/code/nomyo-ai/nomyo" Repository = "https://bitfreedom.net/code/nomyo-ai/nomyo"
Issues = "https://bitfreedom.net/code/nomyo-ai/nomyo/issues" Issues = "https://bitfreedom.net/code/nomyo-ai/nomyo/issues"
[tool.setuptools.packages.find] [tool.hatch.build.targets.wheel]
include = ["nomyo*"] packages = ["nomyo"]
[tool.hatch.build.targets.sdist]
exclude = ["test/", "build.sh", "dist/"]

View file

@ -1,31 +0,0 @@
from setuptools import setup
from setuptools.command.build_py import build_py as _build_py
from Cython.Build import cythonize
# Modules compiled to .so — exclude their .py source from the wheel
COMPILED_MODULES = {"nomyo", "SecureCompletionClient", "SecureMemory"}
class BuildPyNoPy(_build_py):
"""Skip copying .py source files for cythonized modules."""
def find_package_modules(self, package, package_dir):
modules = super().find_package_modules(package, package_dir)
return [
(pkg, mod, path)
for pkg, mod, path in modules
if not (pkg == "nomyo" and mod in COMPILED_MODULES)
]
setup(
ext_modules=cythonize(
[
"nomyo/nomyo.py",
"nomyo/SecureCompletionClient.py",
"nomyo/SecureMemory.py",
],
compiler_directives={"language_level": "3"},
),
cmdclass={"build_py": BuildPyNoPy},
)