Skip to content

migrate to c++20 compiler #835

migrate to c++20 compiler

migrate to c++20 compiler #835

Workflow file for this run

name: build-appimage
on:
push:
tags:
- 'v*'
branches:
- master
pull_request:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true
jobs:
build-appimage:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
submodules: true
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
create-symlink: true
key: ${{ github.job }}
- name: Cache KDE Neon GPG key
id: cache-kde-neon-key
uses: actions/cache@v6
with:
path: kde-neon.gpg
key: kde-neon-key-v1
- name: Add KDE Neon repository
run: |
if [ ! -f kde-neon.gpg ]; then
curl -sSfL --retry 5 --retry-delay 5 https://archive.neon.kde.org/public.key | gpg --dearmor --yes -o kde-neon.gpg
fi
sudo cp kde-neon.gpg /usr/share/keyrings/kde-neon.gpg
echo "deb [signed-by=/usr/share/keyrings/kde-neon.gpg] http://archive.neon.kde.org/user jammy main" | sudo tee /etc/apt/sources.list.d/kde-neon.list
sudo apt update -qq
- name: Install Build Dependencies
run: |
sudo apt install -y \
qt6-base-dev qt6-base-dev-tools libqt6opengl6-dev libqt6websockets6-dev \
qt6-multimedia-dev libqt6multimedia6 qt6-svg-dev \
libgl1-mesa-dev qt6-wayland qtkeychain-qt6-dev build-essential mold git \
zlib1g-dev libssl-dev wget zsync fuse file cmake libxcb-cursor-dev
- name: Download linuxdeploy
run: |
wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
chmod +x linuxdeploy-x86_64.AppImage
- name: Download linuxdeploy-plugin-qt
run: |
wget https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage
chmod +x linuxdeploy-plugin-qt-x86_64.AppImage
- name: Build AppImage
run: |
mkdir -p build && cd build
cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DUSE_MOLD=true \
-DWITH_WEBSOCKET=ON \
-DWITH_QTKEYCHAIN=ON \
-DWITH_TESTS=OFF \
-DPACKAGE_TYPE=AppImage \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
make -j$(getconf _NPROCESSORS_ONLN)
make DESTDIR=appdir install
# Extract version from CPackConfig.cmake
export VERSION=$(grep -i "SET(CPACK_PACKAGE_VERSION " CPackConfig.cmake | cut -d\" -f 2)
# Configure linuxdeploy and make sure the plugin can be found
export PATH=$PATH:$(pwd)/..
export UPDATE_INFORMATION="gh-releases-zsync|MUME|MMapper|latest|MMapper-*-x86_64.AppImage.zsync"
export QMAKE=/usr/bin/qmake6
export EXTRA_PLATFORM_PLUGINS="libqoffscreen.so;libqwayland-egl.so;libqwayland-generic.so"
export EXTRA_QT_PLUGINS="wayland-decoration-client;wayland-graphics-integration-client;wayland-shell-integration;waylandcompositor"
export LIBSECRET_PATH=$(find /usr/lib -name "libsecret-1.so.0" 2>/dev/null | head -n 1)
if [ -z "$LIBSECRET_PATH" ]; then
echo "Error: libsecret-1.so.0 not found in common library paths. Please install it."
exit 1
fi
# Run linuxdeploy
../linuxdeploy-x86_64.AppImage --appdir appdir --output appimage \
--executable appdir/usr/bin/mmapper \
--desktop-file appdir/usr/share/applications/org.mume.MMapper.desktop \
--icon-file appdir/usr/share/icons/hicolor/scalable/apps/org.mume.MMapper.svg \
--library "$LIBSECRET_PATH" \
--plugin qt
- name: Generate SHA256 checksum for AppImage
run: |
sudo chown -R $USER:$USER build/
mv build/*.AppImage* .
export FILE=$(find . -type f -name MMapper*.AppImage | sed 's#./##')
sha256sum $FILE > $FILE.sha256
mkdir ${{ github.workspace }}/artifact
mv MMapper*.AppImage* ${{ github.workspace }}/artifact
- name: Get Linux package file base name
id: get_linux_package_name
run: |
PACKAGE_FILE=$(ls ${{ github.workspace }}/artifact/*.AppImage)
PACKAGE_BASENAME=$(basename "$PACKAGE_FILE" | sed 's/\./-/g')
echo "PACKAGE_BASENAME=$PACKAGE_BASENAME" >> $GITHUB_OUTPUT
- name: Upload AppImage
uses: actions/upload-artifact@v7
with:
name: ${{ steps.get_linux_package_name.outputs.PACKAGE_BASENAME }}
path: ${{ github.workspace }}/artifact/*.AppImage*