Skip to content

Commit 18ed325

Browse files
committed
CI: build with Qt 6
1 parent 5d837ae commit 18ed325

File tree

3 files changed

+27
-62
lines changed

3 files changed

+27
-62
lines changed

.github/workflows/linux.yml

+11-29
Original file line numberDiff line numberDiff line change
@@ -2,60 +2,42 @@
22

33
name: Linux Package
44

5-
# Controls when the action will run.
6-
on:
7-
# Triggers the workflow on push or pull request events but only for the master branch
8-
push:
9-
branches: [ master ]
10-
pull_request:
11-
branches: [ master ]
5+
on: [push, pull_request, workflow_dispatch]
126

13-
# Allows you to run this workflow manually from the Actions tab
14-
workflow_dispatch:
15-
16-
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
177
jobs:
18-
# This workflow contains a single job called "build"
198
build:
20-
# The type of runner that the job will run on
21-
runs-on: ubuntu-22.04
22-
23-
# Steps represent a sequence of tasks that will be executed as part of the job
9+
runs-on: ubuntu-24.04
2410
steps:
2511
- name: Checkout
26-
uses: actions/checkout@v3
12+
uses: actions/checkout@v4
2713
with:
2814
submodules: recursive
29-
3015
- name: Install build dept.
3116
run: |
3217
sudo apt update
33-
sudo apt install qtbase5-dev qtmultimedia5-dev libqt5multimedia5-plugins
18+
sudo apt install cmake qt6-base-dev qt6-multimedia-dev
3419
# for linuxdeploy: https://github.com/AppImage/AppImageKit/wiki/FUSE
20+
# linuxdeploy-plugin-qt still requires qmake currently: https://github.com/linuxdeploy/linuxdeploy-plugin-qt/issues/156
3521
sudo add-apt-repository universe
36-
sudo apt install libfuse2
37-
22+
sudo apt install libfuse2 qmake6
3823
- name: Get linuxdeploy
3924
run: |
4025
wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
4126
wget https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage
4227
chmod +x linuxdeploy-*.AppImage
43-
4428
- name: Build
4529
working-directory: ./
4630
run: |
47-
mkdir build && cd build
48-
cmake ..
49-
cmake --build . -j$(nproc)
50-
cd ..
51-
31+
cmake -B build .
32+
cmake --build build -j
5233
- name: Package
34+
env:
35+
QMAKE: /usr/bin/qmake6
5336
run: |
5437
./linuxdeploy-x86_64.AppImage --appdir AppDir -e build/thplayer -d assets/thplayer.desktop -i assets/thplayer.svg --icon-filename thplayer -p qt -o appimage
5538
mv TouHou_Player*.AppImage thplayer-linux.AppImage
56-
5739
- name: Upload
58-
uses: actions/upload-artifact@v3
40+
uses: actions/upload-artifact@v4
5941
with:
6042
name: Linux-Build
6143
path: thplayer-linux.AppImage

.github/workflows/macos.yml

+8-25
Original file line numberDiff line numberDiff line change
@@ -2,53 +2,36 @@
22

33
name: macOS Package
44

5-
# Controls when the action will run.
6-
on:
7-
# Triggers the workflow on push or pull request events but only for the master branch
8-
push:
9-
branches: [ master ]
10-
pull_request:
11-
branches: [ master ]
5+
on: [push, pull_request, workflow_dispatch]
126

13-
# Allows you to run this workflow manually from the Actions tab
14-
workflow_dispatch:
15-
16-
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
177
jobs:
18-
# This workflow contains a single job called "build"
198
build:
20-
# The type of runner that the job will run on
219
runs-on: macos-latest
22-
23-
# Steps represent a sequence of tasks that will be executed as part of the job
2410
steps:
2511
- name: Checkout
26-
uses: actions/checkout@v3
12+
uses: actions/checkout@v4
2713
with:
2814
submodules: recursive
29-
3015
- name: Install Qt
3116
uses: jurplel/install-qt-action@v3
32-
17+
with:
18+
version: '6.7.0'
19+
modules: 'qtmultimedia'
3320
- name: Build
3421
working-directory: ./
3522
run: |
36-
mkdir build && cd build
37-
cmake ..
38-
cmake --build . -j$(nproc)
39-
cd ..
40-
23+
cmake -B build .
24+
cmake --build build -j
4125
- name: Package
4226
id: package
4327
working-directory: ./
4428
continue-on-error: true
4529
run: |
4630
macdeployqt build/thplayer.app
4731
zip -r9 --symlinks thplayer-macos.zip thplayer.app
48-
4932
- name: Upload
5033
if: steps.package.conclusion == 'success'
51-
uses: actions/upload-artifact@v3
34+
uses: actions/upload-artifact@v4
5235
with:
5336
name: macOS-Build
5437
path: thplayer-macos.zip

.github/workflows/windows-msys2.yml

+8-8
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
run:
99
shell: msys2 {0}
1010
steps:
11-
- uses: actions/checkout@v3
11+
- uses: actions/checkout@v4
1212
with:
1313
submodules: recursive
1414
- uses: msys2/setup-msys2@v2
@@ -17,26 +17,26 @@ jobs:
1717
update: true
1818
pacboy: >-
1919
toolchain:p ninja:p cmake:p extra-cmake-modules:p icoutils:p
20-
qt5-static:p bison: flex:
20+
qt6:p bison: flex:
2121
- name: Build
2222
run: |
23-
mkdir build && cd build
24-
cmake .. -DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX} -DCMAKE_PREFIX_PATH="${MINGW_PREFIX}/qt5-static" -G Ninja
25-
cmake --build . -j
26-
cd ..
23+
# for static build we will need -DCMAKE_PREFIX_PATH="${MINGW_PREFIX}/qt6-static"
24+
# but MSYS2's static Qt 6 is problematic currently: https://github.com/msys2/MINGW-packages/issues/18966
25+
cmake . -B build -DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX} -G Ninja
26+
cmake --build build -j
2727
- name: Prepare for package
2828
continue-on-error: true
2929
run: |
3030
mkdir package_workspace && cd package_workspace
3131
cp ../build/thplayer.exe ./
3232
strip -s ./thplayer.exe
33-
# windeployqt -winextras --no-quick-import --no-translations --no-opengl-sw --no-angle --no-system-d3d-compiler ./thplayer.exe
33+
windeployqt --no-quick-import --no-translations --no-opengl-sw --no-system-d3d-compiler ./thplayer.exe
3434
ldd ./thplayer.exe > deps.txt
3535
bash -c 'while read -r line; do path=$(cut -d" " -f3 <<<$line); cp -v $path ./; done <<<$(grep ".*mingw.*bin" deps.txt); exit 0'
3636
rm deps.txt
3737
# done
3838
cd ../
39-
- uses: actions/upload-artifact@v3
39+
- uses: actions/upload-artifact@v4
4040
with:
4141
name: msys2-mingw-w64-x86_64-windows
4242
path: package_workspace/*

0 commit comments

Comments
 (0)