ci: Pin aqtinstall to (unreleased) head #355
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
| on: [push, pull_request] | |
| jobs: | |
| build_src: | |
| name: Build sdist | |
| runs-on: ubuntu-latest | |
| outputs: | |
| rel0: ${{ steps.query.outputs.rel0 }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
| with: | |
| submodules: recursive | |
| - name: Query PyPI for recent PySide release number | |
| id: query | |
| run: python ./scripts/get-recent-releases.py 3 >> $GITHUB_OUTPUT | |
| - name: Build sdist | |
| env: | |
| PIP_EXTRA_INDEX_URL: https://download.qt.io/official_releases/QtForPython/ | |
| PYSIDE6_QTADS_NO_HARD_PYSIDE_REQUIREMENT: 1 | |
| run: | | |
| python -m pip install --user build | |
| python -m build --sdist | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 | |
| with: | |
| name: source | |
| path: dist/*.tar.gz | |
| # FIXME: Automate minimum Python, manylinux, and custom auditwheel lib filter | |
| build_wheels: | |
| needs: build_src | |
| name: Build wheel ${{ matrix.wheel }} for PySide ${{ matrix.pyside_ver }} on ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| include: | |
| - os: windows-2022 | |
| pyside_ver: ${{ needs.build_src.outputs.rel0 }} | |
| wheel: cp39-win_amd64 | |
| arch: x86_64 | |
| - os: ubuntu-latest | |
| pyside_ver: ${{ needs.build_src.outputs.rel0 }} | |
| wheel: cp39-manylinux_x86_64 | |
| arch: x86_64 | |
| - os: macos-13 | |
| pyside_ver: ${{ needs.build_src.outputs.rel0 }} | |
| wheel: cp39-macosx_x86_64 | |
| arch: x86_64 | |
| - os: macos-13 | |
| pyside_ver: ${{ needs.build_src.outputs.rel0 }} | |
| wheel: cp39-macosx_arm64 | |
| arch: arm64 | |
| steps: | |
| - name: Setup Python | |
| if: runner.os == 'Windows' | |
| uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5 | |
| with: | |
| python-version: '3.9' | |
| - name: Download sdist | |
| uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4 | |
| with: | |
| name: source | |
| - name: Unpack sdist | |
| shell: bash | |
| run: tar --strip-components 1 -xvf *.tar.gz | |
| - name: Setup Qt vars | |
| shell: bash | |
| run: | | |
| QT_VERSION=$(echo ${{ matrix.pyside_ver }} | cut -d. -f-3) | |
| if [[ "$RUNNER_OS" == "Windows" ]]; then | |
| QT_BASE_DIR=${GITHUB_WORKSPACE}\\Qt | |
| QT6_DIR=$QT_BASE_DIR\\$QT_VERSION\\msvc2022_64 | |
| elif [[ "$RUNNER_OS" == "macOS" ]]; then | |
| QT_BASE_DIR=${GITHUB_WORKSPACE}/Qt | |
| QT6_DIR=$QT_BASE_DIR/$QT_VERSION/macos | |
| elif [[ "$RUNNER_OS" == "Linux" ]]; then | |
| QT_BASE_DIR=${GITHUB_WORKSPACE}/Qt | |
| QT6_DIR=$QT_BASE_DIR/$QT_VERSION/gcc_64 | |
| else | |
| echo "Unsupported runner OS $RUNNER_OS" | |
| exit 1 | |
| fi | |
| echo "QT_VERSION=$QT_VERSION" >> $GITHUB_ENV | |
| echo "QT_BASE_DIR=$QT_BASE_DIR" >> $GITHUB_ENV | |
| echo "QT6_DIR=$QT6_DIR" >> $GITHUB_ENV | |
| - uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1 | |
| if: runner.os == 'Windows' | |
| - name: Build wheels | |
| uses: pypa/cibuildwheel@ee63bf16da6cddfb925f542f2c7b59ad50e93969 # v2.22.0 | |
| with: | |
| output-dir: wheelhouse | |
| env: | |
| CIBW_ENVIRONMENT_LINUX: > | |
| CMAKE_PREFIX_PATH=${{ env.QT6_DIR }}/lib/cmake | |
| LD_LIBRARY_PATH=${{ env.QT6_DIR }}/lib | |
| PIP_EXTRA_INDEX_URL=https://download.qt.io/official_releases/QtForPython/ | |
| VERBOSE=1 | |
| CIBW_ENVIRONMENT_MACOS: > | |
| MACOSX_DEPLOYMENT_TARGET=11.0 | |
| CMAKE_OSX_ARCHITECTURES=${{ matrix.arch }} | |
| CMAKE_PREFIX_PATH=${QT6_DIR}/lib/cmake | |
| PIP_EXTRA_INDEX_URL=https://download.qt.io/official_releases/QtForPython/ | |
| VERBOSE=1 | |
| CIBW_ENVIRONMENT_WINDOWS: > | |
| CMAKE_PREFIX_PATH="${QT6_DIR}\\lib\\cmake" | |
| PIP_EXTRA_INDEX_URL=https://download.qt.io/official_releases/QtForPython/ | |
| VERBOSE=1 | |
| CIBW_BEFORE_BUILD_LINUX: > | |
| rpm --import https://repo.almalinux.org/almalinux/RPM-GPG-KEY-AlmaLinux | |
| && yum install -y mesa-libGL libxslt llvm clang clang-devel | |
| && python3 -m pip install --user https://github.com/miurahr/aqtinstall/archive/b789314264ceb3d2e656d363939a42a952a79ccd.zip | |
| && python3 -m pip install --user auditwheel | |
| && python3 -m aqt install-qt linux desktop ${{ env.QT_VERSION }} --outputdir ${{ env.QT_BASE_DIR }} --base http://mirrors.ocf.berkeley.edu/qt/ | |
| && python3 ./scripts/set-qt-constraint.py ${{ matrix.pyside_ver }} | |
| CIBW_BEFORE_BUILD_MACOS: > | |
| python3 -m pip install https://github.com/miurahr/aqtinstall/archive/b789314264ceb3d2e656d363939a42a952a79ccd.zip | |
| && python3 -m aqt install-qt mac desktop ${{ env.QT_VERSION }} --outputdir ${{ env.QT_BASE_DIR }} --base http://mirrors.ocf.berkeley.edu/qt/ | |
| && python3 ./scripts/set-qt-constraint.py ${{ matrix.pyside_ver }} | |
| CIBW_BEFORE_BUILD_WINDOWS: > | |
| python3 -m pip install https://github.com/miurahr/aqtinstall/archive/b789314264ceb3d2e656d363939a42a952a79ccd.zip | |
| && python3 -m aqt install-qt windows desktop ${{ env.QT_VERSION }} win64_msvc2022_64 --outputdir ${{ env.QT_BASE_DIR }} --base http://mirrors.ocf.berkeley.edu/qt/ | |
| && python3 ./scripts/set-qt-constraint.py ${{ matrix.pyside_ver }} | |
| CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28 | |
| CIBW_ARCHS_MACOS: x86_64 arm64 | |
| CIBW_BUILD_VERBOSITY: 3 | |
| CIBW_BUILD: ${{ matrix.wheel }} | |
| CIBW_REPAIR_WHEEL_COMMAND_LINUX: > | |
| python ./scripts/custom-auditwheel.py repair -w {dest_dir} --only-plat --plat manylinux_2_28_x86_64 {wheel} | |
| CIBW_REPAIR_WHEEL_COMMAND_MACOS: | |
| CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: | |
| # - name: Rename wheel to include Qt version | |
| # run: | | |
| # pushd wheelhouse | |
| # for i in *.whl; do | |
| # pkgname=$(echo $i | cut -d- -f1-2) | |
| # pkginfo=$(echo $i | cut -d- -f3-) | |
| # mv $i ${pkgname}-${{ matrix.pyside_ver }}-${pkginfo} | |
| # done | |
| # popd | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 | |
| with: | |
| name: wheel-${{ matrix.wheel }} | |
| path: ./wheelhouse/*.whl | |
| build_aarch64_wheel: | |
| name: Build wheel ${{ matrix.wheel }} for PySide ${{ matrix.pyside_ver }} on ${{ matrix.os }} | |
| needs: build_src | |
| strategy: | |
| matrix: | |
| include: | |
| - os: ubuntu-24.04-arm | |
| pyside_ver: ${{ needs.build_src.outputs.rel0 }} | |
| wheel: cp39-manylinux_aarch64 | |
| arch: aarch64 | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Download sdist | |
| uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4 | |
| with: | |
| name: source | |
| - name: Unpack sdist | |
| shell: bash | |
| run: tar --strip-components 1 -xvf *.tar.gz | |
| - name: Setup Qt vars | |
| shell: bash | |
| run: | | |
| QT_VERSION=$(echo ${{ matrix.pyside_ver }} | cut -d. -f-3) | |
| echo "QT_VERSION=$QT_VERSION" >> $GITHUB_ENV | |
| - name: Build | |
| run: | | |
| cat >build.sh <<EOF | |
| set -e | |
| . /env/bin/activate | |
| pip install https://github.com/miurahr/aqtinstall/archive/b789314264ceb3d2e656d363939a42a952a79ccd.zip | |
| pip install PySide6 auditwheel | |
| aqt install-qt linux_arm64 desktop ${{ env.QT_VERSION }} --outputdir qt | |
| LD_LIBRARY_PATH=/work/qt/${{ env.QT_VERSION }}/gcc_arm64/lib \ | |
| CMAKE_PREFIX_PATH=/work/qt/${{ env.QT_VERSION }}/gcc_arm64/lib/cmake \ | |
| PIP_EXTRA_INDEX_URL=https://download.qt.io/official_releases/QtForPython/ \ | |
| python -m build --verbose --wheel . | |
| mv dist dist-orig | |
| mkdir dist | |
| LD_LIBRARY_PATH=/work/env/lib/python3.12/site-packages/PySide6/ \ | |
| python ./scripts/custom-auditwheel.py repair -w dist --only-plat --plat manylinux_2_38_aarch64 ./dist-orig/PySide6_QtAds-*.whl | |
| EOF | |
| docker run --platform=linux/aarch64 --rm -v $PWD:/work -w /work mborgerson/pyside6qtads-ubuntu2404-aarch64 bash ./build.sh | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 | |
| with: | |
| name: wheel-${{ matrix.wheel }} | |
| path: ./dist/*.whl | |
| upload_pypi: | |
| needs: [build_wheels, build_aarch64_wheel, build_src] | |
| runs-on: ubuntu-latest | |
| # upload to PyPI on every tag starting with 'v' | |
| if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') | |
| steps: | |
| - uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4 | |
| with: | |
| name: source | |
| path: dist | |
| - uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4 | |
| with: | |
| pattern: wheel-* | |
| path: dist | |
| merge-multiple: true | |
| - uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| user: __token__ | |
| password: ${{ secrets.PYPI_TOKEN }} |