-
Notifications
You must be signed in to change notification settings - Fork 2
305 lines (279 loc) · 11.5 KB
/
Copy pathbob.yml
File metadata and controls
305 lines (279 loc) · 11.5 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
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
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
name: Build with bob
on:
workflow_call:
inputs:
ubuntu_runner:
required: false
type: string
description: 'Which Ubuntu runner should use'
default: ubuntu-latest
macos_runner:
required: false
type: string
description: 'Which MacOS runner should use'
default: macOS-latest
windows_runner:
required: false
type: string
description: 'Which Windows runner should use'
default: windows-latest
build_server:
required: false
type: string
description: 'Build server url'
default: 'https://build-stage.defold.com'
channel:
required: false
type: string
description: 'Which Defold version use to build. Possible values: alpha, beta, stable'
default: alpha
bob_version_filename:
required: false
type: string
description: 'JSON filename withi Bob versions'
default: 'info.json'
bob_jar_url:
required: false
type: string
description: 'Direct URL to bob.jar. If set, channel and bob_version_filename are ignored.'
default: ''
additonal_build_options:
required: false
type: string
description: 'Additional options passed to build command'
default: '--archive'
additonal_bundle_options:
required: false
type: string
description: 'Additional options passed to bundle command'
ignored_platforms:
required: false
type: string
description: 'JSON-like string with list of ignored platforms' # [{"platform": "wasm_pthread-web"}, {"platform": "wasm-web"}]
default: '[]'
jobs:
build_with_bob:
strategy:
matrix:
platform: [armv7-android, arm64-android, x86_64-linux, arm64-linux, wasm-web, wasm_pthread-web]
exclude: ${{ fromJSON(inputs.ignored_platforms) }}
fail-fast: false
runs-on: ${{ inputs.ubuntu_runner }}
name: Build
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95 # v5.6.0
with:
java-version: '25'
architecture: x64
distribution: 'temurin'
- name: Get Defold version
if: ${{ inputs.bob_jar_url == '' }}
id: defold_version
run: |
TMPVAR=$(curl -s http://d.defold.com/${{ inputs.channel }}/${{ inputs.bob_version_filename }} | jq -r '.sha1')
echo "defold_version=${TMPVAR}" >> "$GITHUB_OUTPUT"
echo "Found version ${TMPVAR}"
- name: Get bob.jar cache key
id: bob_cache_key
env:
BOB_JAR_URL: ${{ inputs.bob_jar_url }}
DEFOLD_VERSION: ${{ steps.defold_version.outputs.defold_version }}
run: |
if [ -n "$BOB_JAR_URL" ]; then
URL_HASH=$(printf '%s' "$BOB_JAR_URL" | sha256sum | cut -d ' ' -f1)
echo "key=bob-jar-url-${URL_HASH}" >> "$GITHUB_OUTPUT"
else
echo "key=bob-jar-${{ inputs.channel }}-${DEFOLD_VERSION}" >> "$GITHUB_OUTPUT"
fi
- name: Restore bob.jar from cache
id: bob_cache
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: bob.jar
key: ${{ steps.bob_cache_key.outputs.key }}
enableCrossOsArchive: true
- name: Download bob.jar
if: ${{ steps.bob_cache.outputs.cache-hit != 'true' }}
env:
BOB_JAR_URL: ${{ inputs.bob_jar_url }}
DEFOLD_VERSION: ${{ steps.defold_version.outputs.defold_version }}
run: |
if [ -n "$BOB_JAR_URL" ]; then
curl -fsSL -o bob.jar "$BOB_JAR_URL"
else
curl -fsSL -o bob.jar "http://d.defold.com/archive/${{ inputs.channel }}/${DEFOLD_VERSION}/bob/bob.jar"
fi
- name: Save bob.jar to cache
if: ${{ steps.bob_cache.outputs.cache-hit != 'true' }}
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
continue-on-error: true
with:
path: bob.jar
key: ${{ steps.bob_cache_key.outputs.key }}
enableCrossOsArchive: true
- name: Print bob.jar version
run: |
java -jar bob.jar --version
- name: Installing Shared Library Dependencies
run: |
echo "Remove after we've fixed the headless build for plugins"
sudo apt-get update
sudo apt-get install -y libopenal-dev freeglut3-dev libgl-dev libglx-dev libegl-dev
- name: Resolve libraries
run: java -jar bob.jar resolve
- name: Build
run: java -jar bob.jar --platform=${{ matrix.platform }} --architectures ${{ matrix.platform }} build --build-server=${{ inputs.build_server }} ${{ inputs.additonal_build_options }}
- name: Bundle
run: java -jar bob.jar --platform=${{ matrix.platform }} --architectures ${{ matrix.platform }} bundle ${{ inputs.additonal_bundle_options }}
- name: Print build log on failure
if: failure()
run: cat build/*/log.txt 2>/dev/null || echo "No log file found"
build_with_bob_windows:
strategy:
matrix:
platform: [x86_64-win32, x86-win32]
exclude: ${{ fromJSON(inputs.ignored_platforms) }}
fail-fast: false
runs-on: ${{ inputs.windows_runner }}
name: Build
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95 # v5.6.0
with:
java-version: '25'
architecture: x64
distribution: 'temurin'
- name: Get Defold version
if: ${{ inputs.bob_jar_url == '' }}
id: defold_version
run: |
TMPVAR=$(curl -s http://d.defold.com/${{ inputs.channel }}/${{ inputs.bob_version_filename }} | jq -r '.sha1')
echo "defold_version=${TMPVAR}" >> "$GITHUB_OUTPUT"
echo "Found version ${TMPVAR}"
shell: bash
- name: Get bob.jar cache key
id: bob_cache_key
env:
BOB_JAR_URL: ${{ inputs.bob_jar_url }}
DEFOLD_VERSION: ${{ steps.defold_version.outputs.defold_version }}
run: |
if [ -n "$BOB_JAR_URL" ]; then
URL_HASH=$(printf '%s' "$BOB_JAR_URL" | sha256sum | cut -d ' ' -f1)
echo "key=bob-jar-url-${URL_HASH}" >> "$GITHUB_OUTPUT"
else
echo "key=bob-jar-${{ inputs.channel }}-${DEFOLD_VERSION}" >> "$GITHUB_OUTPUT"
fi
shell: bash
- name: Restore bob.jar from cache
id: bob_cache
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: bob.jar
key: ${{ steps.bob_cache_key.outputs.key }}
enableCrossOsArchive: true
- name: Download bob.jar
if: ${{ steps.bob_cache.outputs.cache-hit != 'true' }}
env:
BOB_JAR_URL: ${{ inputs.bob_jar_url }}
DEFOLD_VERSION: ${{ steps.defold_version.outputs.defold_version }}
run: |
if [ -n "$BOB_JAR_URL" ]; then
curl -fsSL -o bob.jar "$BOB_JAR_URL"
else
curl -fsSL -o bob.jar "http://d.defold.com/archive/${{ inputs.channel }}/${DEFOLD_VERSION}/bob/bob.jar"
fi
shell: bash
- name: Save bob.jar to cache
if: ${{ steps.bob_cache.outputs.cache-hit != 'true' }}
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
continue-on-error: true
with:
path: bob.jar
key: ${{ steps.bob_cache_key.outputs.key }}
enableCrossOsArchive: true
- name: Print bob.jar version
run: java -jar bob.jar --version
- name: Resolve libraries
run: java -jar bob.jar resolve
- name: Build
run: java -jar bob.jar --platform=${{ matrix.platform }} --architectures ${{ matrix.platform }} build --build-server=${{ inputs.build_server }} ${{ inputs.additonal_build_options }}
- name: Bundle
run: java -jar bob.jar --platform=${{ matrix.platform }} --architectures ${{ matrix.platform }} bundle ${{ inputs.additonal_bundle_options }}
- name: Print build log on failure
if: failure()
run: cat build/*/log.txt 2>/dev/null || echo "No log file found"
shell: bash
# macOS is not technically needed for building, but we want to test bundling as well, since we're also testing the manifest merging
build_with_bob_macos:
strategy:
matrix:
platform: [arm64-macos, x86_64-macos, arm64-ios]
exclude: ${{ fromJSON(inputs.ignored_platforms) }}
fail-fast: false
runs-on: ${{ inputs.macos_runner }}
name: Build
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95 # v5.6.0
with:
java-version: '25'
architecture: x64
distribution: 'temurin'
- name: Get Defold version
if: ${{ inputs.bob_jar_url == '' }}
id: defold_version
run: |
TMPVAR=$(curl -s http://d.defold.com/${{ inputs.channel }}/${{ inputs.bob_version_filename }} | jq -r '.sha1')
echo "defold_version=${TMPVAR}" >> "$GITHUB_OUTPUT"
echo "Found version ${TMPVAR}"
- name: Get bob.jar cache key
id: bob_cache_key
env:
BOB_JAR_URL: ${{ inputs.bob_jar_url }}
DEFOLD_VERSION: ${{ steps.defold_version.outputs.defold_version }}
run: |
if [ -n "$BOB_JAR_URL" ]; then
URL_HASH=$(printf '%s' "$BOB_JAR_URL" | shasum -a 256 | cut -d ' ' -f1)
echo "key=bob-jar-url-${URL_HASH}" >> "$GITHUB_OUTPUT"
else
echo "key=bob-jar-${{ inputs.channel }}-${DEFOLD_VERSION}" >> "$GITHUB_OUTPUT"
fi
- name: Restore bob.jar from cache
id: bob_cache
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: bob.jar
key: ${{ steps.bob_cache_key.outputs.key }}
enableCrossOsArchive: true
- name: Download bob.jar
if: ${{ steps.bob_cache.outputs.cache-hit != 'true' }}
env:
BOB_JAR_URL: ${{ inputs.bob_jar_url }}
DEFOLD_VERSION: ${{ steps.defold_version.outputs.defold_version }}
run: |
if [ -n "$BOB_JAR_URL" ]; then
curl -fsSL -o bob.jar "$BOB_JAR_URL"
else
curl -fsSL -o bob.jar "http://d.defold.com/archive/${{ inputs.channel }}/${DEFOLD_VERSION}/bob/bob.jar"
fi
- name: Save bob.jar to cache
if: ${{ steps.bob_cache.outputs.cache-hit != 'true' }}
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
continue-on-error: true
with:
path: bob.jar
key: ${{ steps.bob_cache_key.outputs.key }}
enableCrossOsArchive: true
- name: Print bob.jar version
run: |
java -jar bob.jar --version
- name: Resolve libraries
run: java -jar bob.jar resolve
- name: Build
run: java -jar bob.jar --platform=${{ matrix.platform }} --architectures ${{ matrix.platform }} build --build-server=${{ inputs.build_server }} ${{ inputs.additonal_build_options }}
- name: Bundle
run: java -jar bob.jar --platform=${{ matrix.platform }} --architectures ${{ matrix.platform }} bundle ${{ inputs.additonal_bundle_options }}
- name: Print build log on failure
if: failure()
run: cat build/*/log.txt 2>/dev/null || echo "No log file found"