From 306dad575c080c8efeb99598b178679dba86a9fa Mon Sep 17 00:00:00 2001 From: =Michael Keller Date: Wed, 8 May 2024 22:39:06 +1200 Subject: [PATCH] CICD: Update the AppImage Build to Use ubuntu 16.04. Update the linux AppImage build to use ubuntu 16.04, and simplify it to a single workflow running on a vanilla docker image. This still uses the upload-artifact@v3 Action that will be EOL in November 2024, because v4 relies on node 20 which has an unmet glibc dependency in ubuntu 16.04. But this workflow can be updated to run on ubuntu 18.04 by a simple search / replace and disabling some 16.04 specific PPAs. @dirkh, @probonopd: I have moved this here from #4183 to be able to review and discuss it without the noise of the workflow cleanup. The workflow now also publishes the AppImage as an artifact on pull request builds, available under Checks / Details / Summary. Signed-off-by: Michael Keller --- .github/workflows/linux-trusty-5.12.yml | 77 --------- .../linux-ubuntu-16.04-5.12-appimage.yml | 161 ++++++++++++++++++ .../scripts/linux-in-container-build.sh | 58 ------- README.md | 2 +- scripts/docker/trusty-qt512/Dockerfile | 85 --------- scripts/docker/trusty-qt512/getpackages.sh | 5 - .../trusty-qt512/ubuntu-esm-infra-trusty | 4 - 7 files changed, 162 insertions(+), 230 deletions(-) delete mode 100644 .github/workflows/linux-trusty-5.12.yml create mode 100644 .github/workflows/linux-ubuntu-16.04-5.12-appimage.yml delete mode 100644 .github/workflows/scripts/linux-in-container-build.sh delete mode 100644 scripts/docker/trusty-qt512/Dockerfile delete mode 100644 scripts/docker/trusty-qt512/getpackages.sh delete mode 100644 scripts/docker/trusty-qt512/ubuntu-esm-infra-trusty diff --git a/.github/workflows/linux-trusty-5.12.yml b/.github/workflows/linux-trusty-5.12.yml deleted file mode 100644 index 163734bd4..000000000 --- a/.github/workflows/linux-trusty-5.12.yml +++ /dev/null @@ -1,77 +0,0 @@ -name: Ubuntu 14.04 / Qt 5.12 for AppImage-- -on: - push: - paths-ignore: - - scripts/docker/** - branches: - - master - pull_request: - paths-ignore: - - scripts/docker/** - branches: - - master - -jobs: - buildAppImage: - runs-on: ubuntu-latest - container: - image: docker://subsurface/trusty-qt512:1.1 - - steps: - - name: checkout sources - uses: actions/checkout@v1 - - - name: atomically create or retrieve the build number and assemble release notes - id: version_number - if: github.event_name == 'push' - run: | - bash ./scripts/get-atomic-buildnr.sh ${{ github.sha }} ${{ secrets.NIGHTLY_BUILDS }} "CICD-release" - version=$(cat release-version) - echo "version=$version" >> $GITHUB_OUTPUT - - - name: store dummy version and build number for pull request - if: github.event_name == 'pull_request' - run: | - echo "100" > latest-subsurface-buildnumber - echo "CICD-pull-request" > latest-subsurface-buildnumber-extension - - - name: run build - env: - SUBSURFACE_REPO_PATH: ${{ github.workspace }} - run: | - cd .. - git config --global --add safe.directory ${SUBSURFACE_REPO_PATH} - git config --global --add safe.directory ${SUBSURFACE_REPO_PATH}/libdivecomputer - rm -rf /install-root/include/libdivecomputer - bash -x subsurface/.github/workflows/scripts/linux-in-container-build.sh - - - name: prepare PR artifacts - if: github.event_name == 'pull_request' - run: | - mkdir -p Linux-artifacts - mv Subsurface.AppImage Linux-artifacts - - - name: PR artifacts - if: github.event_name == 'pull_request' - uses: actions/upload-artifact@v3 - with: - name: Linux-artifacts - path: Linux-artifacts - - - name: prepare release artifacts - if: github.event_name == 'push' - run: | - mv Subsurface.AppImage Subsurface-v${{ steps.version_number.outputs.version }}.AppImage - - # only publish a 'release' on push events (those include merging a PR) - - name: upload binaries - if: github.event_name == 'push' - uses: softprops/action-gh-release@v1 - with: - tag_name: v${{ steps.version_number.outputs.version }} - repository: ${{ github.repository_owner }}/nightly-builds - token: ${{ secrets.NIGHTLY_BUILDS }} - prerelease: false - fail_on_unmatched_files: true - files: | - ./Subsurface*.AppImage diff --git a/.github/workflows/linux-ubuntu-16.04-5.12-appimage.yml b/.github/workflows/linux-ubuntu-16.04-5.12-appimage.yml new file mode 100644 index 000000000..ac0b353e4 --- /dev/null +++ b/.github/workflows/linux-ubuntu-16.04-5.12-appimage.yml @@ -0,0 +1,161 @@ +name: Ubuntu 16.04 / Qt 5.15-- for AppImage +on: + push: + paths-ignore: + - scripts/docker/** + branches: + - master + pull_request: + paths-ignore: + - scripts/docker/** + branches: + - master + +jobs: + build: + runs-on: ubuntu-latest + container: + image: ubuntu:16.04 + + steps: + - name: checkout sources + uses: actions/checkout@v1 + + - name: get container ready for build + run: | + echo "--------------------------------------------------------------" + echo "update distro and install dependencies" + + apt-get update + DEBIAN_FRONTEND=noninteractive apt-get install -y -q \ + software-properties-common \ + apt-transport-https \ + curl + + curl https://apt.kitware.com/keys/kitware-archive-latest.asc | apt-key add - + + add-apt-repository -y ppa:savoury1/qt-5-15 + add-apt-repository -y ppa:savoury1/kde-5-80 + add-apt-repository -y ppa:savoury1/gpg + add-apt-repository -y ppa:savoury1/ffmpeg4 + add-apt-repository -y ppa:savoury1/vlc3 + add-apt-repository -y ppa:savoury1/gcc-9 + add-apt-repository -y ppa:savoury1/display + add-apt-repository -y ppa:savoury1/apt-xenial + add-apt-repository -y ppa:savoury1/gtk-xenial + add-apt-repository -y ppa:savoury1/qt-xenial + add-apt-repository -y ppa:savoury1/kde-xenial + add-apt-repository -y ppa:mayeut-github/devtoolset-10 + add-apt-repository -y 'deb https://apt.kitware.com/ubuntu/ xenial main' + apt-get update + apt-get dist-upgrade -y + DEBIAN_FRONTEND=noninteractive apt-get install -y -q \ + autoconf automake cmake g++ g++-9 git libcrypto++-dev libcurl4-gnutls-dev \ + libgit2-dev libqt5qml5 libqt5quick5 libqt5svg5-dev \ + libqt5webkit5-dev libsqlite3-dev libssh2-1-dev libssl-dev libssl-dev \ + libtool libusb-1.0-0-dev libxml2-dev libxslt1-dev libzip-dev make \ + pkg-config qml-module-qtlocation qml-module-qtpositioning \ + qml-module-qtquick2 qt5-qmake qtchooser qtconnectivity5-dev \ + qtdeclarative5-dev qtdeclarative5-private-dev qtlocation5-dev \ + qtpositioning5-dev qtscript5-dev qttools5-dev qttools5-dev-tools \ + qtquickcontrols2-5-dev xvfb libbluetooth-dev libmtp-dev + + update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 60 \ + --slave /usr/bin/g++ g++ /usr/bin/g++-9 + + - name: atomically create or retrieve the build number and assemble release notes + id: version_number + if: github.event_name == 'push' + run: | + bash ./scripts/get-atomic-buildnr.sh ${{ github.sha }} ${{ secrets.NIGHTLY_BUILDS }} "CICD-release" + version=$(cat release-version) + echo "version=$version" >> $GITHUB_OUTPUT + + - name: store dummy version and build number for pull request + id: pull_request_version_number + if: github.event_name == 'pull_request' + run: | + echo "100" > latest-subsurface-buildnumber + echo "CICD-pull-request" > latest-subsurface-buildnumber-extension + version=$(scripts/get-version) + echo "version=$version" >> $GITHUB_OUTPUT + + - name: build Subsurface + run: | + echo "--------------------------------------------------------------" + echo "building desktop" + + # now build the appimage + cd .. + bash -e -x subsurface/scripts/build.sh -desktop -create-appdir -build-with-webkit + + - name: test desktop build + run: | + echo "--------------------------------------------------------------" + echo "running tests for desktop" + cd build/tests + # xvfb-run --auto-servernum ./TestGitStorage -v2 + xvfb-run --auto-servernum make check + + - name: build appimage + run: | + echo "--------------------------------------------------------------" + echo "assembling AppImage" + + export QT_PLUGIN_PATH=$QT_ROOT/plugins + export QT_QPA_PLATFORM_PLUGIN_PATH=$QT_ROOT/plugins + export QT_DEBUG_PLUGINS=1 + + cd .. + + # set up the appdir + mkdir -p appdir/usr/plugins/ + + # mv googlemaps plugins into place + mv appdir/usr/usr/lib/x86_64-linux-gnu/qt5/plugins/* appdir/usr/plugins # the usr/usr is not a typo, that's where it ends up + rm -rf appdir/usr/home/ appdir/usr/include/ appdir/usr/share/man/ # No need to ship developer and man files as part of the AppImage + rm -rf appdir/usr/usr appdir/usr/lib/x86_64-linux-gnu/cmake appdir/usr/lib/pkgconfig + cp /usr/lib/x86_64-linux-gnu/libssl.so.1.1 appdir/usr/lib/ + cp /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1 appdir/usr/lib/ + + # get the linuxdeployqt tool and run it to collect the libraries + curl -L -O "https://github.com/probonopd/linuxdeployqt/releases/download/7/linuxdeployqt-7-x86_64.AppImage" + chmod a+x linuxdeployqt*.AppImage + unset QTDIR + unset QT_PLUGIN_PATH + unset LD_LIBRARY_PATH + ./linuxdeployqt*.AppImage --appimage-extract-and-run ./appdir/usr/share/applications/*.desktop -exclude-libs=libdbus-1.so.3 -bundle-non-qt-libs -qmldir=./subsurface/stats -qmldir=./subsurface/map-widget/ -verbose=2 + + # create the AppImage + export VERSION=$(cd subsurface/scripts ; ./get-version) # linuxdeployqt uses this for naming the file + ./linuxdeployqt*.AppImage --appimage-extract-and-run ./appdir/usr/share/applications/*.desktop -exclude-libs=libdbus-1.so.3 -appimage -qmldir=./subsurface/stats -qmldir=./subsurface/map-widget/ -verbose=2 + + # copy AppImage to the calling VM + # with GitHub Actions the /${GITHUB_WORKSPACE} directory is the current working directory at the start of a step + cp Subsurface*.AppImage* /${GITHUB_WORKSPACE}/Subsurface.AppImage + + - name: PR artifacts + if: github.event_name == 'pull_request' + uses: actions/upload-artifact@v3 + with: + name: Subsurface-Linux-AppImage-${{ steps.pull_request_version_number.outputs.version }} + path: Subsurface.AppImage + compression-level: 0 + + - name: prepare release artifacts + if: github.event_name == 'push' + run: | + mv Subsurface.AppImage Subsurface-v${{ steps.version_number.outputs.version }}.AppImage + + # only publish a 'release' on push events (those include merging a PR) + - name: upload binaries + if: github.event_name == 'push' + uses: softprops/action-gh-release@v1 + with: + tag_name: v${{ steps.version_number.outputs.version }} + repository: ${{ github.repository_owner }}/nightly-builds + token: ${{ secrets.NIGHTLY_BUILDS }} + prerelease: false + fail_on_unmatched_files: true + files: | + ./Subsurface*.AppImage diff --git a/.github/workflows/scripts/linux-in-container-build.sh b/.github/workflows/scripts/linux-in-container-build.sh deleted file mode 100644 index 8e63aacdc..000000000 --- a/.github/workflows/scripts/linux-in-container-build.sh +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/bash - -set -x -set -e - -# this gets executed by the GitHub Action when building an AppImage for Linux -# inside of the trusty-qt512 container - -export PATH=$QT_ROOT/bin:$PATH # Make sure correct qmake is found on the $PATH for linuxdeployqt -export CMAKE_PREFIX_PATH=$QT_ROOT/lib/cmake - -# echo "--------------------------------------------------------------" -# echo "install missing packages" -# apt install -y libbluetooth-dev libmtp-dev - -# the container currently has things under / that need to be under /__w/subsurface/subsurface instead -cp -a /appdir /__w/subsurface/ -cp -a /install-root /__w/subsurface/ - -echo "--------------------------------------------------------------" -echo "building desktop" - -# now build our AppImage -bash -e -x subsurface/scripts/build.sh -desktop -create-appdir -build-with-webkit -quick - -echo "--------------------------------------------------------------" -echo "assembling AppImage" - -export QT_PLUGIN_PATH=$QT_ROOT/plugins -export QT_QPA_PLATFORM_PLUGIN_PATH=$QT_ROOT/plugins -export QT_DEBUG_PLUGINS=1 - -# set up the appdir -mkdir -p appdir/usr/plugins/ - -# mv googlemaps plugins into place -mv appdir/usr/usr/local/Qt/5.*/gcc_64/plugins/* appdir/usr/plugins # the usr/usr is not a typo, that's where it ends up -rm -rf appdir/usr/home/ appdir/usr/include/ appdir/usr/share/man/ # No need to ship developer and man files as part of the AppImage -rm -rf appdir/usr/usr appdir/usr/lib/cmake appdir/usr/lib/pkgconfig -cp /ssllibs/libssl.so appdir/usr/lib/libssl.so.1.1 -cp /ssllibs/libcrypto.so appdir/usr/lib/libcrypto.so.1.1 - -# get the linuxdeployqt tool and run it to collect the libraries -curl -L -O "https://github.com/probonopd/linuxdeployqt/releases/download/7/linuxdeployqt-7-x86_64.AppImage" -chmod a+x linuxdeployqt*.AppImage -unset QTDIR -unset QT_PLUGIN_PATH -unset LD_LIBRARY_PATH -./linuxdeployqt*.AppImage --appimage-extract-and-run ./appdir/usr/share/applications/*.desktop -exclude-libs=libdbus-1.so.3 -bundle-non-qt-libs -qmldir=./subsurface/stats -qmldir=./subsurface/map-widget/ -verbose=2 - -# create the AppImage -export VERSION=$(cd subsurface/scripts ; ./get-version) # linuxdeployqt uses this for naming the file -./linuxdeployqt*.AppImage --appimage-extract-and-run ./appdir/usr/share/applications/*.desktop -exclude-libs=libdbus-1.so.3 -appimage -qmldir=./subsurface/stats -qmldir=./subsurface/map-widget/ -verbose=2 - -# copy AppImage to the calling VM -# with GitHub Actions the /${GITHUB_WORKSPACE} directory is the current working directory at the start of a step -cp Subsurface*.AppImage* /${GITHUB_WORKSPACE}/Subsurface.AppImage -ls -l /${GITHUB_WORKSPACE}/Subsurface.AppImage diff --git a/README.md b/README.md index b739ab533..42a75b0a9 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ [![Android](https://github.com/subsurface/subsurface/actions/workflows/android.yml/badge.svg)](https://github.com/subsurface/subsurface/actions/workflows/android.yml) [![Snap](https://github.com/subsurface/subsurface/actions/workflows/linux-snap.yml/badge.svg)](https://github.com/subsurface/subsurface/actions/workflows/linux-snap.yml) -[![Ubuntu 14.04 / Qt 5.12 for AppImage--](https://github.com/subsurface/subsurface/actions/workflows/linux-trusty-5.12.yml/badge.svg)](https://github.com/subsurface/subsurface/actions/workflows/linux-trusty-5.12.yml) +[![Ubuntu 16.04 / Qt 5.15-- for AppImage](https://github.com/subsurface/subsurface/actions/workflows/linux-ubuntu-16.04-5.12-appimage.yml/badge.svg)](https://github.com/subsurface/subsurface/actions/workflows/linux-ubuntu-16.04-5.12-appimage.yml) [![Ubuntu 24.04 / Qt 5.15--](https://github.com/subsurface/subsurface/actions/workflows/linux-ubuntu-24.04-5.15.yml/badge.svg)](https://github.com/subsurface/subsurface/actions/workflows/linux-ubuntu-24.04-5.15.yml) [![Fedora 35 / Qt 6--](https://github.com/subsurface/subsurface/actions/workflows/linux-fedora-35-qt6.yml/badge.svg)](https://github.com/subsurface/subsurface/actions/workflows/linux-fedora-35-qt6.yml) [![Debian trixie / Qt 5.15--](https://github.com/subsurface/subsurface/actions/workflows/linux-debian-trixie-5.15.yml/badge.svg)](https://github.com/subsurface/subsurface/actions/workflows/linux-debian-trixie-5.15.yml) diff --git a/scripts/docker/trusty-qt512/Dockerfile b/scripts/docker/trusty-qt512/Dockerfile deleted file mode 100644 index 0826e9ee1..000000000 --- a/scripts/docker/trusty-qt512/Dockerfile +++ /dev/null @@ -1,85 +0,0 @@ -FROM ubuntu:14.04 -LABEL Description="Trusty with Qt 5.12 and Subsurface build deps" - -# right now (2019-11-27) the upstream image is broken -# use workaround from https://bugs.launchpad.net/ubuntu/+source/ubuntu-advantage-tools/+bug/1854202 -ADD ubuntu-esm-infra-trusty /etc/apt/preferences.d/ubuntu-esm-infra-trusty - -# that's a lot of packages. Needed for the Qt installer, for QtWebKit -# and for SmartTrak -# the awkward start is because we need something newer than the default -# compiler for QtWebKit and we need software-properties-common in order to -# call add-apt-repositoty - -RUN apt-get -y update && apt-get install -y software-properties-common -RUN add-apt-repository -y 'ppa:ubuntu-toolchain-r/test' -RUN apt-get -y update && apt-get install -y \ - gcc-7 g++-7 make git autoconf automake libtool pkg-config \ - curl libdbus-1-3 libexpat1 libfontconfig1 libfreetype6 \ - libexpat1-dev libgl1-mesa-dev libgl1-mesa-glx \ - ruby gperf bison libx11-6 libx11-xcb1 libjpeg-dev libpng-dev \ - libicu-dev libXcomposite-dev libXrender-dev libgstreamer-plugins-base1.0 \ - libxml2-dev libxslt1-dev libzip-dev libsqlite3-dev libusb-1.0-0-dev \ - libssl-dev libssh2-1-dev libcurl4-openssl-dev mesa-common-dev libqt5gui5 \ - libxcb-xinerama0 libpulse-mainloop-glib0 libhyphen-dev libicu52 \ - libglib2.0-dev mdbtools-dev libbluetooth-dev libmtp-dev - -# oddly this gets us too many gcc/g++ version (even though we explicitly -# ask for gcc-7/g++-7 -RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 10 && \ - update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 10 && \ - update-alternatives --install /usr/bin/cc cc /usr/bin/gcc 10 && \ - update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++ 10 && \ - update-alternatives --set cc /usr/bin/gcc && \ - update-alternatives --set c++ /usr/bin/g++ - -# cmake in trusty is too old -ADD cmake-3.13.2-Linux-x86_64.sh . -RUN chmod a+x cmake-3.13.2-Linux-x86_64.sh && ./cmake-3.13.2-Linux-x86_64.sh --prefix=/usr --skip-license && rm -f cmake-3.13.2-Linux-x86_64.sh - -# deadsnale Python 3.6 -RUN add-apt-repository ppa:deadsnakes/ppa -RUN apt-get update && sudo apt-get install -y python3.6 - -# install Qt -RUN curl "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py" && python3.6 get-pip.py -RUN pip3 install aqtinstall -RUN find /usr /home -name aqt -ls -RUN /usr/local/bin/aqt install -O /usr/local/Qt 5.12.10 linux desktop -RUN rm -rf /usr/local/Qt/Tools /usr/local/Qt/Docs /usr/local/Qt/Examples /usr/local/Qt/Maintenance* \ - /usr/local/Qt/5.12.10/gcc_64/bin/qgltf /usr/local/Qt/5.12.10/gcc_64/bin/qdoc -ENV QT_ROOT /usr/local/Qt/5.12.10/gcc_64 -ENV PATH="/usr/local/Qt/5.12.10/gcc_64/bin/:${PATH}" - -# now build and install QtWebKit -RUN git clone -b 5.212 https://github.com/qt/qtwebkit -RUN mkdir -p qtwebkit/WebKitBuild/Release -RUN cd qtwebkit/WebKitBuild/Release && cmake -DPORT=Qt -DCMAKE_BUILD_TYPE=Release -DQt5_DIR=/usr/local/Qt/5.12.10/gcc_64/lib/cmake/Qt5 ../.. -RUN cd qtwebkit/WebKitBuild/Release && make -j4 && make install -RUN rm -rf qtwebkit - -# finally, we need a new libdbus -# RUN curl -O https://dbus.freedesktop.org/releases/dbus/dbus-1.12.16.tar.gz -ADD dbus-1.12.16.tar.gz . -RUN mkdir dbus-1.12.16/build && \ - cd dbus-1.12.16/build && \ - sed -inline 's/${CMAKE_INSTALL_FULL_LOCALSTATEDIR}\/lib\/dbus\/machine-id/\/var\/lib\/dbus\/machine-id/' ../cmake/CMakeLists.txt && \ - cmake ../cmake -DDBUS_INSTALL_SYSTEM_LIBS=1 && \ - make -j4 install && \ - ldconfig - -ADD OpenSSL_1_1_1i.tar.gz . -RUN cd /openssl-OpenSSL_1_1_1i && \ - ./config --prefix=/usr/local/ssl --openssldir=/usr/local/ssl shared zlib && \ - make -j4 && mkdir -p /ssllibs && cp *.so /ssllibs && cd / && rm -rf openssl-OpenSSL_1_1_1i - -# try to remove some of the packages we no longer need -RUN apt-get remove -y libqt5core5a libqt5dbus5 libqt5gui5 ruby openssh-client - -# now build Subsurface once to populate the dependencies we don't get from -# Ubuntu but that aren't really part of Subsurface (libgit, googlemaps) -RUN git clone https://github.com/Subsurface/subsurface -RUN bash -e -x ./subsurface/scripts/build.sh -desktop -create-appdir -build-with-webkit - -# remove the source, but keep the install-root -RUN rm -rf subsurface libgit2 googlemaps diff --git a/scripts/docker/trusty-qt512/getpackages.sh b/scripts/docker/trusty-qt512/getpackages.sh deleted file mode 100644 index 53250ba2c..000000000 --- a/scripts/docker/trusty-qt512/getpackages.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -wget https://github.com/Kitware/CMake/releases/download/v3.13.2/cmake-3.13.2-Linux-x86_64.sh -curl -O https://dbus.freedesktop.org/releases/dbus/dbus-1.12.16.tar.gz -wget https://github.com/openssl/openssl/archive/OpenSSL_1_1_1i.tar.gz diff --git a/scripts/docker/trusty-qt512/ubuntu-esm-infra-trusty b/scripts/docker/trusty-qt512/ubuntu-esm-infra-trusty deleted file mode 100644 index 640bf5fc1..000000000 --- a/scripts/docker/trusty-qt512/ubuntu-esm-infra-trusty +++ /dev/null @@ -1,4 +0,0 @@ -# Written by ubuntu-advantage-tools -Package: * -Pin: release o=UbuntuESM, n=trusty -Pin-Priority: never