Helper script fix #73
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: GH Actions | |
on: | |
release: | |
types: [published] | |
push: | |
pull_request: | |
env: | |
PYSIDE_VERSION: 6.7.1 | |
PIP_EXTRA_INDEX_URL: "https://download.qt.io/official_releases/QtForPython/" | |
jobs: | |
build_sdist: | |
name: Build source distribution | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build sdist | |
run: | | |
sudo apt update && sudo apt install -y libgl-dev | |
pip install aqtinstall | |
aqt install-qt -O "$GITHUB_WORKSPACE"/Qt linux desktop ${{ env.PYSIDE_VERSION }} | |
PATH="$GITHUB_WORKSPACE"/Qt/${{ env.PYSIDE_VERSION }}/gcc_64/bin:$PATH" LD_LIBRARY_PATH="$GITHUB_WORKSPACE"/Qt/${{ env.PYSIDE_VERSION }}/gcc_64/lib:$LD_LIBRARY_PATH" pipx run build --sdist | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: cibw-sdist | |
path: dist/*.tar.gz | |
build_wheels: | |
name: Build wheels on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
include: | |
- os: ubuntu-latest | |
arch: x86_64 | |
- os: windows-latest | |
arch: x86_64 | |
- os: macos-13 # Intel | |
arch: x86_64 | |
- os: macos-14 # Apple Silicon | |
arch: arm64 | |
steps: | |
- uses: ilammy/msvc-dev-cmd@v1 | |
if: runner.os == 'Windows' | |
with: | |
arch: amd64 | |
- uses: actions/checkout@v4 | |
- name: Forward GITHUB_WORKSPACE env var | |
shell: bash | |
run: | | |
echo "GITHUB_WORKSPACE=$GITHUB_WORKSPACE" >> $GITHUB_ENV | |
- name: Build wheels | |
uses: pypa/[email protected] | |
env: | |
PYSIDE_VERSION: ${{ env.PYSIDE_VERSION }} | |
PIP_EXTRA_INDEX_URL: ${{ env.PIP_EXTRA_INDEX_URL }} | |
CIBW_ENVIRONMENT_WINDOWS: PYSIDE_VERSION=${{ env.PYSIDE_VERSION }} PIP_EXTRA_INDEX_URL=${{ env.PIP_EXTRA_INDEX_URL }} PATH="${GITHUB_WORKSPACE}\\Qt\\${{ env.PYSIDE_VERSION }}\\msvc2019_64\\bin;$PATH" | |
CIBW_ENVIRONMENT_MACOS: PYSIDE_VERSION=${{ env.PYSIDE_VERSION }} MACOSX_DEPLOYMENT_TARGET='11.0' PATH=${{ env.GITHUB_WORKSPACE }}/Qt/${{ env.PYSIDE_VERSION }}/macos/bin:$PATH | |
CIBW_ENVIRONMENT_LINUX: PYSIDE_VERSION=${{ env.PYSIDE_VERSION }} PIP_EXTRA_INDEX_URL=${{ env.PIP_EXTRA_INDEX_URL }} PATH=${{ env.GITHUB_WORKSPACE }}/Qt/${{ env.PYSIDE_VERSION }}/gcc_64/bin:$PATH LD_LIBRARY_PATH=${{ env.GITHUB_WORKSPACE }}/Qt/${{ env.PYSIDE_VERSION }}/gcc_64/lib:$LD_LIBRARY_PATH | |
CIBW_BEFORE_BUILD_WINDOWS: > | |
pip install "aqtinstall" | |
&& aqt install-qt -O ${{ env.GITHUB_WORKSPACE }}\\Qt windows desktop ${{ env.PYSIDE_VERSION }} win64_msvc2019_64 | |
CIBW_BEFORE_BUILD_MACOS: > | |
pip install "aqtinstall" | |
&& aqt install-qt -O "${{ env.GITHUB_WORKSPACE }}/Qt" mac desktop ${{ env.PYSIDE_VERSION }} | |
CIBW_BEFORE_BUILD_LINUX: > | |
dnf install -y /usr/lib64/libxkbcommon.so.0 /usr/lib64/libxslt.so.1 clang /usr/bin/llvm-config | |
&& pip install "aqtinstall" && aqt install-qt -O "${{ env.GITHUB_WORKSPACE }}/Qt" linux desktop ${{ env.PYSIDE_VERSION }} | |
CIBW_REPAIR_WHEEL_COMMAND_LINUX: > | |
auditwheel repair -w {dest_dir} --exclude libpyside6.abi3.so.6.7 --exclude libshiboken6.abi3.so.6.7 --exclude libQt6Core.so.6 --exclude libQt6Widgets.so.6 --exclude libQt6Gui.so.6 --exclude libpyside6qml.abi3.so.6.7 --exclude libGLX.so.0 --exclude libOpenGL.so.0 --exclude libxcb.so.1 --only-plat --plat manylinux_2_28_x86_64 {wheel} | |
CIBW_REPAIR_WHEEL_COMMAND_MACOS: | |
CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28 | |
CIBW_SKIP: "*-win32 *i686 *38-* pp* *musllinux*" | |
CIBW_BUILD_VERBOSITY: 3 | |
CIBW_ARCH: ${{ matrix.arch }} | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} | |
path: ./wheelhouse/*.whl | |
upload_pypi: | |
needs: [build_sdist, build_wheels] | |
runs-on: ubuntu-latest | |
# upload to PyPI only on github releases | |
if: github.event_name == 'release' && github.event.action == 'published' && github.repository_owner == 'SciQLop' | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
pattern: cibw-* | |
path: dist | |
merge-multiple: true | |
- uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_PASSWORD }} | |
skip-existing: true | |
upload_test_pypi: | |
needs: [build_sdist, build_wheels] | |
runs-on: ubuntu-latest | |
# upload to test PyPI on github pushes | |
if: github.event_name == 'push' && github.repository_owner == 'SciQLop' | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
pattern: cibw-* | |
path: dist | |
merge-multiple: true | |
- uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_TEST_PASSWORD }} | |
repository-url: https://test.pypi.org/legacy/ | |
skip-existing: true |