-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (64 loc) · 1.78 KB
/
main.yml
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
73
74
name: Build and Package
on:
push:
branches: [main] # 根据您的需求修改分支名称
pull_request:
branches: [main]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Qt
uses: jurplel/install-qt-action@v3
with:
version: '5.15.2' # 请替换为您的 Qt 版本
host: ${{ matrix.os }}
arch: 'gcc_64' # 对于 Linux,可以指定架构
- name: Build on Linux
if: runner.os == 'Linux'
run: |
mkdir build && cd build
qmake ../LogReager.pro
make -j$(nproc)
- name: Build on macOS
if: runner.os == 'macOS'
run: |
mkdir build && cd build
qmake ../LogReager.pro
make -j$(sysctl -n hw.logicalcpu)
- name: Build on Windows
if: runner.os == 'Windows'
shell: cmd
run: |
mkdir build && cd build
qmake ..\LogReager.pro
nmake
- name: Package on Linux
if: runner.os == 'Linux'
run: |
cd build
wget -O linuxdeployqt https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage
chmod +x linuxdeployqt
./linuxdeployqt ./LogReager -appimage
- name: Package on macOS
if: runner.os == 'macOS'
run: |
cd build
/usr/local/opt/qt/bin/macdeployqt LogReager.app
- name: Package on Windows
if: runner.os == 'Windows'
shell: cmd
run: |
cd build
windeployqt LogReager.exe
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: ${{ runner.os }}-artifact
path: |
build/**