-
-
Notifications
You must be signed in to change notification settings - Fork 220
247 lines (212 loc) · 6.26 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
247
on:
release:
types: [published]
push:
branches:
- master
- 15x
- 16x
- 16x_ex
- 17x
pull_request:
branches:
- master
- 15x
- 16x
- 16x_ex
- 17x
env:
EFFEKSEER_VERSION: 180Beta1
jobs:
win_x86_build:
name: Build Windows(x86)
runs-on: windows-2019
steps:
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.8'
- uses: actions/checkout@v2
- run: |
git submodule update --init
git lfs install
git lfs pull
- uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0.x'
- name: Build
run: |
cmake -S . -B build -A Win32 -DBUILD_VIEWER=ON -D BUILD_TEST=ON -D BUILD_EXAMPLES=ON
cmake --build ./build/ --config Release
shell: cmd
tests:
name: Run Tests
runs-on: windows-2019
steps:
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.8'
architecture: 'x64'
- uses: actions/checkout@v2
- run: |
git submodule update --init
git lfs install
git lfs pull
- uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0.x'
- name: Build
run: python build.py from_ci
shell: cmd
- name: Test
run: |
cd build/Dev/Cpp/Test/Release/
TestCpp.exe
shell: cmd
- name: Upload Test
uses: actions/upload-artifact@v1
with:
name: Test
path: build/Dev/Cpp/Test/Release/
- name: Test
run: python Script/test_screenshot.py
shell: cmd
Build:
strategy:
fail-fast: true
matrix:
name: [linux,windows_x64,mac]
include:
- name: linux
os: ubuntu-20.04
label: Linux
- name: windows_x64
os: windows-2019
label: Win
- name: mac
os: macos-12
label: Mac
name: Build on ${{ matrix.name }}
runs-on: ${{ matrix.os }}
steps:
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.8'
architecture: 'x64'
- uses: actions/checkout@v2
with:
submodules: true
fetch-depth: 1
- run: |
git lfs install
git lfs pull
- name: Install Cmake for macOS (because of libpng)
if: matrix.name == 'mac'
uses: jwlawson/[email protected]
with:
cmake-version: '3.18.x'
- name: Install Linux Dependencies
if: matrix.name == 'linux'
run: |
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.asc.gpg
sudo mv microsoft.asc.gpg /etc/apt/trusted.gpg.d/
wget -q https://packages.microsoft.com/config/ubuntu/18.04/prod.list
sudo mv prod.list /etc/apt/sources.list.d/microsoft-prod.list
sudo apt-get update
sudo apt-get install -y libpulse-dev libglvnd-dev libx11-dev libopenal-dev libvulkan-dev \
libgl1-mesa-dev libgles2-mesa-dev libglu1-mesa-dev libgtk-3-dev ninja-build dotnet-sdk-3.1 \
xcb libxcb-xkb-dev x11-xkb-utils libx11-xcb-dev libxkbcommon-x11-dev zenity
- uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0.x'
- name: Build
shell: bash
run: |
if [ "${{ matrix.name }}" = "mac" ];
then
export PACKAGEING_FOR_MAC=1
sudo xcode-select --switch /Applications/Xcode_13.1.app
fi
python3 build.py || python build.py
- name: Prepare ForCpp
if: matrix.name == 'windows_x64'
run: |
release_cpp.bat
shell: cmd
- name: Prepare Windows Tool
run: |
release_tool.bat
if: matrix.name == 'windows_x64'
shell: cmd
- name: Prepare Linux Tool
run: |
bash ./release_tool.sh
if: matrix.name == 'linux'
- name: Upload ForCpp
if: matrix.name == 'windows_x64'
uses: actions/upload-artifact@v2
with:
name: EffekseerForCpp${{ env.EFFEKSEER_VERSION }}
path: EffekseerForCpp
- name: Upload ${{matrix.name}} Tool
uses: actions/upload-artifact@v2
with:
name: Effekseer${{ env.EFFEKSEER_VERSION }}${{matrix.label}}
path: EffekseerTool
Deploy:
needs: [tests,Build]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v2
with:
name: Effekseer${{ env.EFFEKSEER_VERSION }}Win
path: dist/
- uses: actions/download-artifact@v2
with:
name: Effekseer${{ env.EFFEKSEER_VERSION }}Linux
path: dist/
- uses: actions/download-artifact@v2
with:
name: EffekseerForCpp${{ env.EFFEKSEER_VERSION }}
path: dist/EffekseerForCpp
- uses: actions/download-artifact@v2
with:
name: Effekseer${{ env.EFFEKSEER_VERSION }}Mac
path: dist/
- name: Prepare Release
run: |
mkdir -p dist
mkdir -p pub
cd dist
for d in *;
do
if [ -d $d ];
then
zip -r ../pub/$d.zip $d/*
else
cp $d ../pub/
fi
done
- name: Upload Release artifact
uses: actions/upload-artifact@v2
with:
name: EffekseerReleaseAll
path: pub
- name: Deploy to Github Releases
if: github.event_name == 'release'
run: |
cd pub
releaseId=$(jq --raw-output '.release.id' ${GITHUB_EVENT_PATH})
echo "Upload to release $releaseId"
for filename in *;
do
url="https://uploads.github.com/repos/${GITHUB_REPOSITORY}/releases/$releaseId/assets?name=$(basename $filename)"
echo "Upload $filename to $url"
curl -L \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Content-Type: application/binary" \
--data-binary @"$filename" \
"$url"
done