forked from CytopiaTeam/Cytopia
-
Notifications
You must be signed in to change notification settings - Fork 0
199 lines (173 loc) · 6.29 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
190
191
192
193
194
195
196
197
198
199
name: Build game
on: [push, pull_request]
jobs:
build-msvc:
name: Build Windows
env:
SCCACHE_DIR: C:\sccache
SCCACHE_CACHE_SIZE: 500M
BUILD_TOOLS_PATH: C:\apps\build-tools\
runs-on: windows-latest
steps:
- run: echo $env:BUILD_TOOLS_PATH | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- uses: actions/[email protected]
with:
submodules: true
- name: Prepare sccache timestamp
id: sccache_cache_timestamp
shell: cmake -P {0}
run: |
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
message("::set-output name=timestamp::${current_date}")
- name: sccache cache files
uses: actions/[email protected]
with:
path: C:\sccache
key: windows-sccache-${{ steps.sccache_cache_timestamp.outputs.timestamp }}
restore-keys: |
windows-sccache-
- name: Cache vcpkg
uses: actions/[email protected]
with:
key: vcpkg-windows-${{ hashFiles('**/vcpkg.json') }}
path: C:/Users/runneradmin/AppData/Local/vcpkg/archives
restore-keys: |
vcpkg-windows-
- name: Install dependencies
run: choco install ninja sccache -y
- name: Enable Developer Command Prompt
uses: ilammy/[email protected]
- name: Build
run: |
cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake .
ninja
sccache --show-stats
- name: Test
run: ctest -VV
- 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
build-gcc:
name: Build Linux
env:
sccache_CACHE_SIZE: 500M
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
with:
submodules: true
- name: Prepare sccache timestamp
id: sccache_cache_timestamp
shell: cmake -P {0}
run: |
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
message("::set-output name=timestamp::${current_date}")
- name: sccache cache files
uses: actions/[email protected]
with:
path: ~/.cache/sccache
key: ubuntu-sccache-${{ steps.sccache_cache_timestamp.outputs.timestamp }}
restore-keys: |
ubuntu-sccache-
- name: Install dependencies
run: |
echo -e 'pcm.!default {\n type plug\n slave.pcm "null"\n}' > ~/.asoundrc
curl "https://raw.githubusercontent.com/AnotherFoxGuy/ci-scripts/main/install-cmake.sh" | sudo bash
curl "https://raw.githubusercontent.com/AnotherFoxGuy/ci-scripts/main/install-sccache.sh" | sudo bash
sudo apt-get update
sudo apt-get -y install \
ninja-build \
doxygen \
graphviz \
libsdl2-dev \
libsdl2-image-dev \
libsdl2-ttf-dev \
libnoise-dev \
libopenal-dev \
libvorbis-dev \
libpng-dev
shell: bash
- name: Build
run: |
cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DPACKAGE_MANAGER=pkgconfig -DENABLE_ANGELSCRIPT=OFF -DBUILD_TEST=ON .
ninja
sccache --show-stats
shell: bash
- name: Test
uses: GabrielBB/[email protected]
with:
run: ctest -VV
- 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}
shell: bash
build-appleclang:
name: Build Mac
env:
SCCACHE_CACHE_SIZE: 500M
runs-on: macos-latest
steps:
- uses: actions/[email protected]
with:
submodules: true
- name: Prepare sccache timestamp
id: sccache_cache_timestamp
shell: cmake -P {0}
run: |
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
message("::set-output name=timestamp::${current_date}")
- name: sccache cache files
uses: actions/[email protected]
with:
path: ~/Library/Caches/Mozilla.sccache
key: macos-sccache-${{ steps.sccache_cache_timestamp.outputs.timestamp }}
restore-keys: |
macos-sccache-
- name: Cache vcpkg
uses: actions/[email protected]
with:
key: vcpkg-macos-${{ hashFiles('**/vcpkg.json') }}
path: ~/.cache/vcpkg/archives/
restore-keys: |
vcpkg-macos-
- name: Install dependencies
run: brew install sccache ninja
shell: bash
- name: Build
run: |
cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=/usr/local/share/vcpkg/scripts/buildsystems/vcpkg.cmake .
ninja
mkdir -p bin/Cytopia.App/Resources/resources
cp -pR data/resources bin/Cytopia.App/Contents/Resources/
cp -pR data/resources bin/resources
ninja copy_resources
ninja package
rm -rf bin/Cytopia.App/Contents/MacOS/resources
rm -rf bin/Cytopia.App/Resources
sccache --show-stats
shell: bash
- name: Test
run: ctest -VV
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