-
Notifications
You must be signed in to change notification settings - Fork 0
159 lines (133 loc) · 4.85 KB
/
multi-platform.yml
File metadata and controls
159 lines (133 loc) · 4.85 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
name: Build AetherEngine
on:
push:
branches:
- "**"
pull_request:
jobs:
build:
name: ${{ matrix.os }} / ${{ matrix.cmake_preset }}
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
- os: Windows
runner: windows-latest
cmake_preset: debug
- os: Windows
runner: windows-latest
cmake_preset: debug-verbose
- os: Windows
runner: windows-latest
cmake_preset: release
artifact_name: windows
- os: Windows
runner: windows-latest
cmake_preset: debug-mingw
use_mingw: true
- os: Windows
runner: windows-latest
cmake_preset: debug-verbose-mingw
use_mingw: true
- os: Windows
runner: windows-latest
cmake_preset: release-mingw
use_mingw: true
- os: Linux
runner: ubuntu-latest
cmake_preset: debug
- os: Linux
runner: ubuntu-latest
cmake_preset: debug-verbose
- os: Linux
runner: ubuntu-latest
cmake_preset: release
artifact_name: linux-ubuntu
- os: macOS
runner: macos-latest
cmake_preset: debug
- os: macOS
runner: macos-latest
cmake_preset: debug-verbose
- os: macOS
runner: macos-latest
cmake_preset: release
artifact_name: macos
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Extract version
id: version
shell: bash
run: |
VERSION=$(python3 -c "
import re
with open('cmake/version.cmake', 'r') as f:
content = f.read()
major = re.search(r'set\(AETHER_VERSION_MAJOR\s+(\d+)', content).group(1)
minor = re.search(r'set\(AETHER_VERSION_MINOR\s+(\d+)', content).group(1)
patch = re.search(r'set\(AETHER_VERSION_PATCH\s+(\d+)', content).group(1)
print(f'{major}.{minor}.{patch}')
")
echo "version=${VERSION}" >> $GITHUB_OUTPUT
- name: Extract git hash
id: git
shell: bash
run: |
echo "short_sha=${GITHUB_SHA::7}" >> $GITHUB_OUTPUT
- name: Setup Ninja
uses: seanmiddleditch/gha-setup-ninja@v5
# MSVC setup (Windows, non-MinGW)
- name: Setup MSVC (Windows MSVC builds)
if: runner.os == 'Windows' && !matrix.use_mingw
uses: ilammy/msvc-dev-cmd@v1
# MSYS2 setup (Windows MinGW builds)
- name: Setup MSYS2 (Windows MinGW builds)
if: runner.os == 'Windows' && matrix.use_mingw
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
install: mingw-w64-x86_64-toolchain mingw-w64-x86_64-cmake mingw-w64-x86_64-ninja
update: true
# Linux dependencies
- name: Install dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt update
sudo apt install -y \
libx11-dev \
libxrandr-dev \
libxinerama-dev \
libxcursor-dev \
libxi-dev \
libgl1-mesa-dev
# ------------------------------------------------------------
# General builds (MSVC on Windows, default compilers on Linux/macOS)
# ------------------------------------------------------------
- name: Configure CMake (General)
if: runner.os != 'Windows' || !matrix.use_mingw
run: cmake --preset ${{ matrix.cmake_preset }}
- name: Build (General)
if: runner.os != 'Windows' || !matrix.use_mingw
run: cmake --build --preset ${{ matrix.cmake_preset }}
# ------------------------------------------------------------
# MinGW builds on Windows (use MSYS2 shell)
# ------------------------------------------------------------
- name: Configure CMake (MinGW)
if: runner.os == 'Windows' && matrix.use_mingw
shell: msys2 {0}
run: cmake --preset ${{ matrix.cmake_preset }}
- name: Build (MinGW)
if: runner.os == 'Windows' && matrix.use_mingw
shell: msys2 {0}
run: cmake --build --preset ${{ matrix.cmake_preset }}
# ------------------------------------------------------------
# Upload artifact (only for release builds, excluding MinGW)
# ------------------------------------------------------------
- name: Upload artifact
if: contains(matrix.cmake_preset, 'release') && !matrix.use_mingw
uses: actions/upload-artifact@v4
with:
name: aether${{ steps.git.outputs.short_sha }}-${{ steps.version.outputs.version }}-${{ matrix.artifact_name }}
path: build/${{ matrix.cmake_preset }}/bin