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-04-03 21:04:41 +08:00
|
|
|
runs-on: windows-2022
|
2023-04-03 20:04:46 +08:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
include:
|
|
|
|
- qt_arch: win64_mingw
|
2023-06-06 20:45:25 +08:00
|
|
|
qt_ver: 6.5.0
|
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-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}}
|
|
|
|
modules: 'qt5compat qtmultimedia qtshadertools qtimageformats'
|
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-06-06 20:45:25 +08:00
|
|
|
cmake -DCMAKE_MESSAGE_LOG_LEVEL=STATUS -DCMAKE_PREFIX_PATH=D:\a\FluentUI\Qt\6.5.0\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
|
|
|
|
2023-04-03 20:04:46 +08:00
|
|
|
- uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: ${{ steps.package.outputs.packageName }}
|
|
|
|
path: ${{ steps.package.outputs.packageName }}
|
2023-04-27 09:38:57 +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 }}
|
|
|
|
file: ${{ steps.package.outputs.packageName }}.zip
|
2023-04-04 17:06:10 +08:00
|
|
|
asset_name: ${{ env.fileName }}_${{ github.ref_name }}_${{ matrix.qt_arch }}_Qt${{ matrix.qt_ver }}.zip
|
2023-04-03 20:04:46 +08:00
|
|
|
tag: ${{ github.ref }}
|
|
|
|
overwrite: true
|