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

105 lines
3.3 KiB
YAML
Raw Normal View History

2023-04-03 20:04:46 +08:00
name: Windows MinGW
on:
push:
paths:
2023-04-27 09:38:57 +08:00
- '*.txt'
2023-04-03 20:04:46 +08:00
- 'src/**'
2023-04-27 09:38:57 +08:00
- 'example/**'
- 'scripts/**'
2023-04-03 20:04:46 +08:00
- '.github/workflows/windows-mingw.yml'
pull_request:
paths:
2023-04-27 09:38:57 +08:00
- '*.txt'
- 'example/**'
2023-04-03 20:04:46 +08:00
- 'src/**'
2023-04-27 09:38:57 +08:00
- 'scripts/**'
- '.github/workflows/windows-mingw.yml'
2023-04-03 20:04:46 +08:00
jobs:
build:
name: Build
2023-09-22 00:40:09 +08:00
runs-on: ${{ matrix.os }}
2023-04-03 20:04:46 +08:00
strategy:
matrix:
2024-01-31 20:00:33 +08:00
os: [windows-latest]
2023-04-03 20:04:46 +08:00
include:
- qt_arch: win64_mingw
2024-02-23 12:26:10 +08:00
qt_ver: 6.6.2
2023-04-03 20:04:46 +08:00
qt_tools: "tools_mingw,9.0.0-1-202203221220,qt.tools.win64_mingw900"
qt_tools_mingw_install: mingw900_64
env:
targetName: example.exe
fileName: example
steps:
2023-04-27 09:38:57 +08:00
- name: Check out repository
uses: actions/checkout@v3
with:
submodules: recursive
2023-09-22 09:48:54 +08:00
- name: Setup ninja
uses: seanmiddleditch/gha-setup-ninja@master
with:
version: 1.10.2
2023-04-27 09:38:57 +08:00
2023-04-03 20:04:46 +08:00
- 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}}
2023-11-16 00:22:55 +08:00
modules: 'qt5compat qtmultimedia qtshadertools qtimageformats qt3d'
2023-04-27 09:38:57 +08:00
2023-04-03 21:16:07 +08:00
- name: Qt6 environment configuration
2023-04-03 20:04:46 +08:00
if: ${{ startsWith( matrix.qt_ver, 6 ) }}
shell: pwsh
run: |
Write-Output "${{ env.Qt6_DIR }}/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
Write-Output "${{ env.Qt6_DIR }}/../../Tools/${{ matrix.qt_tools_mingw_install }}/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
2023-04-27 09:38:57 +08:00
- name: where is cmake & where is mingw32-make
2023-04-03 20:04:46 +08:00
shell: pwsh
run: |
2023-04-27 09:38:57 +08:00
Get-Command -Name 'cmake' | Format-List
2023-04-03 20:04:46 +08:00
Get-Command -Name 'mingw32-make' | Format-List
2023-04-27 09:38:57 +08:00
2023-04-03 20:04:46 +08:00
- name: mingw-build
id: build
shell: cmd
run: |
2023-04-27 09:38:57 +08:00
mkdir build
cd build
2023-09-22 00:31:25 +08:00
ninja --version
2024-01-31 20:00:33 +08:00
cmake -DCMAKE_MESSAGE_LOG_LEVEL=STATUS -DCMAKE_PREFIX_PATH=D:\a\FluentUI\Qt\${{ matrix.qt_ver }}\mingw_64 -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Release -GNinja ..
2023-04-27 09:38:57 +08:00
cmake --build . --target all --config Release --parallel
2023-04-03 20:04:46 +08:00
- name: package
id: package
env:
archiveName: ${{ env.fileName }}-${{ matrix.qt_arch }}-${{ matrix.qt_ver }}
shell: pwsh
run: |
& scripts\windows-mingw-publish.ps1 ${env:archiveName} ${env:targetName}
$name = ${env:archiveName}
echo "::set-output name=packageName::$name"
2023-04-27 09:38:57 +08:00
2024-09-20 13:51:50 +08:00
- uses: actions/upload-artifact@v4
2023-04-03 20:04:46 +08:00
with:
name: ${{ steps.package.outputs.packageName }}
2023-09-29 17:39:45 +08:00
path: dist
2023-04-27 09:38:57 +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:
2024-04-17 21:39:55 +08:00
filepath: ./package/InstallerScript.iss
2023-09-29 17:49:05 +08:00
2023-04-03 20:04:46 +08:00
- name: uploadRelease
if: startsWith(github.event.ref, 'refs/tags/')
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
2024-04-17 21:39:55 +08:00
file: ./package/installer.exe
2023-09-29 17:49:05 +08:00
asset_name: ${{ env.fileName }}_${{ github.ref_name }}_${{ matrix.qt_arch }}_Qt${{ matrix.qt_ver }}.exe
2023-04-03 20:04:46 +08:00
tag: ${{ github.ref }}
2024-01-31 20:00:33 +08:00
overwrite: true