diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9803d36..6f9b40b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -95,12 +95,29 @@ jobs: - name: Get pyver macos-latest if: ${{ matrix.os == 'macos-latest' }} shell: bash - run: echo "PY_VER=3.9" >> $GITHUB_ENV + run: | + echo "PY_VER=3.9" >> $GITHUB_ENV + echo "PY_VER_FLAT=39" >> $GITHUB_ENV + echo "PY_EXT=so" >> $GITHUB_ENV + echo "PLAT_TAG=macosx_12_0_arm64" >> $GITHUB_ENV - - name: Get pyver - if: ${{ matrix.os != 'macos-latest' }} + - name: Get pyver ubuntu-latest + if: ${{ matrix.os == 'ubuntu-latest' }} shell: bash - run: echo "PY_VER=3.7" >> $GITHUB_ENV + run: | + echo "PY_VER=3.7" >> $GITHUB_ENV + echo "PY_VER_FLAT=37" >> $GITHUB_ENV + echo "PY_EXT=so" >> $GITHUB_ENV + echo "PLAT_TAG=manylinux_2_17_x86_64" >> $GITHUB_ENV + + - name: Get pyver windows-latest + if: ${{ matrix.os == 'windows-latest' }} + shell: bash + run: | + echo "PY_VER=3.7" >> $GITHUB_ENV + echo "PY_VER_FLAT=37" >> $GITHUB_ENV + echo "PY_EXT=pyd" >> $GITHUB_ENV + echo "PLAT_TAG=win_amd64" >> $GITHUB_ENV - name: Get an older python version uses: actions/setup-python@v5 @@ -117,11 +134,30 @@ jobs: --backend ninja install-args: --skip-subprojects + - name: Build Wheel + shell: bash + run: | + python -m pip install -U pip + python -m pip install -U build wheel hatch + python -m hatch version $(git describe --tags --abbrev=0) + python -m build --wheel + for PY_WHEEL in dist/*.whl + do + python -m wheel tags --remove --python-tag ${{ env.PY_VER_FLAT }} --abi-tag abi3 --platform-tag ${{ env.PLAT_TAG }} ${PY_WHEEL} + done + - name: Upload Artifacts uses: actions/upload-artifact@v4 with: name: ${{ runner.os }}-pyModule - path: output_Python/*.* + path: output_Python/*.${{ env.PY_EXT }} + if-no-files-found: error + + - name: Upload Artifacts + uses: actions/upload-artifact@v4 + with: + name: ${{ runner.os }}-wheels + path: dist/*.whl if-no-files-found: error upload_release: @@ -143,7 +179,7 @@ jobs: module-name: simplex folder-list: scripts icons version: ${{ steps.previoustag.outputs.tag }} - python-limited-api: true + py-limited-api: true - name: Upload distribution if: ${{ startsWith(github.ref, 'refs/tags/v') }} diff --git a/pyproject.toml b/pyproject.toml index dbeccb7..2b1b18b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -34,18 +34,24 @@ dependencies = [ requires = ["hatchling"] build-backend = "hatchling.build" +[tool.hatch.build.targets.wheel.sources] +"scripts" = "" +"output_Python" = "simplexui" -[tool.hatch.build] -include = ["simplexui"] -exclude = ["*.bak"] +[tool.hatch.build.targets.wheel] +only-packages = false artifacts = [ - "/*.so", - "/*.pyd", + "*.so", + "*.pyd", + "!*.lib", +] +only-include = [ + "scripts/simplexui", + "output_Python", ] [tool.hatch.version] -path = "simplexui/__init__.py" - +path = "scripts/simplexui/__init__.py" [tool.ruff] # Exclude a variety of commonly ignored directories. @@ -131,4 +137,3 @@ skip-magic-trailing-comma = false # Like Black, automatically detect the appropriate line ending. line-ending = "auto" -