From d412b66c6e457fe352d874b67d9c5bbb38f4c7ed Mon Sep 17 00:00:00 2001 From: Torsten Sachse Date: Fri, 25 Mar 2022 22:29:55 +0100 Subject: [PATCH 1/2] Add github action for building an appimage --- .github/workflows/appimage.yml | 101 +++++++++++++++++++++++++++++++++ cool-retro-term.pro | 2 + 2 files changed, 103 insertions(+) create mode 100644 .github/workflows/appimage.yml diff --git a/.github/workflows/appimage.yml b/.github/workflows/appimage.yml new file mode 100644 index 0000000..8123ff3 --- /dev/null +++ b/.github/workflows/appimage.yml @@ -0,0 +1,101 @@ +name: "ci" + +on: + push: + tags: "**" + workflow_dispatch: + +permissions: + contents: write + +defaults: + run: + shell: bash + +jobs: + appimage: + runs-on: ubuntu-18.04 + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + with: + submodules: true + + - name: Install dependencies + run: | + sudo add-apt-repository -y ppa:beineri/opt-qt-5.15.2-bionic + sudo apt-get update -qq + sudo apt-get install -y \ + build-essential make wget libgl1-mesa-dev \ + qt515declarative qt515graphicaleffects \ + qt515quickcontrols qt515quickcontrols2 + + - name: Download QT appimage builder + run: | + wget -c -O linuxdeployqt.AppImage \ + https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage + chmod a+x linuxdeployqt.AppImage + + - name: Build project + run: | + source /opt/qt*/bin/qt*-env.sh && \ + qmake -v && \ + qmake CONFIG+=release PREFIX=/usr && \ + make -j$(nproc) + + - name: Install to appdir + run: | + source /opt/qt*/bin/qt*-env.sh && \ + make INSTALL_ROOT=appdir -j$(nproc) install + + - name: Extract version number + run: | + # Extract version for linuxdeployqt to name the file. Use the tag as + # release name but remove prefix. + echo "VERSION=$(echo '${{ github.ref }}' | sed 's;.*/;;')" >> $GITHUB_ENV + + - name: Build appimage directory + run: | + mkdir -p \ + appdir/usr/bin \ + appdir/usr/lib \ + appdir/usr/share/applications \ + appdir/usr/share/metainfo \ + appdir/usr/share/icons/hicolor/128x128/apps + + cp cool-retro-term appdir/usr/bin/ + cp cool-retro-term.desktop appdir/usr/share/applications/ + cp packaging/appdata/cool-retro-term.appdata.xml appdir/usr/share/metainfo/ + cp app/icons/128x128/cool-retro-term.png appdir/usr/share/icons/hicolor/128x128/apps/ + cp -r ./app/qml appdir/usr/ + # Workaround for https://github.com/probonopd/linuxdeployqt/issues/78 + cp -r ./qmltermwidget/QMLTermWidget appdir/usr/qml/ + + find appdir | sort + + - name: Build appimage + run: | + source /opt/qt*/bin/qt*-env.sh && \ + ./linuxdeployqt.AppImage appdir/usr/share/applications/cool-retro-term.desktop \ + -verbose=1 -appimage \ + -qmldir=./app/qml/ \ + -qmldir=./qmltermwidget/ + env: + # Unset environment variables + QTDIR: + QT_PLUGIN_PATH: + LD_LIBRARY_PATH: + + - name: Upload release + uses: softprops/action-gh-release@v1 + with: + body: appimage release + files: ./**/Cool_Retro_Term-*-x86_64.AppImage + + - name: Clean up + if: always() + run: | + find appdir -executable -type f -exec ldd {} \; | grep " => /usr" | cut -d " " -f 2-3 | sort | uniq + make clean + rm -rf appdir diff --git a/cool-retro-term.pro b/cool-retro-term.pro index 851f0b4..df27b4b 100644 --- a/cool-retro-term.pro +++ b/cool-retro-term.pro @@ -5,6 +5,8 @@ CONFIG += ordered SUBDIRS += qmltermwidget SUBDIRS += app +QT += quick + desktop.files += cool-retro-term.desktop desktop.path += /usr/share/applications From d4baaeccfc3bae24f394eb2e33ba04df6aee680d Mon Sep 17 00:00:00 2001 From: Torsten Sachse Date: Tue, 29 Mar 2022 08:22:59 +0200 Subject: [PATCH 2/2] Undo unneeded code changes --- .github/workflows/appimage.yml | 3 --- cool-retro-term.pro | 2 -- 2 files changed, 5 deletions(-) diff --git a/.github/workflows/appimage.yml b/.github/workflows/appimage.yml index 8123ff3..2627318 100644 --- a/.github/workflows/appimage.yml +++ b/.github/workflows/appimage.yml @@ -5,9 +5,6 @@ on: tags: "**" workflow_dispatch: -permissions: - contents: write - defaults: run: shell: bash diff --git a/cool-retro-term.pro b/cool-retro-term.pro index df27b4b..851f0b4 100644 --- a/cool-retro-term.pro +++ b/cool-retro-term.pro @@ -5,8 +5,6 @@ CONFIG += ordered SUBDIRS += qmltermwidget SUBDIRS += app -QT += quick - desktop.files += cool-retro-term.desktop desktop.path += /usr/share/applications