-
Notifications
You must be signed in to change notification settings - Fork 105
189 lines (164 loc) · 5.92 KB
/
build-game.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
name: Build
on: [push, pull_request]
jobs:
build-msvc:
name: Windows
env:
BUILD_TOOLS_PATH: C:\apps\build-tools\
CONAN_USER_HOME_SHORT: None
runs-on: windows-latest
steps:
- run: echo $env:BUILD_TOOLS_PATH | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- uses: actions/checkout@v4
with:
submodules: true
- name: Cache conan
uses: actions/[email protected]
with:
key: conan-win-${{ hashFiles('conanfile.py') }}
path: ~/.conan2/
- name: Install Build tools
run: git clone https://git.anotherfoxguy.com/AnotherFoxGuy/build-tools.git %BUILD_TOOLS_PATH%
shell: cmd
- name: Enable Developer Command Prompt
uses: ilammy/[email protected]
- name: Build
run: |
conan install . -b missing -pr:b=tools/conan-profiles/vs-22-release-ninja -pr=tools/conan-profiles/vs-22-release-ninja
cmake --preset conan-release -DBUILD_TEST=ON
ninja
- name: Test
run: ctest -j2 --output-on-failure
- name: Upload build to itch.io
env:
BUTLER_API_KEY: ${{ secrets.BUTLER_API_KEY }}
if: env.BUTLER_API_KEY != null && github.ref == 'refs/heads/master'
run: |
choco install butler -y
ninja install
butler push redist cytopia/cytopia:windows-ci --userversion CIBuild-%GITHUB_RUN_NUMBER%-Commit-%GITHUB_SHA%
shell: cmd
- name: Clean Conan pkgs
run: conan cache clean "*" -sbd
build-gcc:
name: Linux
env:
CONAN_SYSREQUIRES_MODE: "enabled"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Cache conan
uses: actions/[email protected]
with:
key: conan-linux-${{ hashFiles('conanfile.py') }}
path: ~/.conan2/
- name: Install dependencies
run: |
echo -e 'pcm.!default {\n type plug\n slave.pcm "null"\n}' > ~/.asoundrc
sudo apt-get update
curl "https://raw.githubusercontent.com/AnotherFoxGuy/ci-scripts/main/install-cmake.sh" | sudo bash
curl "https://raw.githubusercontent.com/AnotherFoxGuy/ci-scripts/main/install-conan.sh" | sudo bash
sudo apt-get -y install \
ninja-build libgl-dev libegl-dev \
libx11-xcb-dev \
libfontenc-dev \
libxaw7-dev \
libxcomposite-dev \
libxcursor-dev \
libxdamage-dev \
libxfixes-dev \
libxi-dev \
libxinerama-dev \
libxmu-dev \
libxmuu-dev \
libxpm-dev \
libxrandr-dev \
libxres-dev \
libxss-dev \
libxtst-dev \
libxv-dev \
libxvmc-dev \
libxxf86vm-dev \
libxcb-render-util0-dev \
libxcb-xkb-dev \
libxcb-icccm4-dev \
libxcb-image0-dev \
libxcb-keysyms1-dev \
libxcb-randr0-dev \
libxcb-shape0-dev \
libxcb-sync-dev \
libxcb-xfixes0-dev \
libxcb-xinerama0-dev \
libxcb-util-dev \
libxcb-util0-dev \
libxcb-dri3-dev
- name: Configure
run: |
conan profile detect --force
echo "tools.system.package_manager:mode = install" > ~/.conan2/global.conf
echo "tools.system.package_manager:sudo = True" >> ~/.conan2/global.conf
conan install . -s build_type=Release -b missing -pr:b=default -c tools.cmake.cmaketoolchain:generator="Ninja"
cmake --preset conan-release
- name: Build
run: |
ninja
- name: Test
env:
SDL_VIDEODRIVER: dummy
SDL_AUDIODRIVER: dummy
run: ctest -j2 --output-on-failure
- name: Upload build to itch.io
env:
BUTLER_API_KEY: ${{ secrets.BUTLER_API_KEY }}
if: env.BUTLER_API_KEY != null && github.ref == 'refs/heads/master'
run: |
curl "https://raw.githubusercontent.com/AnotherFoxGuy/ci-scripts/main/install-butler.sh" | sudo bash
ninja install
butler push redist cytopia/cytopia:linux-ci --userversion CIBuild-${GITHUB_RUN_NUMBER}-commit-${GITHUB_SHA}
- name: Clean Conan pkgs
run: conan cache clean "*" -sbd
build-appleclang:
name: MacOS
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Cache conan
uses: actions/[email protected]
with:
key: conan-mac-${{ hashFiles('conanfile.py') }}
path: ~/.conan2/
- name: Install dependencies
run: brew install conan ninja
- name: Build
run: |
conan profile detect --force
conan install . -s build_type=Release -b missing -pr:b=default -c tools.cmake.cmaketoolchain:generator="Ninja"
cmake --preset conan-release
ninja
mkdir -p bin/Cytopia.App/Resources/resources
cp -pR data/resources bin/Cytopia.App/Contents/Resources/
cp -pR data/resources bin/resources
ninja package
rm -rf bin/Cytopia.App/Contents/MacOS/resources
rm -rf bin/Cytopia.App/Resources
shell: bash
- name: Test
run: ctest -j2 --output-on-failure
shell: bash
- name: Upload build to itch.io
env:
BUTLER_API_KEY: ${{ secrets.BUTLER_API_KEY }}
if: env.BUTLER_API_KEY != null && github.ref == 'refs/heads/master'
run: |
curl -JOL https://broth.itch.ovh/butler/darwin-amd64/LATEST/archive/default
mkdir redist
mv bin/Cytopia.app/ redist/
unzip butler-darwin-amd64.zip
./butler push redist cytopia/cytopia:osx-ci --userversion CIBuild-${GITHUB_RUN_NUMBER}-commit-${GITHUB_SHA}
shell: bash
- name: Clean Conan pkgs
run: conan cache clean "*" -sbd