Skip to content

Commit

Permalink
CI: build with Qt 6
Browse files Browse the repository at this point in the history
  • Loading branch information
BLumia committed May 17, 2024
1 parent 5d837ae commit 2baa7e7
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 63 deletions.
40 changes: 11 additions & 29 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,60 +2,42 @@

name: Linux Package

# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master ]
pull_request:
branches: [ master ]
on: [push, pull_request, workflow_dispatch]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-22.04

# Steps represent a sequence of tasks that will be executed as part of the job
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: recursive

- name: Install build dept.
run: |
sudo apt update
sudo apt install qtbase5-dev qtmultimedia5-dev libqt5multimedia5-plugins
sudo apt install cmake qt6-base-dev qt6-multimedia-dev
# for linuxdeploy: https://github.com/AppImage/AppImageKit/wiki/FUSE
# linuxdeploy-plugin-qt still requires qmake currently: https://github.com/linuxdeploy/linuxdeploy-plugin-qt/issues/156
sudo add-apt-repository universe
sudo apt install libfuse2
sudo apt install libfuse2 qmake6
- name: Get linuxdeploy
run: |
wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
wget https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage
chmod +x linuxdeploy-*.AppImage
- name: Build
working-directory: ./
run: |
mkdir build && cd build
cmake ..
cmake --build . -j$(nproc)
cd ..
cmake -B build .
cmake --build build -j
- name: Package
env:
QMAKE: /usr/bin/qmake6
run: |
./linuxdeploy-x86_64.AppImage --appdir AppDir -e build/thplayer -d assets/thplayer.desktop -i assets/thplayer.svg --icon-filename thplayer -p qt -o appimage
mv TouHou_Player*.AppImage thplayer-linux.AppImage
- name: Upload
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: Linux-Build
path: thplayer-linux.AppImage
33 changes: 8 additions & 25 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,53 +2,36 @@

name: macOS Package

# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master ]
pull_request:
branches: [ master ]
on: [push, pull_request, workflow_dispatch]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: macos-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: recursive

- name: Install Qt
uses: jurplel/install-qt-action@v3

with:
version: '6.7.0'
modules: 'qtmultimedia'
- name: Build
working-directory: ./
run: |
mkdir build && cd build
cmake ..
cmake --build . -j$(nproc)
cd ..
cmake -B build .
cmake --build build -j
- name: Package
id: package
working-directory: ./
continue-on-error: true
run: |
macdeployqt build/thplayer.app
zip -r9 --symlinks thplayer-macos.zip thplayer.app
- name: Upload
if: steps.package.conclusion == 'success'
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: macOS-Build
path: thplayer-macos.zip
18 changes: 9 additions & 9 deletions .github/workflows/windows-msys2.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Windows MSYS2 Build
on: [push, pull_request]
on: [push, pull_request, workflow_dispatch]

jobs:
build:
Expand All @@ -8,7 +8,7 @@ jobs:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: msys2/setup-msys2@v2
Expand All @@ -17,26 +17,26 @@ jobs:
update: true
pacboy: >-
toolchain:p ninja:p cmake:p extra-cmake-modules:p icoutils:p
qt5-static:p bison: flex:
qt6:p icu:p bison: flex:
- name: Build
run: |
mkdir build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX} -DCMAKE_PREFIX_PATH="${MINGW_PREFIX}/qt5-static" -G Ninja
cmake --build . -j
cd ..
# for static build we will need -DCMAKE_PREFIX_PATH="${MINGW_PREFIX}/qt6-static"
# but MSYS2's static Qt 6 is problematic currently: https://github.com/msys2/MINGW-packages/issues/18966
cmake . -B build -DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX} -G Ninja
cmake --build build -j
- name: Prepare for package
continue-on-error: true
run: |
mkdir package_workspace && cd package_workspace
cp ../build/thplayer.exe ./
strip -s ./thplayer.exe
# windeployqt -winextras --no-quick-import --no-translations --no-opengl-sw --no-angle --no-system-d3d-compiler ./thplayer.exe
windeployqt6 --no-quick-import --no-translations --no-opengl-sw --no-system-d3d-compiler ./thplayer.exe
ldd ./thplayer.exe > deps.txt
bash -c 'while read -r line; do path=$(cut -d" " -f3 <<<$line); cp -v $path ./; done <<<$(grep ".*mingw.*bin" deps.txt); exit 0'
rm deps.txt
# done
cd ../
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: msys2-mingw-w64-x86_64-windows
path: package_workspace/*

0 comments on commit 2baa7e7

Please sign in to comment.