diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 866234e..b17e880 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -6,12 +6,14 @@ name: Docker # documentation. on: - push: - branches: [ "main" ] - # Publish semver tags as releases. - tags: [ '*' ] - pull_request: - branches: [ "main" ] + workflow_dispatch: + inputs: + qt: + description: Qt Version + required: true + python: + description: Python Version + required: true env: # Use docker.io for Docker Hub if empty @@ -64,6 +66,8 @@ jobs: uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | + type=raw,value=Qt-${{ inputs.qt }}-Python-${{ inputs.python }} # Build and push Docker image with Buildx (don't push on PR) # https://github.com/docker/build-push-action diff --git a/Dockerfile b/Dockerfile index 8d29d9e..61feda1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,18 +1,21 @@ FROM mcr.microsoft.com/devcontainers/cpp:ubuntu-22.04 ARG AQTINSTALL=3.1.6 -ARG QT=6.2.4 +ARG QT=6.3.2 ARG QT_MODULES= ARG QT_HOST=linux ARG QT_TARGET=desktop ARG QT_ARCH= ARG PYTHON=3.9 -RUN curl -sfL https://github.com/devcontainers-contrib/nanolayer/releases/download/v0.4.45/nanolayer-x86_64-unknown-linux-gnu.tgz | tar fxvz - -C / && \ +COPY extra.sh / + +RUN . /extra.sh && \ + curl -sfL https://github.com/devcontainers-contrib/nanolayer/releases/download/v0.4.45/nanolayer-x86_64-unknown-linux-gnu.tgz | tar fxvz - -C / && \ chmod 755 /nanolayer && \ /nanolayer install \ apt-get \ - libclang-dev,libgl1-mesa-dev,libxkbcommon-x11-0,libdbus-1-3 && \ + $(packages_to_install) && \ /nanolayer install \ devcontainer-feature \ ghcr.io/devcontainers/features/python:1 \ @@ -24,6 +27,8 @@ RUN curl -sfL https://github.com/devcontainers-contrib/nanolayer/releases/downlo --option version="${AQTINSTALL}" && \ rm /nanolayer +RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 60 --slave /usr/bin/g++ g++ /usr/bin/g++-9 + RUN /bin/bash -c 'source /etc/profile && \ aqt install --outputdir /opt/qt ${QT} ${QT_HOST} ${QT_TARGET} ${QT_ARCH} -m ${QT_MODULES}' @@ -33,12 +38,12 @@ RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone USER vscode ENV PATH /opt/qt/${QT}/gcc_64/bin:$PATH -ENV PYSIDE6_INSTALL_DIR "/home/vscode/pyside-setup/build/qfp-py${PYTHON}-qt${QT}-64bit-release/install" RUN /bin/bash -c 'source /etc/profile && \ cd $HOME && \ git clone -b ${QT} https://code.qt.io/pyside/pyside-setup.git && \ cd pyside-setup && \ pip install -r requirements.txt && \ -export MAKEFLAGS="-j$(nproc)" && \ -python setup.py install' +python setup.py build --parallel $(nproc) --limited-api yes' + +ENV PYSIDE_INSTALL_DIR="/home/vscode/pyside-setup/build/qfpa-py${PYTHON}-qt${QT}-64bit-release/install" \ No newline at end of file diff --git a/extra.sh b/extra.sh new file mode 100644 index 0000000..ac9a90e --- /dev/null +++ b/extra.sh @@ -0,0 +1,12 @@ +packages_to_install() { + echo -n "g++-9,libclang-dev,libgl1-mesa-dev,libxkbcommon-x11-0,libdbus-1-3,libpulse-mainloop-glib0" + + case $QT in + 5*) + echo -n ",libpulse-mainloop-glib0" + ;; + *) + echo "" + ;; + esac +} \ No newline at end of file