forked from Libre-TrainSim/Libre-TrainSim
-
Notifications
You must be signed in to change notification settings - Fork 1
266 lines (214 loc) · 9.96 KB
/
Copy pathexport.yml
File metadata and controls
266 lines (214 loc) · 9.96 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
name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
concurrency:
group: ci-${{github.ref}}-test
cancel-in-progress: true
env:
GODOT_VERSION: 3.5.2
EXPORT_NAME: Libre_TrainSim
jobs:
export-windows:
if: false # Disabled because @HaSa can't wrap his head around Godot not wanting to properly start and terminate.
name: Windows Exports
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Load Import Folder
uses: actions/cache/restore@v3
with:
path: src/.import
enableCrossOsArchive: true
key: Import-Windows-${{hashFiles('src/.import')}}
restore-keys: |
Import-Windows-${{hashFiles('src/.import')}}
Import-Windows-
Import-
- name: Download Godot
run: Invoke-WebRequest -o ../Godot_v${{env.GODOT_VERSION}}-stable_win64.exe.zip https://github.com/godotengine/godot/releases/download/${{env.GODOT_VERSION}}-stable/Godot_v${{env.GODOT_VERSION}}-stable_win64.exe.zip
- name: Extract Godot
run: 7z e ../Godot_v${{env.GODOT_VERSION}}-stable_win64.exe.zip -o".."
- name: Create Export Template Directory
run: mkdir "$env:appdata/godot/templates/"
- name: Get Export Templates from Cache
id: export-templates-cache
uses: actions/cache@v3
with:
path: ../Godot_v${{env.GODOT_VERSION}}-stable_export_templates.tpz
key: Godot_v${{env.GODOT_VERSION}}-stable_export_templates.tpz
- name: Download Godot Release Templates
if: steps.export-templates-cache.outputs.cache-hit != 'true'
run: Invoke-WebRequest -o ../Godot_v${{env.GODOT_VERSION}}-stable_export_templates.tpz https://github.com/godotengine/godot/releases/download/${{env.GODOT_VERSION}}-stable/Godot_v${{env.GODOT_VERSION}}-stable_export_templates.tpz
- name: Extract and Install Templates
run: |
7z e ../Godot_v${{env.GODOT_VERSION}}-stable_export_templates.tpz -o"$env:appdata/godot/templates/${{env.GODOT_VERSION}}.stable"
dir "$env:appdata/godot/templates/${{env.GODOT_VERSION}}.stable"
- name: Create Build Folders
run: |
mkdir build/windows
mkdir build/windows-debug
# Export for Windows Release
- name: Export Windows Release
shell: bash
run: ../Godot_v${{env.GODOT_VERSION}}-stable_win64.exe src/project.godot -v --export "Windows Desktop" ../build/windows/${EXPORT_NAME}.exe
- name: Upload Windows Release
uses: actions/upload-artifact@v3
with:
name: windows
path: build/windows
# Export for Windows Debug
- name: Export Windows Debug
run: Start-Process ../Godot_v${{env.GODOT_VERSION}}-stable_win64.exe -ArgumentList 'src/project.godot -v --export-debug "Windows Desktop" ../build/windows-debug/${EXPORT_NAME}_debug.exe' -Wait -NoNewWindow -PassThru
- name: Upload Windows Debug
uses: actions/upload-artifact@v3
with:
name: windows-debug
path: build/linux-windows
- name: Store Import Folder
uses: actions/cache/save@v3
with:
path: src/.import
enableCrossOsArchive: true
key: Import-Windows-${{hashFiles('src/.import')}}
export-linux:
# On Linux the import cache is just partially loaded for some weird reason. Probably due the headless build.
name: Linux Exports
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Load Import Folder
uses: actions/cache/restore@v3
with:
path: src/.import
enableCrossOsArchive: true
key: Import-Linux-${{hashFiles('src/.import')}}
restore-keys: |
Import-Linux-${{hashFiles('src/.import')}}
Import-Linux-
Import-
- name: Download Godot
run: curl -L -o ../Godot_v${{env.GODOT_VERSION}}-stable_linux_headless.64.zip https://github.com/godotengine/godot/releases/download/${{env.GODOT_VERSION}}-stable/Godot_v${{env.GODOT_VERSION}}-stable_linux_headless.64.zip
- name: Extract Godot
run: |
unzip -d .. ../Godot_v${{env.GODOT_VERSION}}-stable_linux_headless.64.zip
ls -la ..
- name: Create Export Template Directory
run: mkdir -v -p "${HOME}/.local/share/godot/templates/${{env.GODOT_VERSION}}.stable"
- name: Download Godot Release Templates
run: curl -L -o ../Godot_v${{env.GODOT_VERSION}}-stable_export_templates.tpz https://github.com/godotengine/godot/releases/download/${{env.GODOT_VERSION}}-stable/Godot_v${{env.GODOT_VERSION}}-stable_export_templates.tpz
- name: Extract and Install Templates
run: |
unzip -j -d "${HOME}/.local/share/godot/templates/${{env.GODOT_VERSION}}.stable" ../Godot_v${{env.GODOT_VERSION}}-stable_export_templates.tpz
ls -la "${HOME}/.local/share/godot/templates/${{env.GODOT_VERSION}}.stable"
- name: Create Build Folders
run: |
mkdir -v -p build/linux
mkdir -v -p build/linux-debug
- name: Export Linux Release
run: ../Godot_v${{env.GODOT_VERSION}}-stable_linux_headless.64 src/project.godot -v --export "Linux64" ../build/linux/${EXPORT_NAME}.x86_64
- name: Upload Linux Release
uses: actions/upload-artifact@v3
with:
name: linux
path: build/linux
- name: Export Linux Debug
run: ../Godot_v${{env.GODOT_VERSION}}-stable_linux_headless.64 src/project.godot -v --export-debug "Linux64" ../build/linux-debug/${EXPORT_NAME}_debug.x86_64
- name: Upload Linux Debug
uses: actions/upload-artifact@v3
with:
name: linux-debug
path: build/linux-debug
- name: Store Import Folder
uses: actions/cache/save@v3
with:
path: src/.import
enableCrossOsArchive: true
key: Import-Linux-${{hashFiles('src/.import')}}
export-mac:
# Yes, macOS has the most stable support... Contrary to linux, the caching works, we can do adhoc-notarisation, and it's faster
name: Mac and Windows Exports
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Load Import Folder
uses: actions/cache/restore@v3
with:
path: src/.import
enableCrossOsArchive: true
key: Import-Mac-${{hashFiles('src/.import')}}
restore-keys: |
Import-Mac-${{hashFiles('src/.import')}}
Import-Mac-
Import-
- name: Download Godot
run: curl -L -o ../Godot_v${{env.GODOT_VERSION}}-stable_osx.universal.zip https://github.com/godotengine/godot/releases/download/${{env.GODOT_VERSION}}-stable/Godot_v${{env.GODOT_VERSION}}-stable_osx.universal.zip
- name: Extract Godot
run: unzip -d .. ../Godot_v${{env.GODOT_VERSION}}-stable_osx.universal.zip
- name: Create Export Template Directory
run: mkdir -v -p "${HOME}/Library/Application Support/Godot/templates/${{env.GODOT_VERSION}}.stable"
- name: Get Export Templates from Cache
id: export-templates-cache
uses: actions/cache@v3
with:
path: ../Godot_v${{env.GODOT_VERSION}}-stable_export_templates.tpz
key: Godot_v${{env.GODOT_VERSION}}-stable_export_templates.tpz
- name: Download Godot Release Templates
if: steps.export-templates-cache.outputs.cache-hit != 'true'
run: curl -L -o ../Godot_v${{env.GODOT_VERSION}}-stable_export_templates.tpz https://github.com/godotengine/godot/releases/download/${{env.GODOT_VERSION}}-stable/Godot_v${{env.GODOT_VERSION}}-stable_export_templates.tpz
- name: Extract and Install Templates
run: |
unzip -j -d "${HOME}/Library/Application Support/Godot/templates/${{env.GODOT_VERSION}}.stable" ../Godot_v${{env.GODOT_VERSION}}-stable_export_templates.tpz
ls -la "${HOME}/Library/Application Support/Godot/templates/${{env.GODOT_VERSION}}.stable"
- name: Create Build Folders
run: |
mkdir -v -p build/mac
mkdir -v -p build/mac-debug
mkdir -v -p build/windows
mkdir -v -p build/windows-debug
- name: Export MacOS Release
run: ../Godot.app/Contents/MacOS/Godot src/project.godot -v --export "Mac OSX" ../build/mac/$EXPORT_NAME.zip
- name: Upload MacOS Release
uses: actions/upload-artifact@v3
with:
name: mac
path: build/mac
- name: Export MacOS Debug
run: ../Godot.app/Contents/MacOS/Godot src/project.godot -v --export-debug "Mac OSX" ../build/mac-debug/${EXPORT_NAME}_debug.zip
- name: Upload MacOS Debug
uses: actions/upload-artifact@v3
with:
name: mac-debug
path: build/mac-debug
- name: Export Windows Release
run: ../Godot.app/Contents/MacOS/Godot src/project.godot -v --export "Windows Desktop" ../build/windows/$EXPORT_NAME.exe
- name: Upload Windows Release
uses: actions/upload-artifact@v3
with:
name: windows
path: build/windows
- name: Export Windows Debug
run: ../Godot.app/Contents/MacOS/Godot src/project.godot -v --export-debug "Windows Desktop" ../build/windows-debug/${EXPORT_NAME}_debug.exe
- name: Upload Windows Debug
uses: actions/upload-artifact@v3
with:
name: windows-debug
path: build/windows-debug
- name: Store Import Folder
uses: actions/cache/save@v3
with:
path: src/.import
enableCrossOsArchive: true
key: Import-Mac-${{hashFiles('src/.import')}}
# Add Android (https://github.com/abarichello/godot-ci/blob/master/.gitlab-ci.yml#L63-L99)