-
Notifications
You must be signed in to change notification settings - Fork 2
129 lines (114 loc) · 4.16 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
name: Build Quasar
on:
pull_request:
branches:
- master
paths-ignore:
- "docs/**"
- "**.md"
- "**.rst"
- "widgets/**"
- "**.js"
- "**.html"
- "**.css"
- "**.yml"
workflow_dispatch:
release:
types:
- created
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: 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\Llvm\x64\bin\clang-cl.exe'
cxx: 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\Llvm\x64\bin\clang-cl.exe'
g: '-G "Visual Studio 17 2022" -T ClangCL,host=x64 -A x64'
- builder: ubuntu-gcc
os: ubuntu-latest
arch: "gcc_64"
cc: gcc-12
cxx: g++-12
g: "-G Ninja"
- builder: ubuntu-clang
os: ubuntu-latest
arch: "gcc_64"
cc: clang-16
cxx: clang++-16
g: "-G Ninja"
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.*"
py7zrversion: ">=0.20.2"
version: "6.4.3"
arch: ${{ matrix.arch }}
modules: qtwebengine qtpositioning qtwebchannel qtnetworkauth qtserialport
- name: Set up Ninja
if: runner.os == 'Linux'
run: sudo apt-get install -y ninja-build
- name: Set up Clang
if: matrix.builder == 'ubuntu-clang'
uses: egor-tensin/setup-clang@v1
with:
version: 16
- name: Cache vcpkg
uses: lukka/run-vcpkg@v10
with:
prependedCacheKey: ${{ matrix.builder }}
- 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 --
- 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"
Compress-Archive ./build/quasar/Release/* $RELEASE_PACKAGE_FILE
$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"
Compress-Archive ./widgets/ $WIDGETS_PACKAGE_FILE
$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 }}