@@ -2,7 +2,7 @@ name: wasm
22
33on :
44 workflow_dispatch :
5- # push:
5+ push :
66 # schedule:
77 # - cron: '*/120 8-18 * * *' # every 2 hours from 8:00 to 18:00 every day
88
@@ -22,12 +22,42 @@ jobs:
2222 - name : Check-out repository
2323 uses : actions/checkout@v4
2424
25+ # https://doc.qt.io/qt-6/wasm.html
26+ # Emsdk 3.1.50 is needed for Qt 6.7
27+ # Emsdk 3.1.56 is needed for Qt 6.8
28+ # Emsdk 3.1.70 is needed for Qt 6.9
29+ - name : Set environment variables based on selected Qt version
30+ id : set-env
31+ shell : bash
32+ run : |
33+ # Select Qt version (change this to switch version)
34+ QT_VER="6.9.0"
35+
36+ # Set matching installer and emsdk version
37+ if [[ "$QT_VER" == "6.9.0" ]]; then
38+ QT_VER_NO_DOTS="690"
39+ QT_INSTALLER_VER="4.9.0"
40+ EMSDK_VER="3.1.70"
41+ elif [[ "$QT_VER" == "6.8.2" ]]; then
42+ QT_VER_NO_DOTS="682"
43+ QT_INSTALLER_VER="4.9.0"
44+ EMSDK_VER="3.1.56"
45+ else
46+ echo "Unsupported Qt version: $QT_VER"
47+ exit 1
48+ fi
49+
50+ echo "QT_VER=$QT_VER" >> $GITHUB_ENV
51+ echo "QT_VER_NO_DOTS=$QT_VER_NO_DOTS" >> $GITHUB_ENV
52+ echo "QT_INSTALLER_VER=$QT_INSTALLER_VER" >> $GITHUB_ENV
53+ echo "EMSDK_VER=$EMSDK_VER" >> $GITHUB_ENV
54+
2555 - name : Cache emsdk
2656 id : cache-emsdk
2757 uses : actions/cache@v4
2858 with :
2959 path : ${{ github.workspace }}/emsdk
30- key : ${{ runner.os }}-emsdk
60+ key : ${{ runner.os }}-emsdk-${{ env.EMSDK_VER }}
3161
3262 - name : Install emsdk
3363 if : steps.cache-emsdk.outputs.cache-hit != 'true'
@@ -36,47 +66,47 @@ jobs:
3666 git clone https://github.com/emscripten-core/emsdk.git
3767 cd emsdk
3868 git pull
39- ./emsdk install 3.1.50 # this version is needed for Qt 6.7
40- ./emsdk activate 3.1.50
69+ ./emsdk install ${{ env.EMSDK_VER }}
70+ ./emsdk activate ${{ env.EMSDK_VER }}
4171
4272 - name : Cache Qt
4373 id : cache-qt
4474 uses : actions/cache@v4
4575 with :
4676 path : ${{ github.workspace }}/Qt
47- key : ${{ runner.os }}-qt
77+ key : ${{ runner.os }}-qt-${{ env.QT_VER }}
4878
4979 - name : Install Qt for WebAssembly
5080 if : steps.cache-qt.outputs.cache-hit != 'true'
5181 shell : bash
5282 run : |
53- curl -L -O https://download.qt.io/official_releases/online_installers/qt-unified -mac-x64-online.dmg
54- chmod u+x qt-unified -mac-x64-online.dmg
55- hdiutil attach qt-unified -mac-x64-online.dmg
56- /Volumes/qt-online-installer-macOS-x64-4.9.0 /qt-online-installer-macOS-x64-4.8.0. app/Contents/MacOS/qt-online-installer-macOS-x64-4.8.0 \
83+ curl -L -O https://download.qt.io/official_releases/online_installers/qt-online-installer -mac-x64-online.dmg
84+ chmod u+x qt-online-installer -mac-x64-online.dmg
85+ hdiutil attach qt-online-installer -mac-x64-online.dmg
86+ /Volumes/qt-online-installer-macOS-x64-${{ env.QT_INSTALLER_VER }} /qt-online-installer-macOS-x64-${{ env.QT_INSTALLER_VER }}. app/Contents/MacOS/qt-online-installer-macOS-x64-${{ env.QT_INSTALLER_VER }} \
5787 --email ${{ secrets.QT_ACCOUNT_EMAIL }} \
5888 --pw ${{ secrets.QT_ACCOUNT_PASSWORD }} \
5989 --root ${{ github.workspace }}/Qt \
6090 --accept-licenses \
6191 --accept-obligations \
6292 --default-answer \
6393 --confirm-command \
64- install qt.qt6.672. wasm_singlethread qt.qt6.672 .qt5compat
65- hdiutil detach /Volumes/qt-online-installer-macOS-x64-4.8.0
94+ install qt.qt6.${{ env.QT_VER_NO_DOTS }}. wasm_singlethread qt.qt6.${{ env.QT_VER_NO_DOTS }}.addons .qt5compat
95+ hdiutil detach /Volumes/qt-online-installer-macOS-x64-${{ env.QT_INSTALLER_VER }}
6696
6797 - name : Print some debug info
6898 shell : bash
6999 run : |
70100 source ${{ github.workspace }}/emsdk/emsdk_env.sh
71101 em++ --version
72- export PATH=$PATH:${{ github.workspace }}/Qt/6.7.2 /wasm_singlethread/bin
102+ export PATH=$PATH:${{ github.workspace }}/Qt/${{ env.QT_VER }} /wasm_singlethread/bin
73103 qmake -v
74104
75105 - name : Build WASM from BasicC++ example
76106 shell : bash
77107 run : |
78108 source ${{ github.workspace }}/emsdk/emsdk_env.sh
79- export PATH=$PATH:${{ github.workspace }}/Qt/6.7.2 /wasm_singlethread/bin
109+ export PATH=$PATH:${{ github.workspace }}/Qt/${{ env.QT_VER }} /wasm_singlethread/bin
80110 cd examples/BasicC++/src
81111 qmake BasicC++.pro -spec wasm-emscripten
82112 make -j
0 commit comments