FluentUI/.github/workflows/windows-qt5.yml

91 lines
3.0 KiB
YAML
Raw Normal View History

2023-09-13 18:12:58 +08:00
name: Windows Qt5.15.2
2023-09-13 15:26:21 +08:00
on:
push:
paths:
- '*.txt'
- 'src/**'
- 'example/**'
- 'scripts/**'
2023-10-02 21:02:06 +08:00
- '.github/workflows/windows-qt5.yml'
2023-09-13 15:26:21 +08:00
pull_request:
paths:
- '*.txt'
- 'example/**'
- 'src/**'
- 'scripts/**'
2023-10-02 21:02:06 +08:00
- '.github/workflows/windows-qt5.yml'
2023-09-13 15:26:21 +08:00
jobs:
build:
name: Build
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-2019]
include:
- qt_ver: 5.15.2
2023-09-13 17:27:09 +08:00
qt_arch: win32_msvc2019
msvc_arch: x86
qt_arch_install: msvc2019
2023-09-13 15:26:21 +08:00
env:
targetName: example.exe
fileName: example
steps:
- name: Check out repository
uses: actions/checkout@v3
with:
submodules: recursive
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: ${{ matrix.qt_ver }}
arch: ${{ matrix.qt_arch }}
cache: ${{steps.cache-qt.outputs.cache-hit}}
- name: msvc-build
id: build
shell: cmd
run: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" ${{ matrix.msvc_arch }}
mkdir build
cd build
2023-09-13 17:27:09 +08:00
cmake -DCMAKE_MESSAGE_LOG_LEVEL=STATUS -DCMAKE_PREFIX_PATH=D:\a\FluentUI\Qt\5.15.2\msvc2019 -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl -DCMAKE_BUILD_TYPE=Release -GNinja ..
2023-09-13 15:26:21 +08:00
cmake --build . --target all --config Release --parallel
echo winSdkDir=%WindowsSdkDir% >> %GITHUB_ENV%
echo winSdkVer=%WindowsSdkVersion% >> %GITHUB_ENV%
echo vcToolsInstallDir=%VCToolsInstallDir% >> %GITHUB_ENV%
echo vcToolsRedistDir=%VCToolsRedistDir% >> %GITHUB_ENV%
- name: package
id: package
env:
archiveName: ${{ env.fileName }}-${{ matrix.qt_arch }}-${{ matrix.qt_ver }}
msvcArch: ${{ matrix.msvc_arch }}
shell: pwsh
run: |
& scripts\windows-publish.ps1 ${env:archiveName} ${env:targetName}
# 记录packageName给后续step
$name = ${env:archiveName}
echo "::set-output name=packageName::$name"
- uses: actions/upload-artifact@v2
with:
name: ${{ steps.package.outputs.packageName }}
2023-09-29 17:39:45 +08:00
path: dist
2023-09-13 15:26:21 +08:00
2023-09-29 17:49:05 +08:00
- name: inno setup install
if: startsWith(github.event.ref, 'refs/tags/')
2023-10-02 21:32:10 +08:00
uses: zhuzichu520/inno-setup-action@v1.0.1
2023-09-29 17:49:05 +08:00
with:
filepath: ./action-cli/InstallerScript.iss
2023-09-13 15:26:21 +08:00
- name: uploadRelease
if: startsWith(github.event.ref, 'refs/tags/')
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
2023-09-29 17:49:05 +08:00
file: ./action-cli/installer.exe
asset_name: ${{ env.fileName }}_${{ github.ref_name }}_${{ matrix.qt_arch }}_Qt${{ matrix.qt_ver }}.exe
2023-09-13 15:26:21 +08:00
tag: ${{ github.ref }}
2023-09-29 17:49:05 +08:00
overwrite: true