use qt action

This commit is contained in:
rzlamrr
2026-03-16 09:43:07 +07:00
parent 3ef714e61f
commit 0ba4717252
+10 -28
View File
@@ -8,7 +8,6 @@ on:
env: env:
QT_VERSION: '6.5.3' QT_VERSION: '6.5.3'
QT_ARCH: 'win64_msvc2019_64' QT_ARCH: 'win64_msvc2019_64'
QT_INSTALL_DIR: 'C:\Qt'
jobs: jobs:
build: build:
@@ -39,30 +38,16 @@ jobs:
with: with:
arch: amd64 arch: amd64
# ── 2. Install Qt via aqtinstall ────────────────────────────────────── # ── 2. Install Qt ────────────────────────────────────────────────────
- name: Cache Qt installation - name: Install Qt
id: qt-cache uses: jurplel/install-qt-action@v4
uses: actions/cache@v4
with: with:
path: ${{ env.QT_INSTALL_DIR }} version: ${{ env.QT_VERSION }}
key: qt-${{ env.QT_VERSION }}-${{ env.QT_ARCH }}-all host: 'windows'
target: 'desktop'
- name: Install Qt via aqtinstall arch: ${{ env.QT_ARCH }}
if: steps.qt-cache.outputs.cache-hit != 'true' modules: 'qtserialport qt5compat'
run: | cache: true
pip install aqtinstall
aqt install-qt windows desktop ${{ env.QT_VERSION }} ${{ env.QT_ARCH }} `
-m all `
--outputdir ${{ env.QT_INSTALL_DIR }}
shell: pwsh
- name: Set Qt environment variables
run: |
$QtPath = "${{ env.QT_INSTALL_DIR }}\${{ env.QT_VERSION }}\msvc2019_64"
echo "Qt6_DIR=$QtPath" >> $env:GITHUB_ENV
echo "$QtPath\bin" >> $env:GITHUB_PATH
echo "CMAKE_PREFIX_PATH=$QtPath" >> $env:GITHUB_ENV
shell: pwsh
# ── 3. Cache built dependencies ────────────────────────────────────── # ── 3. Cache built dependencies ──────────────────────────────────────
- name: Cache dependencies - name: Cache dependencies
@@ -144,11 +129,9 @@ jobs:
working-directory: quazip-1.4 working-directory: quazip-1.4
run: | run: |
$ZlibRoot = "$env:GITHUB_WORKSPACE\zlib" $ZlibRoot = "$env:GITHUB_WORKSPACE\zlib"
$QtPath = "${{ env.QT_INSTALL_DIR }}\${{ env.QT_VERSION }}\msvc2019_64"
New-Item -ItemType Directory -Force -Path build New-Item -ItemType Directory -Force -Path build
Push-Location build Push-Location build
cmake -G "NMake Makefiles" ` cmake -G "NMake Makefiles" `
-DCMAKE_PREFIX_PATH="$QtPath" `
-DZLIB_LIBRARY="$ZlibRoot\build\zlibstatic.lib" ` -DZLIB_LIBRARY="$ZlibRoot\build\zlibstatic.lib" `
-DZLIB_INCLUDE_DIR="$ZlibRoot" ` -DZLIB_INCLUDE_DIR="$ZlibRoot" `
-DCMAKE_BUILD_TYPE=Release .. -DCMAKE_BUILD_TYPE=Release ..
@@ -271,7 +254,6 @@ jobs:
- name: Configure Fritzing (qmake) - name: Configure Fritzing (qmake)
working-directory: fritzing-app working-directory: fritzing-app
run: | run: |
$QtPath = "${{ env.QT_INSTALL_DIR }}\${{ env.QT_VERSION }}\msvc2019_64"
$ZlibLib = "$env:GITHUB_WORKSPACE\zlib\build" $ZlibLib = "$env:GITHUB_WORKSPACE\zlib\build"
# Static libgit2 needs its transitive deps linked into the final executable: # Static libgit2 needs its transitive deps linked into the final executable:
# zlibstatic – zlib symbols (deflate, inflate, crc32 …) # zlibstatic – zlib symbols (deflate, inflate, crc32 …)
@@ -280,7 +262,7 @@ jobs:
# crypt32 – certificate APIs # crypt32 – certificate APIs
# ole32 – COM (CoInitializeEx …) # ole32 – COM (CoInitializeEx …)
# rpcrt4 – UuidCreate # rpcrt4 – UuidCreate
& "$QtPath\bin\qmake.exe" phoenix.pro ` qmake phoenix.pro `
"LIBS+=-L$ZlibLib -lzlibstatic -ladvapi32 -lwinhttp -lcrypt32 -lole32 -lrpcrt4" "LIBS+=-L$ZlibLib -lzlibstatic -ladvapi32 -lwinhttp -lcrypt32 -lole32 -lrpcrt4"
shell: pwsh shell: pwsh