Repository navigation
140 lines (115 loc) · 3.42 KB
/
Copy pathbuild.yml
File metadata and controls
140 lines (115 loc) · 3.42 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
name: Build Cossacks-CE
on:
push:
branches: [ dev, main ]
pull_request:
branches: [ dev, main ]
jobs:
# Windows MSVC build (native)
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Setup MSVC
uses: microsoft/setup-msbuild@v2
- name: Install vcpkg
run: |
git clone https://github.com/microsoft/vcpkg.git
.\vcpkg\bootstrap-vcpkg.bat
.\vcpkg\vcpkg integrate install
- name: Install dependencies
run: |
.\vcpkg\vcpkg install sdl3:x86-windows sdl3-image:x86-windows boost:x86-windows
- name: Configure CMake
run: |
cmake -B build -A Win32 `
-DCMAKE_TOOLCHAIN_FILE="${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake" `
-DVCPKG_TARGET_TRIPLET=x86-windows `
-DCOSSACKS_BUILD_TESTING=OFF
- name: Build
run: cmake --build build --config Release
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: cossacks-windows
path: |
build/bin/Release/dmcr.exe
build/bin/Release/*.dll
# WebAssembly build (Emscripten)
build-wasm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Emscripten
uses: mymindstorm/setup-emsdk@v14
with:
version: '3.1.50'
- name: Verify Emscripten
run: |
emcc --version
em++ --version
- name: Configure CMake (Emscripten)
run: |
emcmake cmake -B build-wasm \
-DCMAKE_BUILD_TYPE=Release \
-DCOSSACKS_BUILD_TESTING=OFF \
-DCOSSACKS_USE_WASM_SIMD=OFF
- name: Build WebAssembly
run: cmake --build build-wasm --config Release
- name: Prepare web files
run: |
mkdir -p dist
cp build-wasm/bin/dmcr.* dist/
cp web/shell.html dist/index.html || true
- name: Upload WebAssembly artifacts
uses: actions/upload-artifact@v4
with:
name: cossacks-wasm
path: dist/
# Linux build (for development/testing)
build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
cmake \
ninja-build \
libsdl3-dev \
libboost-dev
- name: Configure CMake
run: |
cmake -B build -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCOSSACKS_BUILD_TESTING=OFF \
-DCOSSACKS_STATIC_AI=ON
- name: Build
run: cmake --build build
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: cossacks-linux
path: build/bin/dmcr
# macOS build
build-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
brew install cmake ninja sdl3 boost
- name: Configure CMake
run: |
cmake -B build -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCOSSACKS_BUILD_TESTING=OFF \
-DCOSSACKS_STATIC_AI=ON
- name: Build
run: cmake --build build
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: cossacks-macos
path: build/bin/dmcr