Adding support for Python 3.12 and 3.13 #22
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: Build | |
on: | |
push: | |
# Manual run | |
workflow_dispatch: | |
jobs: | |
build_stubs_windows: | |
name: Build FMX Stubs for Windows | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
python: ['3.11'] | |
include: | |
- os: [windows-latest] | |
arch: ["AMD64"] | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Build and Install FMX | |
run: | | |
python -m pip install setuptools --upgrade | |
python -m pip install wheel --upgrade | |
python setup.py install | |
- name: Install mypy | |
run: | | |
python -m pip install git+https://github.com/lmbelo/mypy.git | |
- name: Build Stubs | |
run: | | |
python -m mypy.stubgen -m delphifmx -o .\delphifmx --include-docstrings | |
ren .\delphifmx\delphifmx.pyi __init__.pyi | |
- name: Cache Stubs | |
id: cache-stubs | |
uses: actions/cache@v4 | |
with: | |
path: .\delphifmx\__init__.pyi | |
key: ${{ runner.os }}-cache-${{ hashFiles('.\delphifmx\*') }} | |
build_stubs_linux: | |
name: Build FMX Stubs for Linux | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
python: ['3.11'] | |
include: | |
- os: [ubuntu-latest] | |
arch: ["x86_64"] | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python }} | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Build and Install FMX | |
run: | | |
python -m pip install setuptools --upgrade | |
python -m pip install wheel --upgrade | |
python setup.py install | |
- name: Install mypy | |
run: | | |
python -m pip install git+https://github.com/lmbelo/mypy.git | |
- name: Build Stubs | |
run: | | |
python -m mypy.stubgen -m delphifmx -o ./delphifmx --include-docstrings | |
mv ./delphifmx/delphifmx.pyi ./delphifmx/__init__.pyi | |
- name: Cache Stubs | |
id: cache-stubs | |
uses: actions/cache@v4 | |
with: | |
path: ./delphifmx/__init__.pyi | |
key: ${{ runner.os }}-cache-${{ hashFiles('./delphifmx/*') }} | |
build_stubs_macos: | |
name: Build FMX Stubs MacOS | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
python: ['3.11'] | |
include: | |
- os: [ubuntu-latest] | |
arch: ["x86_64"] | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python }} | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Build and Install FMX | |
run: | | |
python -m pip install setuptools --upgrade | |
python -m pip install wheel --upgrade | |
python setup.py install | |
- name: Install mypy | |
run: | | |
python -m pip install git+https://github.com/lmbelo/mypy.git | |
- name: Build Stubs | |
run: | | |
python -m mypy.stubgen -m delphifmx -o ./delphifmx --include-docstrings | |
mv delphifmx/delphifmx.pyi delphifmx/__init__.pyi | |
- name: Cache Stubs | |
id: cache-stubs | |
uses: actions/cache@v4 | |
with: | |
path: ./delphifmx/__init__.pyi | |
key: MacOS-cache-${{ hashFiles('./delphifmx/*') }} | |
enableCrossOsArchive: true | |
#This build makes delphifmx available for Android | |
build_universal_wheel: | |
name: Build universal wheel | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
python: ['3.9'] | |
include: | |
- os: ubuntu-20.04 | |
arch: "x86_64" | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python ${{ matrix.python }} | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Build sdist | |
run: | | |
python -m pip install setuptools --upgrade | |
python -m pip install wheel --upgrade | |
python setup.py bdist_wheel --universal | |
- name: Save sdist | |
uses: actions/upload-artifact@v4 | |
with: | |
name: artifacts-universal-${{ matrix.python }} | |
path: dist/*.whl | |
if-no-files-found: error | |
build_wheels_win_32: | |
name: Build Windows x86 wheels for Python ${{ matrix.python }} | |
needs: [build_stubs_windows] | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
python: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] | |
include: | |
- os: [windows-latest] | |
arch: ["x86"] | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Restore Cached Stubs | |
id: cache-stubs | |
uses: actions/cache@v4 | |
with: | |
path: .\delphifmx\__init__.pyi | |
key: ${{ runner.os }}-cache-${{ hashFiles('.\delphifmx\*') }} | |
restore-keys: | | |
${{ runner.os }}-cache- | |
- name: Set up Python ${{ matrix.python }} | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python }} | |
architecture: "x86" | |
- name: Build bdist wheel | |
run: | | |
python -m pip install setuptools --upgrade | |
python -m pip install wheel --upgrade | |
python setup.py bdist_wheel --plat-name=win32 | |
- name: Save wheel | |
uses: actions/upload-artifact@v4 | |
with: | |
name: artifacts-win32-${{ matrix.python }} | |
path: dist/*.whl | |
if-no-files-found: error | |
build_wheels_win_64: | |
name: Build Windows x64 wheels for Python ${{ matrix.python }} | |
needs: [build_stubs_windows] | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
python: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] | |
include: | |
- os: [windows-latest] | |
arch: ["AMD64"] | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Restore Cached Stubs | |
id: cache-stubs | |
uses: actions/cache@v4 | |
with: | |
path: .\delphifmx\__init__.pyi | |
key: ${{ runner.os }}-cache-${{ hashFiles('.\delphifmx\*') }} | |
restore-keys: | | |
${{ runner.os }}-cache- | |
- name: Set up Python ${{ matrix.python }} | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python }} | |
architecture: "x64" | |
- name: Build bdist wheel | |
run: | | |
python -m pip install setuptools --upgrade | |
python -m pip install wheel --upgrade | |
python setup.py bdist_wheel --plat-name=win_amd64 | |
- name: Save wheel | |
uses: actions/upload-artifact@v4 | |
with: | |
name: artifacts-win64-${{ matrix.python }} | |
path: dist/*.whl | |
if-no-files-found: error | |
build_wheels_manylinux: | |
name: Build ManyLinux x86_64 wheels for Python ${{ matrix.python }} | |
needs: [build_stubs_linux] | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
python: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] | |
include: | |
- os: [ubuntu-20.04] #ubuntu-latest doesn't support cp36 | |
arch: ["x86_64"] | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Restore Cached Stubs | |
id: cache-stubs | |
uses: actions/cache@v4 | |
with: | |
path: ./delphifmx/__init__.pyi | |
key: ${{ runner.os }}-cache-${{ hashFiles('./delphifmx/*') }} | |
restore-keys: | | |
${{ runner.os }}-cache- | |
- name: Set up Python ${{ matrix.python }} | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Build bdist wheel | |
run: | | |
python -m pip install setuptools --upgrade | |
python -m pip install wheel --upgrade | |
python setup.py bdist_wheel --plat-name=manylinux1_x86_64 | |
- name: Save wheel | |
uses: actions/upload-artifact@v4 | |
with: | |
name: artifacts-linux-${{ matrix.python }} | |
path: dist/*.whl | |
if-no-files-found: error | |
build_wheels_macos: | |
name: Build x86_64 macOS wheels for Python ${{ matrix.python }} | |
needs: [build_stubs_macos] | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
python: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] | |
include: | |
- os: [macos-13] #macos-latest is arm only | |
arch: ["x86_64"] | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Restore Cached Stubs | |
id: cache-stubs | |
uses: actions/cache@v4 | |
with: | |
path: ./delphifmx/__init__.pyi | |
key: MacOS-cache-${{ hashFiles('./delphifmx/*') }} | |
restore-keys: | | |
MacOS-cache- | |
enableCrossOsArchive: true | |
- name: Set up Python ${{ matrix.python }} | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Build bdist wheel | |
run: | | |
python -m pip install setuptools --upgrade | |
python -m pip install wheel --upgrade | |
python setup.py bdist_wheel --plat-name=macosx_10_9_x86_64 | |
- name: Save wheel | |
uses: actions/upload-artifact@v4 | |
with: | |
name: artifacts-macintel-${{ matrix.python }} | |
path: dist/*.whl | |
if-no-files-found: error | |
build_wheels_macos_arm: | |
name: Build arm64 macOS wheels for Python ${{ matrix.python }} | |
needs: [build_stubs_macos] | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
python: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] | |
include: | |
- os: [macos-latest] | |
arch: ["arm64"] | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Restore Cached Stubs | |
id: cache-stubs | |
uses: actions/cache@v4 | |
with: | |
path: ./delphifmx/__init__.pyi | |
key: MacOS-cache-${{ hashFiles('./delphifmx/*') }} | |
restore-keys: | | |
MacOS-cache- | |
enableCrossOsArchive: true | |
- name: Set up Python ${{ matrix.python }} | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Build bdist wheel | |
run: | | |
python -m pip install setuptools --upgrade | |
python -m pip install wheel --upgrade | |
python setup.py bdist_wheel --plat-name=macosx_11_0_arm64 | |
- name: Save wheel | |
uses: actions/upload-artifact@v4 | |
with: | |
name: artifacts-marcarm-${{ matrix.python }} | |
path: dist/*.whl | |
if-no-files-found: error | |
upload_pypi_test: | |
name: Upload to PyPI test | |
needs: [build_universal_wheel, build_wheels_win_32, build_wheels_win_64, build_wheels_manylinux, build_wheels_macos, build_wheels_macos_arm] | |
runs-on: ubuntu-latest | |
environment: | |
name: pypi | |
url: https://test.pypi.org/project/delphifmx | |
permissions: | |
id-token: write | |
if: github.ref == 'refs/heads/main' | |
steps: | |
- uses: actions/download-artifact@v2 | |
with: | |
pattern: artifacts-* | |
path: dist | |
merge-multiple: true | |
- name: Publish package to TestPyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
repository_url: https://test.pypi.org/legacy/ | |
upload_pypi: | |
name: Upload to PyPI | |
needs: [build_universal_wheel, build_wheels_win_32, build_wheels_win_64, build_wheels_manylinux, build_wheels_macos, build_wheels_macos_arm] | |
runs-on: ubuntu-latest | |
environment: | |
name: pypi | |
url: https://pypi.org/project/delphifmx | |
permissions: | |
id-token: write | |
if: startsWith(github.ref, 'refs/tags/v') | |
steps: | |
- uses: actions/download-artifact@v2 | |
with: | |
pattern: artifacts-* | |
path: dist | |
merge-multiple: true | |
- name: Publish package to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 |