-
Notifications
You must be signed in to change notification settings - Fork 8
205 lines (179 loc) · 5.81 KB
/
Copy pathbuild.yml
File metadata and controls
205 lines (179 loc) · 5.81 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
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
200
201
202
203
204
205
name: build
on:
workflow_dispatch:
push:
branches: [master]
tags-ignore:
- '*'
paths-ignore:
- docs/*
- .gitignore
- .gitattributes
- .clang-format
- README.md
- VERSION.txt
- release.sh
pull_request:
branches: [master]
paths-ignore:
- docs/*
- .gitignore
- .gitattributes
- .clang-format
- README.md
- VERSION.txt
- release.sh
merge_group:
jobs:
Windows-MSVC:
name: Windows-MSVC ${{ matrix.arch }}
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
arch: [ x86, x64 ]
config: [Release]
include:
- arch: x86
platform: Win32
- arch: x64
platform: x64
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Configure CMake
run: cmake -B ${{ github.workspace }}/build -DCMAKE_BUILD_TYPE=${{ matrix.config }} -G "Visual Studio 17 2022" -A ${{ matrix.platform }}
- name: Build
run: cmake --build ${{ github.workspace }}/build --config ${{ matrix.config }} --parallel
- name: Upload artifacts
uses: actions/upload-artifact@v7
with:
name: etf-artifacts-win-${{ matrix.arch }}
path: ${{ github.workspace }}/build/etf
if-no-files-found: error
retention-days: 5
Linux:
name: Linux ${{ matrix.arch }}
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
arch: [x86, x86_64]
config: [Release]
steps:
- name: Install dependencies
if: matrix.arch == 'x86'
run: |
sudo apt-get update
sudo apt-get install gcc-multilib g++-multilib
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Configure CMake
run: |
if [ ${{ matrix.arch }} == "x86" ]; then
cmake -B ${{ github.workspace }}/build -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DCMAKE_TOOLCHAIN_FILE=cmake/Toolchain-cross-x86-linux.cmake
else
cmake -B ${{ github.workspace }}/build -DCMAKE_BUILD_TYPE=${{ matrix.config }}
fi
- name: Build
run: cmake --build ${{ github.workspace }}/build --config ${{ matrix.config }} --parallel
- name: Upload artifacts
uses: actions/upload-artifact@v7
with:
name: etf-artifacts-linux-${{ matrix.arch }}
path: ${{ github.workspace }}/build/etf
if-no-files-found: error
retention-days: 5
macOS:
name: macOS ${{ matrix.arch }}
runs-on: macos-14
strategy:
fail-fast: false
matrix:
arch: [x86_64, arm64]
config: [Release]
include:
- osx-target: "10.13"
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Configure CMake
run: cmake -B ${{ github.workspace }}/build -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DCMAKE_OSX_ARCHITECTURES=${{ matrix.arch }} -DCMAKE_OSX_DEPLOYMENT_TARGET=${{ matrix.osx-target }}
- name: Build
run: cmake --build ${{ github.workspace }}/build --config ${{ matrix.config }} --parallel
- name: Upload artifacts
uses: actions/upload-artifact@v7
with:
name: etf-artifacts-macos-${{ matrix.arch }}
path: ${{ github.workspace }}/build/etf
if-no-files-found: error
retention-days: 5
macOS-universal:
name: macOS Universal Binaries
runs-on: macos-14
needs: [macOS]
steps:
- uses: actions/download-artifact@v8
with:
pattern: etf-artifacts-macos-*
path: artifacts
- name: Create universal binaries
run: |
mkdir -p build-universal
cp -R artifacts/etf-artifacts-macos-arm64/* build-universal
lipo -create artifacts/etf-artifacts-macos-x86_64/cgame_mac \
artifacts/etf-artifacts-macos-arm64/cgame_mac \
-output build-universal/cgame_mac
lipo -create artifacts/etf-artifacts-macos-x86_64/ui_mac \
artifacts/etf-artifacts-macos-arm64/ui_mac \
-output build-universal/ui_mac
lipo -create artifacts/etf-artifacts-macos-x86_64/qagame_mac \
artifacts/etf-artifacts-macos-arm64/qagame_mac \
-output build-universal/qagame_mac
- name: Upload artifacts
uses: actions/upload-artifact@v7
with:
name: etf-artifacts-macos-universal
path: ${{ github.workspace }}/build-universal
# cleanup the individual builds so package doesn't download them
- name: Cleanup
uses: geekyeggo/delete-artifact@v5
with:
name: |
etf-artifacts-macos-arm64
etf-artifacts-macos-x86_64
package:
if: github.ref == 'refs/heads/master' && github.event_name == 'push' || github.event_name == 'workflow_dispatch'
needs: [Windows-MSVC, Linux, macOS-universal]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Download artifacts
uses: actions/download-artifact@v8
with:
pattern: etf-artifacts-*
merge-multiple: true
path: ${{ github.workspace }}/build/etf
- name: Pack release zip
working-directory: ${{ github.workspace }}/build
run: |
cmake .. -DCMAKE_BUILD_TYPE=Release
make mod_release
- name: Upload release
uses: actions/upload-artifact@v7
with:
name: etf-snapshot-release
path: ${{ github.workspace }}/build/*.zip
- name: Create latest build
uses: czietz/action-automatic-releases@latest
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
automatic_release_tag: "latest"
prerelease: false
title: Latest Build
files: ${{ github.workspace }}/build/*.zip