-
Notifications
You must be signed in to change notification settings - Fork 1
72 lines (58 loc) · 1.87 KB
/
build.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
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