-
Notifications
You must be signed in to change notification settings - Fork 2
155 lines (138 loc) · 4.61 KB
/
build.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
name: Build Quasar
on:
push:
branches:
- master
paths-ignore:
- "docs/**"
- "**.md"
- "**.rst"
- "widgets/**"
- "**.js"
- "**.html"
- "**.css"
- "**.yml"
pull_request:
branches:
- master
paths-ignore:
- "docs/**"
- "**.md"
- "**.rst"
- "widgets/**"
- "**.js"
- "**.html"
- "**.css"
- "**.yml"
workflow_dispatch:
release:
types:
- published
jobs:
build:
strategy:
fail-fast: true
matrix:
builder: [windows-clang, ubuntu-gcc, ubuntu-clang]
include:
- builder: windows-clang
os: windows-latest
arch: "win64_msvc2019_64"
cc: clang-cl.exe
cxx: clang-cl.exe
g: '-G "Ninja Multi-Config"'
packages: ninja
- builder: ubuntu-gcc
os: ubuntu-latest
arch: "gcc_64"
cc: gcc-12
cxx: g++-12
g: "-G Ninja"
packages: ninja-build
- builder: ubuntu-clang
os: ubuntu-latest
arch: "gcc_64"
cc: clang-16
cxx: clang++-16
g: "-G Ninja"
packages: ninja-build
name: Build Quasar
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: "recursive"
- name: Setup Qt
uses: jurplel/install-qt-action@v3
with:
aqtversion: "==3.1.*"
version: "6.5.2"
arch: ${{ matrix.arch }}
modules: qtwebengine qtpositioning qtwebchannel qtnetworkauth qtserialport
cache: "true"
- name: Set up Packages (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y ${{ matrix.packages }}
- name: Set up Packages (Windows)
if: runner.os == 'Windows'
run: choco install ${{ matrix.packages }}
- name: Set up Clang
if: matrix.builder == 'ubuntu-clang' || matrix.builder == 'windows-clang'
uses: egor-tensin/setup-clang@v1
with:
version: 16
- name: Setup MSVC Environment (Windows)
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1
- name: Cache vcpkg
uses: lukka/run-vcpkg@v10
with:
prependedCacheKey: ${{ matrix.builder }}
vcpkgJsonGlob: "vcpkg.json"
- name: Configure Project
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
run: cmake --no-warn-unused-cli -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -S./ -B./build ${{ matrix.g }}
- name: Build Project
run: cmake --build ./build --config Release --target all --
- name: Package Quasar
if: runner.os == 'Windows'
shell: powershell
run: |
$QUASAR_VERSION = (Select-String -Path ./quasar/CMakeLists.txt -Pattern 'project\(quasar VERSION ([0-9\.]+)\)') | %{$_.Matches.Groups[1].value}
$RELEASE_PACKAGE_FILE = "quasar-windows-v$QUASAR_VERSION.zip"
7z a $RELEASE_PACKAGE_FILE ./build/quasar/Release/*
$release_filepath = Get-ChildItem $RELEASE_PACKAGE_FILE | %{$_[0].FullName}
echo "RELEASE_PACKAGE_PATH=$release_filepath" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
- name: Package Sample Widgets
if: runner.os == 'Windows' && github.event_name == 'release'
shell: powershell
run: |
$WIDGETS_PACKAGE_FILE = "quasar-sample-widgets.zip"
7z a $WIDGETS_PACKAGE_FILE ./widgets/
$widgets_filepath = Get-ChildItem $WIDGETS_PACKAGE_FILE | %{$_[0].FullName}
echo "WIDGETS_PACKAGE_FILE=$widgets_filepath" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
- name: Upload Build Artifact
if: runner.os == 'Windows'
uses: actions/upload-artifact@v3
with:
name: quasar-windows-Release
path: ${{ env.RELEASE_PACKAGE_PATH }}
if-no-files-found: error
retention-days: 1
- name: Upload Release Asset
if: runner.os == 'Windows' && github.event_name == 'release'
uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{ env.RELEASE_PACKAGE_PATH }}
- name: Upload Sample Widgets
if: runner.os == 'Windows' && github.event_name == 'release'
uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{ env.WIDGETS_PACKAGE_FILE }}