-
Notifications
You must be signed in to change notification settings - Fork 0
246 lines (201 loc) · 10.9 KB
/
build.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
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
name: Build
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
BUILD_TYPE: Release
VCPKG_COMMIT: df806d3a4b8599b5429e1256a30cb0bcaf6b9178
jobs:
build-windows:
runs-on: windows-latest
env:
VCPKG_DEFAULT_BINARY_CACHE: ${{ github.workspace }}\vcpkg\binary-cache
steps:
# Compile vcpkg
- name: vcpkg cache
id: cache-vcpkg
uses: actions/cache@v3
with:
path: vcpkg
key: ${{ runner.os }}-vcpkg-${{ env.VCPKG_COMMIT }}
- uses: actions/checkout@v3
if: steps.cache-vcpkg.outputs.cache-hit != 'true'
with:
repository: Microsoft/vcpkg
path: vcpkg
ref: ${{ env.VCPKG_COMMIT }}
- name: Install vcpkg dependencies
if: steps.cache-vcpkg.outputs.cache-hit != 'true'
working-directory: ${{github.workspace}}/vcpkg
run: |
mkdir $Env:VCPKG_DEFAULT_BINARY_CACHE
.\bootstrap-vcpkg.bat
.\vcpkg.exe install sfml:x64-windows boost-algorithm:x64-windows boost-container:x64-windows boost-filesystem:x64-windows boost-heap:x64-windows freetype:x64-windows pugixml:x64-windows sdl2:x64-windows stb:x64-windows zlib:x64-windows
# Compile GF
- uses: actions/checkout@v3
with:
repository: GamedevFramework/gf
submodules: recursive
path: gf
- name: Extract gf revision
shell: bash
working-directory: ${{github.workspace}}/gf
run: echo "revision=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
id: extract-gf-revision
- name: gf cache
id: cache-gf
uses: actions/cache@v3
with:
path: gf
key: ${{ runner.os }}-gf-${{ steps.extract-gf-revision.outputs.revision }}
- name: Configure gf
if: steps.cache-gf.outputs.cache-hit != 'true'
run: cmake -DGF_USE_EMBEDDED_LIBS=OFF -DGF_BUILD_GAMES=OFF -DGF_BUILD_EXAMPLES=OFF -DGF_BUILD_DOCUMENTATION=OFF -DGF_DEBUG=OFF -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} -DCMAKE_TOOLCHAIN_FILE=${{github.workspace}}/vcpkg/scripts/buildsystems/vcpkg.cmake -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/gf/install -DCMAKE_UNITY_BUILD=ON -S ${{ github.workspace }}/gf -B ${{ github.workspace }}/gf/build
- name: Build gf
if: steps.cache-gf.outputs.cache-hit != 'true'
run: cmake --build ${{ github.workspace }}/gf/build --config ${{ env.BUILD_TYPE }} --parallel
- name: Install gf
if: steps.cache-gf.outputs.cache-hit != 'true'
run: cmake --install ${{ github.workspace }}/gf/build --config ${{ env.BUILD_TYPE }}
# Build the game
- uses: actions/checkout@v3
with:
path: ggj2023
submodules: 'true'
- name: Configure game
run: cmake -DCMAKE_UNITY_BUILD=ON -DCMAKE_PREFIX_PATH=${{ github.workspace }}/gf/install -DCMAKE_TOOLCHAIN_FILE=${{github.workspace}}/vcpkg/scripts/buildsystems/vcpkg.cmake -T host=x64 -A x64 -S ${{github.workspace}}/ggj2023/ -B ${{github.workspace}}/ggj2023/build
- name: Build game
run: cmake --build ${{github.workspace}}/ggj2023/build --config ${{env.BUILD_TYPE}} --parallel
- name: Copy dll
run: |
cp ${{github.workspace}}\vcpkg\installed\x64-windows\bin\SDL2.dll ${{github.workspace}}/ggj2023/build/${{env.BUILD_TYPE}}
cp ${{github.workspace}}\vcpkg\installed\x64-windows\bin\brotlicommon.dll ${{github.workspace}}/ggj2023/build/${{env.BUILD_TYPE}}
cp ${{github.workspace}}\vcpkg\installed\x64-windows\bin\brotlidec.dll ${{github.workspace}}/ggj2023/build/${{env.BUILD_TYPE}}
cp ${{github.workspace}}\vcpkg\installed\x64-windows\bin\bz2.dll ${{github.workspace}}/ggj2023/build/${{env.BUILD_TYPE}}
cp ${{github.workspace}}\vcpkg\installed\x64-windows\bin\freetype.dll ${{github.workspace}}/ggj2023/build/${{env.BUILD_TYPE}}
cp ${{github.workspace}}\gf\install\bin\gf0.dll ${{github.workspace}}/ggj2023/build/${{env.BUILD_TYPE}}
cp ${{github.workspace}}\gf\install\bin\gfcore0.dll ${{github.workspace}}/ggj2023/build/${{env.BUILD_TYPE}}
cp ${{github.workspace}}\vcpkg\installed\x64-windows\bin\libpng16.dll ${{github.workspace}}/ggj2023/build/${{env.BUILD_TYPE}}
cp ${{github.workspace}}\vcpkg\installed\x64-windows\bin\pugixml.dll ${{github.workspace}}/ggj2023/build/${{env.BUILD_TYPE}}
cp ${{github.workspace}}\vcpkg\installed\x64-windows\bin\zlib1.dll ${{github.workspace}}/ggj2023/build/${{env.BUILD_TYPE}}
cp ${{github.workspace}}\vcpkg\installed\x64-windows\bin\FLAC.dll ${{github.workspace}}/ggj2023/build/${{env.BUILD_TYPE}}
cp ${{github.workspace}}\vcpkg\installed\x64-windows\bin\ogg.dll ${{github.workspace}}/ggj2023/build/${{env.BUILD_TYPE}}
cp ${{github.workspace}}\vcpkg\installed\x64-windows\bin\OpenAL32.dll ${{github.workspace}}/ggj2023/build/${{env.BUILD_TYPE}}
cp ${{github.workspace}}\vcpkg\installed\x64-windows\bin\sfml-audio-2.dll ${{github.workspace}}/ggj2023/build/${{env.BUILD_TYPE}}
cp ${{github.workspace}}\vcpkg\installed\x64-windows\bin\sfml-system-2.dll ${{github.workspace}}/ggj2023/build/${{env.BUILD_TYPE}}
cp ${{github.workspace}}\vcpkg\installed\x64-windows\bin\vorbis.dll ${{github.workspace}}/ggj2023/build/${{env.BUILD_TYPE}}
cp ${{github.workspace}}\vcpkg\installed\x64-windows\bin\vorbisenc.dll ${{github.workspace}}/ggj2023/build/${{env.BUILD_TYPE}}
cp ${{github.workspace}}\vcpkg\installed\x64-windows\bin\vorbisfile.dll ${{github.workspace}}/ggj2023/build/${{env.BUILD_TYPE}}
- name: Create game
working-directory: ${{github.workspace}}/ggj2023/build
run: cpack --config CPackConfig.cmake -C ${{env.BUILD_TYPE}}
- uses: actions/upload-artifact@v3
with:
name: ggj2023-snapshot
path: ${{github.workspace}}/ggj2023/build/*.zip
if-no-files-found: error
build-linux:
runs-on: ubuntu-22.04
steps:
# Dependencies
- name: Install dependency
run: |
sudo apt update
sudo apt install -y libsdl2-dev libboost-dev libfreetype6-dev zlib1g-dev libpugixml-dev libsfml-dev
# Compile GF
- uses: actions/checkout@v3
with:
repository: GamedevFramework/gf
submodules: recursive
path: gf
- name: Extract gf revision
shell: bash
working-directory: ${{github.workspace}}/gf
run: echo "revision=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
id: extract-gf-revision
- name: gf cache
id: cache-gf
uses: actions/cache@v3
with:
path: gf
key: ${{ runner.os }}-gf-${{ steps.extract-gf-revision.outputs.revision }}
- name: Configure gf
if: steps.cache-gf.outputs.cache-hit != 'true'
run: cmake -DGF_BUILD_GAMES=OFF -DGF_BUILD_EXAMPLES=OFF -DGF_BUILD_DOCUMENTATION=OFF -DGF_DEBUG=OFF -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/gf/install -DCMAKE_UNITY_BUILD=ON -S ${{ github.workspace }}/gf -B ${{ github.workspace }}/gf/build
- name: Build gf
if: steps.cache-gf.outputs.cache-hit != 'true'
run: cmake --build ${{ github.workspace }}/gf/build --config ${{ env.BUILD_TYPE }} --parallel
- name: Install gf
if: steps.cache-gf.outputs.cache-hit != 'true'
run: cmake --install ${{ github.workspace }}/gf/build --config ${{ env.BUILD_TYPE }}
# Build the game
- uses: actions/checkout@v3
with:
path: ggj2023
submodules: 'true'
- name: Configure ggj2023
run: cmake -S ${{github.workspace}}/ggj2023/ -B ${{github.workspace}}/ggj2023/build -DCMAKE_UNITY_BUILD=ON -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_PREFIX_PATH=${{github.workspace}}/gf/install
- name: Build ggj2023
run: cmake --build ${{github.workspace}}/ggj2023/build --config ${{env.BUILD_TYPE}} --parallel
# build-macos:
# runs-on: macos-latest
# env:
# VCPKG_DEFAULT_BINARY_CACHE: ${{ github.workspace }}/vcpkg/binary-cache
# steps:
# # Compile vcpkg
# - name: vcpkg cache
# id: cache-vcpkg
# uses: actions/cache@v3
# with:
# path: vcpkg
# key: ${{ runner.os }}-vcpkg-${{ env.VCPKG_COMMIT }}
# - uses: actions/checkout@v3
# if: steps.cache-vcpkg.outputs.cache-hit != 'true'
# with:
# repository: Microsoft/vcpkg
# path: vcpkg
# ref: ${{ env.VCPKG_COMMIT }}
# - name: Install vcpkg dependencies
# if: steps.cache-vcpkg.outputs.cache-hit != 'true'
# working-directory: ${{github.workspace}}/vcpkg
# run: |
# mkdir $VCPKG_DEFAULT_BINARY_CACHE
# ./bootstrap-vcpkg.sh
# ./vcpkg install sfml:x64-osx boost-algorithm:x64-osx boost-container:x64-osx boost-filesystem:x64-osx boost-heap:x64-osx freetype:x64-osx pugixml:x64-osx sdl2:x64-osx stb:x64-osx zlib:x64-osx
# # Compile GF
# - uses: actions/checkout@v3
# with:
# repository: GamedevFramework/gf
# submodules: recursive
# path: gf
# - name: Extract gf revision
# shell: bash
# working-directory: ${{github.workspace}}/gf
# run: echo "revision=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
# id: extract-gf-revision
# - name: gf cache
# id: cache-gf
# uses: actions/cache@v3
# with:
# path: gf
# key: ${{ runner.os }}-gf-${{ steps.extract-gf-revision.outputs.revision }}
# - name: Configure gf
# if: steps.cache-gf.outputs.cache-hit != 'true'
# run: cmake -DGF_USE_EMBEDDED_LIBS=OFF -DGF_BUILD_GAMES=OFF -DGF_BUILD_EXAMPLES=OFF -DGF_BUILD_DOCUMENTATION=OFF -DGF_DEBUG=OFF -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} -DCMAKE_TOOLCHAIN_FILE=${{github.workspace}}/vcpkg/scripts/buildsystems/vcpkg.cmake -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/gf/install -DCMAKE_UNITY_BUILD=ON -G "Xcode" -S ${{ github.workspace }}/gf -B ${{ github.workspace }}/gf/build
# - name: Build gf
# if: steps.cache-gf.outputs.cache-hit != 'true'
# run: cmake --build ${{ github.workspace }}/gf/build --config ${{ env.BUILD_TYPE }} --parallel
# - name: Install gf
# if: steps.cache-gf.outputs.cache-hit != 'true'
# run: cmake --install ${{ github.workspace }}/gf/build --config ${{ env.BUILD_TYPE }}
# # ggj2023 build
# - uses: actions/checkout@v3
# with:
# path: ggj2023
# submodules: 'true'
# - name: Configure ggj2023
# run: cmake -DCMAKE_UNITY_BUILD=ON -DCMAKE_PREFIX_PATH=${{ github.workspace }}/gf/install -DCMAKE_TOOLCHAIN_FILE=${{github.workspace}}/vcpkg/scripts/buildsystems/vcpkg.cmake -S ${{github.workspace}}/ggj2023/ -B ${{github.workspace}}/ggj2023/build
# - name: Build ggj2023
# run: cmake --build ${{github.workspace}}/ggj2023/build --config ${{env.BUILD_TYPE}} --parallel