Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tamlok committed May 6, 2024
1 parent 9169e71 commit 47a4d42
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 70 deletions.
76 changes: 22 additions & 54 deletions .github/workflows/ci-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,20 @@ on:

# Allows you to run this workflow manually from the Actions tab.
workflow_dispatch:
inputs:
debug_enabled:
type: boolean
description: 'Run the build with tmate debugging enabled'
required: false
default: false

env:
VNOTE_VER: 3.17.0

jobs:
build-linux:
name: Build On Ubuntu
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
timeout-minutes: 120

steps:
Expand All @@ -30,12 +36,22 @@ jobs:
git submodule sync --recursive
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
- name: Install a Fresh CMake
run: |
wget --no-verbose https://github.com/Kitware/CMake/releases/download/v${CMAKE_VER}/cmake-${CMAKE_VER}-Linux-x86_64.sh
chmod +x cmake-${CMAKE_VER}-Linux-x86_64.sh
mkdir ${{runner.workspace}}/cmake
sudo ./cmake-${CMAKE_VER}-Linux-x86_64.sh --skip-license --prefix=${{runner.workspace}}/cmake
sudo rm -f /usr/local/bin/cmake /usr/local/bin/cpack
sudo ln -s ${{runner.workspace}}/cmake/bin/cmake /usr/local/bin/cmake
sudo ln -s ${{runner.workspace}}/cmake/bin/cpack /usr/local/bin/cpack
- name: Install linuxdeploy
uses: miurahr/install-linuxdeploy-action@v1
with:
plugins: qt appimage

- name: Install dependencies
- name: Install Dependencies
run: |
sudo DEBIAN_FRONTEND=noninteractive apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y libfcitx5-qt-dev tree
Expand All @@ -50,7 +66,7 @@ jobs:
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: 6.5.2
version: 6.5.3
target: desktop
modules: 'qtwebengine qtwebchannel qtpositioning qtpdf qtimageformats qt5compat'
cache: 'true'
Expand All @@ -70,60 +86,12 @@ jobs:
- name: Configure Project
run: |
qmake -v
# TODO: libfcitx5
qmake CONFIG+=release -spec linux-g++-64 ${GITHUB_WORKSPACE}/vnote.pro
cmake --version
cmake ${GITHUB_WORKSPACE}
working-directory: ${{runner.workspace}}/build

- name: Build Project
run: make -j$(nproc)
working-directory: ${{runner.workspace}}/build

- name: Install Project
run: |
mkdir AppDir
make install INSTALL_ROOT=${{runner.workspace}}/build/AppDir
tree AppDir
working-directory: ${{runner.workspace}}/build

- name: Package Project
run: |
# Move the lib out to avoid duplication
mv AppDir/usr/lib ./
LD_LIBRARY_PATH=$PWD/lib:$LD_LIBRARY_PATH
Qt6_Dir=$QT_HOST_BINS/..
tree $Qt6_Dir
tree $Qt6_Dir/../..
# Copy translations
mkdir -p AppDir/usr/translations
cp $Qt6_Dir/translations/qt_zh_CN.qm AppDir/usr/translations
# Package qt5ct (EXTRA_QT_PLUGINS seems not work)
# EXTRA_QT_PLUGINS="platformthemes/libqt5ct.so;styles/libqt5ct-style.so"
mkdir -p AppDir/usr/plugins/platformthemes
mkdir -p AppDir/usr/plugins/styles
cp $Qt6_Dir/plugins/platformthemes/* AppDir/usr/plugins/platformthemes/
cp $Qt6_Dir/plugins/styles/* AppDir/usr/plugins/styles/
# Package libssl.so and libcrypto.so
Qt_Tools=$Qt6_Dir/../../Tools
linuxdeploy-x86_64.AppImage --appdir ./AppDir --plugin qt --output appimage -l $Qt_Tools/OpenSSL/binary/lib/libcrypto.so.* -l $Qt_Tools/OpenSSL/binary/lib/
tree AppDir
working-directory: ${{runner.workspace}}/build

- name: Fix Package
run: |
mkdir fixpackage
mv VNote*.AppImage ./fixpackage
pushd fixpackage
# Extract the AppImage
./VNote*.AppImage --appimage-extract
# Remove libnss3.so and libnssutil3.so
rm ./squashfs-root/usr/lib/libnss*.so
# Re-package
rm VNote*.AppImage
linuxdeploy-plugin-appimage-x86_64.AppImage --appdir=./squashfs-root
mv VNote*.AppImage ../
popd
mv VNote*.AppImage vnote-linux-x64_v${{env.VNOTE_VER}}.AppImage
cp vnote-linux-x64_v${{env.VNOTE_VER}}.AppImage vnote-linux-x64.AppImage
run: cmake --build . --target bundle
working-directory: ${{runner.workspace}}/build

- name: Archive Artifacts
Expand Down
28 changes: 12 additions & 16 deletions .github/workflows/ci-win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,20 @@ jobs:
fail-fast: false
matrix:
config:
- {
name: "Build On Win64 Qt 5.15",
arch: win64_msvc2019_64,
qt: 5.15.2,
qt_modules: qtwebengine,
qt_tools: tools_opensslv3_x64,
qt_major: 5,
- name: "Build On Win64 Qt 5.15"
arch: win64_msvc2019_64
qt: 5.15.2
qt_modules: qtwebengine
qt_tools: tools_opensslv3_x64
qt_major: 5
suffix: "-windows7"
}
- {
name: "Build On Win64 Qt 6.5",
arch: win64_msvc2019_64,
qt: 6.5.2,
qt_modules: "qtwebengine qtwebchannel qtpositioning qtpdf qtimageformats qt5compat",
qt_tools: tools_opensslv3_x64,
qt_major: 6,
- name: "Build On Win64 Qt 6.5"
arch: win64_msvc2019_64
qt: 6.5.3
qt_modules: "qtwebengine qtwebchannel qtpositioning qtpdf qtimageformats qt5compat"
qt_tools: tools_opensslv3_x64
qt_major: 6
suffix: ""
}

steps:
# Checks-out your repository under $GITHUB_WORKSPACE.
Expand Down
5 changes: 5 additions & 0 deletions src/CPackLinuxDeployQt.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
execute_process(
COMMAND ${CMAKE_MAKE_PROGRAM} DESTDIR=${CPACK_PACKAGE_DIRECTORY}/_CPack_Packages/Linux/External/AppImage install
WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
execute_process(COMMAND env QMAKE=${qmake_executable} "${LINUXDEPLOY_EXECUTABLE}" --plugin=qt --output=appimage --appdir=${CPACK_PACKAGE_DIRECTORY}/_CPack_Packages/Linux/External/AppImage -e ${CMAKE_BINARY_DIR}/${target} -d ${CPACK_PACKAGE_DIRECTORY}/_CPack_Packages/Linux/External/AppImage${CMAKE_INSTALL_PREFIX}/share/applications/example.desktop
WORKING_DIRECTORY ${CPACK_PACKAGE_DIRECTORY})

0 comments on commit 47a4d42

Please sign in to comment.