Skip to content

chore: Update build.yaml for MinGW build #80

chore: Update build.yaml for MinGW build

chore: Update build.yaml for MinGW build #80

Workflow file for this run

name: Build
on:
push:
#可以手动触发
workflow_dispatch:
jobs:
build:
runs-on: windows-latest
strategy:
matrix:
build-type: [Debug, Release]
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup Qt
uses: jurplel/install-qt-action@v4
with:
version: '6.7.2'
host: 'windows'
target: 'desktop'
arch: 'win64_mingw'
cache: true
- uses: lukka/get-cmake@latest
- name: Run CMake
run: |
#set DCMAKE_PREFIX_PATH to environment variable %QTDIR%
cmake -B build -S . -G "MinGW Makefiles" -DCMAKE_PREFIX_PATH=$env:QTDIR -DCMAKE_BUILD_TYPE=${{ matrix.build-type }}
cmake --build build --config ${{ matrix.build-type }}
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
path: build/${{ matrix.build-type }}
name: ${{ matrix.build-type }}
- name: Use windeployqt
run: |
windeployqt.exe build/${{ matrix.build-type }}/QSyncUi.exe
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
path: build/${{ matrix.build-type }}
name: ${{ matrix.build-type }}-deployed
- name: Compress artifacts
if: startsWith(github.ref, 'refs/tags/')
run: |
7z a build/${{ matrix.build-type }}.7z build/${{ matrix.build-type }}
- name: Create Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v2
with:
body_path: ext/${{github.ref_name}}-CHANGELOG
- name: Upload Release Asset
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v2
with:
files: |
build/${{ matrix.build-type }}.7z