fix: add sphinx_rtd_theme to readthedocs yml #192
This file contains hidden or 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/upload sdist and wheel Package to PyPI | |
| on: | |
| push: | |
| branches: | |
| - master | |
| - develop | |
| paths-ignore: | |
| - 'example/**' | |
| - 'docs/**' | |
| - 'data/**' | |
| pull_request: | |
| branches: | |
| - master | |
| - develop | |
| paths-ignore: | |
| - 'example/**' | |
| - 'docs/**' | |
| - 'data/**' | |
| release: | |
| types: | |
| - published | |
| jobs: | |
| build_wheels: | |
| name: Build wheels on ${{ matrix.os }} / ${{ matrix.arch }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| arch: x86_64 | |
| - os: macos-latest | |
| arch: x86_64 | |
| - os: macos-latest | |
| arch: arm64 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.x' | |
| architecture: 'x64' | |
| - name: Set up QEMU | |
| if: runner.os == 'Linux' | |
| uses: docker/setup-qemu-action@v2 | |
| with: | |
| platforms: arm64 | |
| - name: Add tag to version.py file windows | |
| if: runner.os == 'windows' | |
| shell: powershell | |
| run: | | |
| $version = git describe --abbrev=7 --dirty --always --tags | |
| $version = $version -replace "dirty", "mod" | |
| $version = $version -replace "-", "+" | |
| $version = $version -replace "-", "." | |
| $version = $version -replace "v", "" | |
| Set-Content -Path .\build\python\vina\version.py -Value $version | |
| - name: Add tag to version.py file linux and macos | |
| if: runner.os != 'windows' | |
| run: | | |
| git describe --abbrev=7 --dirty --always --tags | \ | |
| sed 's/dirty/mod/g' | \ | |
| sed 's/-/+/' | \ | |
| sed 's/-/./g' | \ | |
| sed 's/v//' > ./build/python/vina/version.py | |
| cat ./build/python/vina/version.py | |
| - name: Install Python dependencies | |
| run: python -m pip install cibuildwheel setuptools wheel packaging | |
| - name: Check setuptools version | |
| run: | | |
| echo "checking setuptools version" | |
| python -c "import setuptools; print(setuptools.__version__)" | |
| - name: Install dependencies (Linux) | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libboost-all-dev swig | |
| - name: Install dependencies (macOS) | |
| if: runner.os == 'macOS' | |
| run: | | |
| brew install boost swig | |
| - name: Build wheels | |
| run: | | |
| cp -R ./build/python/* . | |
| python -m cibuildwheel --output-dir wheelhouse | |
| env: | |
| CIBW_BUILD: cp38-* cp39-* cp310-* cp311-* cp312-* | |
| CIBW_SKIP: pp* | |
| CIBW_ARCHS: ${{ matrix.arch }} | |
| # Install dependencies inside cibuildwheel | |
| CIBW_BEFORE_ALL_LINUX: | | |
| sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo | |
| sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/*.repo | |
| sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/*.repo | |
| yum clean all && yum -y update | |
| yum install -y wget python-devel pcre-devel | |
| # Install SWIG | |
| wget https://downloads.sourceforge.net/swig/swig-4.0.2.tar.gz | |
| tar -xvf swig-4*.tar.gz | |
| cd swig-4* | |
| ./configure --prefix=/usr --without-maximum-compile-warnings && make | |
| make install && install -v -m755 -d /usr/share/doc/swig-4.0.2 && cp -v -R Doc/* /usr/share/doc/swig-4.0.2 | |
| cd .. | |
| # Install Boost | |
| # wget https://boostorg.jfrog.io/artifactory/main/release/1.75.0/source/boost_1_75_0.tar.gz | |
| wget https://archives.boost.io/release/1.82.0/source/boost_1_82_0.tar.gz | |
| tar -xzf boost_1_82_0.tar.gz | |
| cd boost_1_82_0 | |
| ls | |
| ./bootstrap.sh --prefix=/usr --with-python=python | |
| ./b2 install threading=multi link=shared | |
| cd .. | |
| export CXXFLAGS="-I/usr/include" | |
| export LDFLAGS="-L/usr/lib64" | |
| # Clean up | |
| rm -rf boost_1_* | |
| rm -rf swig-4* | |
| CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET=14.0 | |
| CIBW_BEFORE_ALL_MACOS: | | |
| brew install boost swig | |
| export CXXFLAGS="-I$(brew --prefix boost)/include" | |
| export LDFLAGS="-L$(brew --prefix boost)/lib" | |
| - name: Upload artifacts for inspection | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: wheels | |
| path: ./wheelhouse/*.whl | |
| build_sdist: | |
| name: Build source distribution | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.x' | |
| architecture: 'x64' | |
| - name: Install Python dependencies | |
| run: | | |
| python -m pip install --upgrade pip setuptools wheel packaging | |
| - name: Install boost-devel and swig | |
| run: | | |
| sudo apt-get install -y libboost-all-dev swig | |
| - name: Build sdist | |
| run: | | |
| cd ./build/python | |
| python setup.py sdist | |
| - name: Upload artifacts for inspection | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: sdist | |
| path: ./build/python/dist/*.tar.gz | |
| upload_pypi: | |
| needs: [build_wheels, build_sdist] | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'release' && github.event.action == 'published' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.x' | |
| architecture: 'x64' | |
| - name: Install Python dependencies | |
| run: | | |
| python -m pip install --upgrade pip setuptools twine | |
| - name: Download wheel artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: wheels | |
| path: ./dist | |
| - name: Download sdist artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: sdist | |
| path: ./dist | |
| - name: Verify dist directory | |
| run: ls -lah dist | |
| - name: Check packages before upload | |
| run: twine check dist/* | |
| - name: Publish sdist and wheel to PyPI | |
| run: | | |
| twine upload dist/* | |
| env: | |
| TWINE_USERNAME: __token__ | |
| TWINE_PASSWORD: ${{ secrets.PYPI_FORLILAB }} |