diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a35ce0a..38d5693 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -38,7 +38,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install setuptools wheel cffi + pip install setuptools wheel cffi packaging - name: Install Zig uses: goto-bus-stop/setup-zig@v2 @@ -133,6 +133,8 @@ jobs: TWINE_USERNAME: __token__ TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} run: | - for wheel in dist/**/*.whl; do - twine upload "$wheel" + for file in dist/**/*; do + if [[ $file == *.whl ]] || [[ $file == *.tar.gz ]]; then + twine upload "$file" + fi done diff --git a/py/setup.py b/py/setup.py index 9c837dd..c55635d 100644 --- a/py/setup.py +++ b/py/setup.py @@ -1,5 +1,6 @@ import os import platform +from packaging import tags from setuptools import setup, find_packages def get_shared_lib_ext(): @@ -10,6 +11,20 @@ def get_shared_lib_ext(): else: return ".so" + +def get_platform_tag(): + if sys.platform.startswith('linux'): + return f'manylinux_2_17_{platform.machine()}' + elif sys.platform.startswith('darwin'): + if platform.machine() == 'arm64': + return f'macosx_11_0_{platform.machine()}' + else: + return f'macosx_10_9_{platform.machine()}' + elif sys.platform.startswith('win'): + return 'win_amd64' + else: + return 'any' + setup( name='dnadesign', version='0.1.1', @@ -22,6 +37,7 @@ def get_shared_lib_ext(): "cffi>=1.0.0", ], + plat_name=f"{platform_tag.platform}_{platform_tag.abi}_{platform_tag.interpreter}_{platform_tag.implementation}", include_package_data=True, zip_safe=False, author='Keoni Gandall',