forked from OpenXRay/xray-16
-
Notifications
You must be signed in to change notification settings - Fork 0
199 lines (165 loc) · 6.08 KB
/
cibuild.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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
name: Build
on:
push:
branches-ignore:
- "dependabot/*"
pull_request:
workflow_dispatch:
jobs:
build-windows:
name: Windows ${{ matrix.Configuration }} ${{ matrix.Platform }} (msvc)
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
Configuration: [Debug, Mixed, Release, Release Master Gold]
Platform: [x64, x86]
steps:
- uses: actions/checkout@main
with:
submodules: recursive
- uses: microsoft/setup-msbuild@main
- uses: nuget/setup-nuget@main
- name: Restore NuGet packages
run: nuget restore src\engine.sln
- name: Build
working-directory: src
run: msbuild /m /p:Configuration="${{ matrix.Configuration }}" /p:Platform="${{ matrix.Platform }}" engine.sln
- name: Prepare artifacts
shell: cmd
run: misc/windows/xr_pack_build.cmd "${{ matrix.Configuration }}" "${{ matrix.Platform }}"
- name: Upload OpenXRay artifact
uses: actions/upload-artifact@main
with:
name: OpenXRay.${{ matrix.Configuration }} ${{ matrix.Platform }} (github-${{ github.run_number }}).7z
path: res/OpenXRay.*.7z
- name: Upload Symbols
uses: actions/upload-artifact@main
with:
name: Symbols.${{ matrix.Configuration }} ${{ matrix.Platform }} (github-${{ github.run_number }}).7z
path: res/Symbols.*.7z
- name: Upload Utils
uses: actions/upload-artifact@main
with:
name: Utils.${{ matrix.Configuration }} ${{ matrix.Platform }} (github-${{ github.run_number }}).7z
path: res/Utils.*.7z
- name: Update latest-nightly tag
uses: EndBug/latest-tag@latest
if: github.ref_name == 'dev'
id: update-latest-nightly-tag
with:
ref: latest-nightly
- name: Publish latest nightly build
if: ${{ steps.update-latest-nightly-tag.outcome == 'success' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release upload --clobber latest-nightly (get-item res/*.*.7z)
build-ubuntu:
name: Ubuntu ${{ matrix.Configuration }} ${{ matrix.Platform }} (${{ matrix.CC }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
Configuration: [Debug, Release]
Platform: [x64]
CC: [gcc, clang]
include:
- CC: gcc
CXX: g++
- CC: clang
CXX: clang++
steps:
- uses: actions/checkout@main
with:
submodules: recursive
- name: Deinit Crypto++
run: git submodule deinit Externals/cryptopp
- name: Install packages
run: |
sudo apt-get update -qq
sudo apt-get install -qq -y libsdl2-dev libglew-dev liblzo2-dev libjpeg-dev &&
sudo apt-get install -qq -y libopenal-dev libogg-dev libtheora-dev libvorbis-dev
- name: Install Clang
if: ${{ matrix.CC == 'clang' }}
uses: egor-tensin/setup-clang@master
- name: Run CMake
env:
CC: ${{ matrix.CC }}
CXX: ${{ matrix.CXX }}
run: CFLAGS="-w" CXXFLAGS="-w" cmake -B build -DCMAKE_BUILD_TYPE=${{ matrix.Configuration }} -DCMAKE_UNITY_BUILD=ON
- name: Run CMake Build
id: cmake-build
env:
CC: ${{ matrix.CC }}
CXX: ${{ matrix.CXX }}
run: cmake --build build --config ${{ matrix.Configuration }} --parallel $(nproc || echo 4)
- name: Make package
if: ${{ steps.cmake-build.outcome == 'success' }}
id: make-package
working-directory: build
#continue-on-error: true
env:
CC: ${{ matrix.CC }}
CXX: ${{ matrix.CXX }}
run: |
make -j $(nproc || echo 4) package
file openxray_1.6.02_*.deb
- name: Upload OpenXRay artifact
if: ${{ steps.make-package.outcome == 'success' }}
uses: actions/upload-artifact@main
with:
name: openxray_1.6.02_${{ matrix.Configuration }}_${{ matrix.Platform }}_(github-${{ matrix.CC }}-${{ github.run_number }}).deb
path: build/openxray_1.6.02_*.deb
build-alpine:
name: Alpine ${{ matrix.Configuration }} ${{ matrix.Platform }} (gcc)
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
Configuration: [Debug, Release]
Platform: [x86_64, x86]
steps:
- uses: actions/checkout@main
with:
submodules: recursive
- name: Deinit Crypto++
run: |
git submodule deinit Externals/cryptopp
- name: Install latest stable Alpine Linux
uses: jirutka/setup-alpine@master
with:
arch: ${{ matrix.Platform }}
branch: 'latest-stable'
packages: build-base cmake mold sdl2-dev glew-dev lzo-dev libjpeg-turbo-dev openal-soft-dev libogg-dev libtheora-dev libvorbis-dev
- name: Run CMake x64
if: ${{ matrix.Platform == 'x86_64' }}
shell: alpine.sh {0}
run: CFLAGS="-w" CXXFLAGS="-w" cmake -B build -DCMAKE_BUILD_TYPE=${{ matrix.Configuration }} -DCMAKE_UNITY_BUILD=ON -DXRAY_LINKER=mold
- name: Run CMake x86
if: ${{ matrix.Platform == 'x86' }}
shell: alpine.sh {0}
run: CFLAGS="-m32 -w" CXXFLAGS="-m32 -w" cmake -B build -DCMAKE_BUILD_TYPE=${{ matrix.Configuration }} -DCMAKE_ASM_FLAGS=-m32 -DCMAKE_UNITY_BUILD=ON -DXRAY_LINKER=mold
- name: Run CMake Build
shell: alpine.sh {0}
run: cmake --build build --config ${{ matrix.Configuration }} --parallel $(nproc || echo 4)
build-macos:
name: macOS ${{ matrix.Configuration }} ${{ matrix.Platform }}
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
Configuration: [Debug, Release]
steps:
- uses: actions/checkout@main
with:
submodules: recursive
- name: Deinit Crypto++
run: git submodule deinit Externals/cryptopp
- name: Install packages
run: |
brew update
brew install sdl2 glew lzo libogg libvorbis theora
- name: Run CMake
run: CFLAGS="-w" CXXFLAGS="-w" cmake -B build -DCMAKE_BUILD_TYPE=${{ matrix.Configuration }} -DCMAKE_UNITY_BUILD=ON
- name: Run CMake Build
run: cmake --build build --config ${{ matrix.Configuration }} --parallel $(sysctl -n hw.ncpu || echo 4)