Optimize memory handling #1112
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: PyPI 📦 Distribution | |
on: | |
push: | |
paths-ignore: | |
- ".gitignore" | |
- "docs/**" | |
- "README" | |
- "CREDITS.TXT" | |
- "COPYING_GLIB" | |
- "COPYING.LGPL2" | |
- "AUTHORS.TXT" | |
- "CHANGELOG" | |
- "COPYING" | |
pull_request: | |
jobs: | |
build: | |
runs-on: ${{ matrix.config.os }} | |
name: ${{ matrix.config.name }} | |
strategy: | |
fail-fast: false | |
matrix: | |
config: | |
- { | |
os: windows-2019, | |
arch: x64, | |
python-ver: '3.8', | |
name: 'win_amd64' | |
} | |
- { | |
os: windows-2019, | |
arch: x32, | |
python-ver: '3.8', | |
name: 'win32' | |
} | |
- { | |
os: ubuntu-latest, | |
arch: x64, | |
python-ver: '3.8', | |
name: 'musllinux' | |
} | |
- { | |
os: ubuntu-latest, | |
arch: x64, | |
python-ver: '3.8', | |
name: 'manylinux2014_x86_64' | |
} | |
- { | |
os: ubuntu-latest, | |
arch: x32, | |
python-ver: '3.8', | |
name: 'manylinux2014_i686' | |
} | |
- { | |
os: ubuntu-latest, | |
arch: aarch64, | |
python-ver: '3.8', | |
name: 'manylinux2014_aarch64' | |
} | |
- { | |
os: ubuntu-latest, | |
arch: x64, | |
python-ver: '3.8', | |
name: 'sdist' | |
} | |
- { | |
os: macos-12, | |
arch: x86_64, | |
python-ver: '3.8', | |
name: 'macos_x86_64' | |
} | |
- { | |
os: macos-14, | |
arch: arm64, | |
python-ver: '3.10', | |
name: 'macos_arm64' | |
} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: '🛠️ Set up Python' | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.config.python-ver }} | |
- name: '🛠️ Add msbuild to PATH' | |
if: contains(matrix.config.name, 'win') | |
uses: microsoft/setup-msbuild@v2 | |
with: | |
vs-version: '16.5' | |
- name: '🛠️ Win MSVC 32 dev cmd setup' | |
if: contains(matrix.config.name, 'win32') | |
uses: ilammy/msvc-dev-cmd@v1 | |
with: | |
arch: x86 | |
- name: '🛠️ Win MSVC 64 dev cmd setup' | |
if: contains(matrix.config.name, 'win_amd64') | |
uses: ilammy/msvc-dev-cmd@v1 | |
with: | |
arch: x64 | |
- name: '🛠️ Win build dependencies' | |
if: contains(matrix.config.name, 'win') | |
shell: bash | |
run: | | |
choco install ninja cmake | |
- name: '🛠️ macOS dependencies' | |
if: contains(matrix.config.name, 'macos') | |
run: | | |
brew install ninja | |
- name: '🛠️ pip dependencies' | |
run: | | |
pip install --upgrade setuptools wheel | |
- name: '🚧 Build distribution' | |
shell: bash | |
run: | | |
if [ ${{ matrix.config.name }} == 'win32' ]; then | |
cd bindings/python && python setup.py build -p win32 sdist bdist_wheel -p win32 | |
rm dist/*.tar.gz | |
elif [ ${{ matrix.config.name }} == 'manylinux2014_i686' ]; then | |
docker run --rm -v `pwd`/:/work dockcross/manylinux2014-x86 > ./dockcross | |
chmod +x ./dockcross | |
./dockcross bindings/python/build_wheel.sh | |
elif [ ${{ matrix.config.name }} == 'manylinux2014_aarch64' ]; then | |
docker run --rm -v `pwd`/:/work dockcross/manylinux2014-aarch64 > ./dockcross | |
chmod +x ./dockcross | |
./dockcross bindings/python/build_wheel.sh --plat-name manylinux2014_aarch64 | |
elif [ ${{ matrix.config.name }} == 'manylinux2014_x86_64' ]; then | |
docker run --rm -v `pwd`/:/work dockcross/manylinux2014-x64 > ./dockcross | |
chmod +x ./dockcross | |
./dockcross bindings/python/build_wheel.sh | |
elif [ ${{ matrix.config.name }} == 'musllinux' ]; then | |
docker run --rm -v `pwd`:/work -w /work python:3.7-alpine sh /work/bindings/python/musl_wheel.sh | |
elif [ ${{ matrix.config.name }} == 'sdist' ]; then | |
cd bindings/python && python setup.py sdist | |
elif [ ${{ matrix.config.name }} == 'macos_arm64' ]; then | |
cd bindings/python && _PYTHON_HOST_PLATFORM="macosx-11.0-arm64" ARCHFLAGS="-arch arm64" python setup.py bdist_wheel | |
else | |
cd bindings/python && python setup.py bdist_wheel | |
fi | |
- name: '📤 Upload artifact' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.config.name }} | |
path: ${{ github.workspace }}/bindings/python/dist/* | |
publish: | |
needs: [build] | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags') | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
merge-multiple: true | |
path: dist | |
- name: '📦 Publish distribution to PyPI' | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
user: __token__ | |
password: ${{ secrets.pypi_pass }} |