diff --git a/.github/workflows/linux_release.yml b/.github/workflows/linux_release.yml new file mode 100644 index 0000000..176b5ba --- /dev/null +++ b/.github/workflows/linux_release.yml @@ -0,0 +1,60 @@ +name: Linux Release + +on: + push: + branches: + - "dev" + +defaults: + run: + shell: bash + +env: + SOURCE_DIR: ${{ github.workspace }} + ARTIFACT: marsh-mgr.AppImage + QT_VERSION: 6.5 + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout repo + uses: actions/checkout@v2 + with: + submodules: recursive + + - name: Generate MAVLink dialect + run: | + pip3 install future + python3 ${{ env.SOURCE_DIR }}/scripts/update_mavlink.py + + - name: Install Qt + uses: jurplel/install-qt-action@v4 + with: + version: ${{ env.QT_VERSION }} + host: linux + target: desktop + arch: gcc_64 + dir: ${{ runner.temp }} + setup-python: false + + - name: Install AppImage prerequisites + run: sudo apt install libfuse2 + + - name: Install LinuxDeploy + uses: miurahr/install-linuxdeploy-action@v1 + with: + plugins: qt appimage + dir: ${{ github.workspace }}/tools + + - name: Build AppImage + run: | + cp ${{ github.workspace }}/tools/linuxdeploy-x86_64.AppImage ${{ github.workspace }}/tools/linuxdeploy + Qt6_DIR=${QT_ROOT_DIR} PATH=${{ github.workspace }}/tools:$PATH ./scripts/build_appimage.sh + + - name: Linux artefact + uses: actions/upload-artifact@v1 + with: + name: ${{ env.ARTIFACT }} + path: ${{ env.SOURCE_DIR }}/MARSH_Manager-x86_64.AppImage diff --git a/scripts/build_appimage.sh b/scripts/build_appimage.sh index 421d3ab..2abb8ce 100755 --- a/scripts/build_appimage.sh +++ b/scripts/build_appimage.sh @@ -1,5 +1,6 @@ #! /bin/bash # based on https://docs.appimage.org/packaging-guide/from-source/native-binaries.html#using-cmake-and-make-install +# accepts a single argument for build type, by default Release set -x set -e @@ -44,7 +45,7 @@ pushd "$BUILD_DIR" # configure build files with CMake # we need to explicitly set the install prefix, as CMake's default is /usr/local for some reason... -cmake "$REPO_ROOT" -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Debug +cmake "$REPO_ROOT" -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=${1:-Release} # build project and install files into AppDir make -j$(nproc) diff --git a/scripts/update_mavlink.py b/scripts/update_mavlink.py index 95bc699..a294751 100755 --- a/scripts/update_mavlink.py +++ b/scripts/update_mavlink.py @@ -3,6 +3,11 @@ """ Generates required libraries based on the message definitions in mavlink submodule. Doesn't accept any arguments by design. + +Requires future package, example of installation: +``` +pip install future +``` """ from os import path, makedirs