-
Notifications
You must be signed in to change notification settings - Fork 3
167 lines (142 loc) · 4.92 KB
/
build.yml
File metadata and controls
167 lines (142 loc) · 4.92 KB
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
156
157
158
159
160
161
162
163
164
165
166
167
name: Build
on:
push:
branches:
- master
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
GIT_SUBMODULE_STRATEGY: recursive
permissions:
contents: write
jobs:
build-desktop:
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-15, windows-latest]
steps:
- name: Fetch sources
uses: actions/checkout@v4
# Cache AUI boot directory
- name: Cache AUI.BOOT deps
id: cache-aui-boot
uses: actions/cache@v3
env:
cache-name: aui-boot
with:
path: ~/.aui
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/CMakeLists.txt') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install dependencies (macOS)
if: runner.os == 'macOS'
run: brew install cmake ninja
- name: Install dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install \
pkg-config \
libglew-dev \
zlib1g-dev \
libssl-dev \
libcrypt-dev \
libcurl4-openssl-dev \
libgtk-4-dev \
libadwaita-1-dev \
libdbus-1-dev \
libfontconfig-dev \
ninja-build \
libpulse-dev \
- name: Install dependencies (Windows)
if: runner.os == 'Windows'
run: choco install innosetup
- name: Setup Clang 22 (Linux)
if: runner.os == 'Linux'
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 22 all
echo "CC=clang-22" >> $GITHUB_ENV
echo "CXX=clang++-22" >> $GITHUB_ENV
- name: Setup Clang (Windows)
if: runner.os == 'Windows'
run: |
choco install llvm -y
echo "CC=clang" >> $env:GITHUB_ENV
echo "CXX=clang++" >> $env:GITHUB_ENV
- name: Configure CMake
run: cmake -G "Ninja" -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=RelWithDebInfo ${{ runner.os == 'Windows' && '-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded' || '' }} -DAUI_INSTALL_RUNTIME_DEPENDENCIES=TRUE
- name: Build Project
run: cmake --build ${{github.workspace}}/build --config RelWithDebInfo
- name: Build Tests
run: cmake --build ${{github.workspace}}/build --config RelWithDebInfo --target Tests
- name: Run Tests (Windows)
if: runner.os == 'Windows'
working-directory: ${{github.workspace}}/build/bin
run: ${{github.workspace}}/build/bin/Tests.exe
- name: Run Tests (Linux and macOS)
if: runner.os != 'Windows'
working-directory: ${{github.workspace}}/build/bin
run: ${{github.workspace}}/build/bin/Tests
- name: Pack Windows Setup
if: runner.os == 'Windows'
working-directory: ${{github.workspace}}/build
run: |
cmake . -DAUI_APP_PACKAGING=INNOSETUP
cmake --build . --config RelWithDebInfo
cpack . -CRelWithDebInfo -B artifacts
- name: Pack Portable
working-directory: ${{github.workspace}}/build
run: |
cmake . -DAUI_APP_PACKAGING=${{ runner.os == 'Linux' && 'AUI_PORTABLE_TGZ' || 'AUI_PORTABLE_ZIP' }}
cmake --build . --config RelWithDebInfo
cpack . -CRelWithDebInfo -B artifacts
- name: Upload
uses: actions/upload-artifact@v4
with:
path: ${{github.workspace}}/build/artifacts/*.*
name: ${{ runner.os }}
release-draft:
runs-on: ubuntu-latest
permissions: write-all
if: github.event_name != 'pull_request'
needs: [ build-desktop ]
name: "Release draft"
steps:
- name: Fetch sources
uses: actions/checkout@v4
- name: Extract version
run: |
VERSION=$(grep -Po '[0-9\.]+(?= # CI_PROJECT_VERSION)' CMakeLists.txt)
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "VERSION = $VERSION"
# Remove old release drafts
- name: Remove Old Release Drafts
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh api repos/{owner}/{repo}/releases \
--jq '.[] | select(.draft == true) | .id' \
| xargs -I '{}' gh api -X DELETE repos/{owner}/{repo}/releases/{}
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
merge-multiple: 'true'
- name: Create Release Draft
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create "v${{ env.VERSION }}" \
--draft \
--title "v${{ env.VERSION }}" \
--target $GITHUB_SHA \
artifacts/*.*