This repository was archived by the owner on Dec 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 38
208 lines (178 loc) · 8.61 KB
/
linux.yml
File metadata and controls
208 lines (178 loc) · 8.61 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
name: 🐧 Linux
on:
workflow_call:
inputs:
fullbuild:
description: "Weather or not to build all targets"
required: true
type: boolean
default: false
godot_version:
description: "Version of godot to be used"
required: true
type: string
env:
BASE_BRANCH: main
SCONSFLAGS: "production=yes extra_suffix=luaAPI"
SCONS_CACHE_LIMIT: 7168
GODOT_VERSION: ${{ inputs.godot_version }}-stable
jobs:
linux-builds:
runs-on: "ubuntu-20.04"
name: ${{ matrix.opts.name }}
strategy:
fail-fast: false
matrix:
opts:
- name: Linux Editor (target=editor)
cache-name: linux-editor
artifact-name: linux-editor
build-options: "target=editor arch=x86_64"
should-run: true
- name: Linux Editor LuaJIT (target=editor,luaapi_luaver=jit)
cache-name: linux-editor-luajit
artifact-name: linux-editor-luajit
build-options: "target=editor luaapi_luaver=jit arch=x86_64"
should-run: true
- name: Linux Template (target=template_release,arch=x86_64)
cache-name: linux-template
artifact-name: export-templates
build-options: "target=template_release arch=x86_64"
should-run: ${{ inputs.fullbuild }}
- name: Linux Template Debug (target=template_debug,arch=x86_64)
cache-name: linux-template-debug
artifact-name: export-templates
build-options: "target=template_debug arch=x86_64"
should-run: ${{ inputs.fullbuild }}
- name: Linux Template (target=template_release,arch=x86_32)
cache-name: linux-template
artifact-name: export-templates
build-options: "target=template_release arch=x86_32"
should-run: ${{ inputs.fullbuild }}
- name: Linux Template Debug (target=template_debug,arch=x86_32)
cache-name: linux-template-debug
artifact-name: export-templates
build-options: "target=template_debug arch=x86_32"
should-run: ${{ inputs.fullbuild }}
- name: Linux Editor Mono (target=editor,module_mono_enabled=yes)
cache-name: linux-editor-mono
artifact-name: linux-editor-mono
build-options: "target=editor module_mono_enabled=yes arch=x86_64"
should-run: true # Verify mono builds
- name: Linux Template Mono (target=template_release,module_mono_enabled=yes,arch=x86_64)
cache-name: linux-template-mono
artifact-name: export-templates-mono
build-options: "target=template_release module_mono_enabled=yes arch=x86_64"
should-run: ${{ inputs.fullbuild }}
- name: Linux Template Debug Mono (target=template_debug,module_mono_enabled=yes,arch=x86_64)
cache-name: linux-template-debug-mono
artifact-name: export-templates-mono
build-options: "target=template_debug module_mono_enabled=yes arch=x86_64"
should-run: ${{ inputs.fullbuild }}
- name: Linux Template Mono (target=template_release,module_mono_enabled=yes,arch=x86_32)
cache-name: linux-template-mono
artifact-name: export-templates-mono
build-options: "target=template_release module_mono_enabled=yes arch=x86_32"
should-run: ${{ inputs.fullbuild }}
- name: Linux Template Debug Mono (target=template_debug,module_mono_enabled=yes,arch=x86_32)
cache-name: linux-template-debug-mono
artifact-name: export-templates-mono
build-options: "target=template_debug module_mono_enabled=yes arch=x86_32"
should-run: ${{ inputs.fullbuild }}
exclude:
- {opts: {should-run: false}}
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: (Linux) Install buildroot x86_64
if: ${{ !contains(matrix.opts.build-options, 'x86_32') }}
shell: sh
run: |
sudo apt-get update
sudo apt-get install yasm
cd /opt
curl -LO https://downloads.tuxfamily.org/godotengine/toolchains/linux/2021-02-11/x86_64-godot-linux-gnu_sdk-buildroot.tar.bz2
tar xf x86_64-godot-linux-gnu_sdk-buildroot.tar.bz2
rm -f x86_64-godot-linux-gnu_sdk-buildroot.tar.bz2
mv x86_64-godot-linux-gnu_sdk-buildroot buildroot
cd buildroot
./relocate-sdk.sh
- name: (Linux) Install buildroot x86_32
if: ${{ contains(matrix.opts.build-options, 'x86_32') }}
shell: sh
run: |
sudo apt-get update
sudo apt-get install yasm
cd /opt
curl -LO https://downloads.tuxfamily.org/godotengine/toolchains/linux/2021-02-11/i686-godot-linux-gnu_sdk-buildroot.tar.bz2
tar xf i686-godot-linux-gnu_sdk-buildroot.tar.bz2
rm -f i686-godot-linux-gnu_sdk-buildroot.tar.bz2
mv i686-godot-linux-gnu_sdk-buildroot buildroot
cd buildroot
./relocate-sdk.sh
- name: Install .NET SDK 6.0 (Mono)
if: ${{ contains(matrix.opts.build-options, 'module_mono_enabled=yes') }}
uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0.x'
- name: Load .scons_cache directory
uses: actions/cache@v2
with:
path: ${{github.workspace}}/.scons_cache/
key: ${{matrix.opts.cache-name}}-${{env.BASE_BRANCH}}-${{github.ref}}-${{github.sha}}
restore-keys: |
${{matrix.opts.cache-name}}-${{env.BASE_BRANCH}}-${{github.ref}}-${{github.sha}}
${{matrix.opts.cache-name}}-${{env.BASE_BRANCH}}-${{github.ref}}
${{matrix.opts.cache-name}}-${{env.BASE_BRANCH}}
- name: Set up Python 3.x
uses: actions/setup-python@v2
with:
python-version: "3.x"
architecture: "x64"
- name: Configuring Python packages
run: |
python -c "import sys; print(sys.version)"
python -m pip install scons
python --version
scons --version
- name: Compilation
working-directory: ./scripts
env:
SCONS_CACHE: ${{github.workspace}}/.scons_cache/
run: |
PATH=/opt/buildroot/bin:$PATH scons platform=linuxbsd ${{ matrix.opts.build-options }} ${{ env.SCONSFLAGS }}
- name: Prepare artifact
run: |
strip scripts/godot/bin/godot.*
chmod +x scripts/godot/bin/godot.*
- name: Generate Mono Glue
if: ${{ matrix.opts.cache-name == 'linux-editor-mono' }}
run: |
cd scripts/godot
bin/godot.linuxbsd.editor.x86_64.luaAPI.mono --headless --generate-mono-glue modules/mono/glue
mkdir bin/nuget_packages
./modules/mono/build_scripts/build_assemblies.py --godot-output-dir=./bin --push-nupkgs-local ./bin/nuget_packages
cp ../mono_instructions.txt bin/
- name: Prepare templates
if: ${{ contains(matrix.opts.artifact-name, 'export-templates') }}
run: |
mkdir -p scripts/godot/templates/
mv scripts/godot/bin/godot.linuxbsd.template_release.x86_64.luaAPI scripts/godot/templates/linux_release.x86_64 || true
mv scripts/godot/bin/godot.linuxbsd.template_debug.x86_64.luaAPI scripts/godot/templates/linux_debug.x86_64 || true
mv scripts/godot/bin/godot.linuxbsd.template_release.x86_32.luaAPI scripts/godot/templates/linux_release.x86_32 || true
mv scripts/godot/bin/godot.linuxbsd.template_debug.x86_32.luaAPI scripts/godot/templates/linux_debug.x86_32 || true
mv scripts/godot/bin/godot.linuxbsd.template_release.x86_64.luaAPI.mono scripts/godot/templates/linux_release.x86_64 || true
mv scripts/godot/bin/godot.linuxbsd.template_debug.x86_64.luaAPI.mono scripts/godot/templates/linux_debug.x86_64 || true
mv scripts/godot/bin/godot.linuxbsd.template_release.x86_32.luaAPI.mono scripts/godot/templates/linux_release.x32_64 || true
mv scripts/godot/bin/godot.linuxbsd.template_debug.x86_32.luaAPI.mono scripts/godot/templates/linux_debug.x86_32 || true
rm -rf scripts/godot/bin/*
mv scripts/godot/templates scripts/godot/bin/
- name: Copy License
if: ${{ !contains(matrix.opts.artifact-name, 'export-templates') }}
run: |
cp -n '${{ github.workspace }}/README.md' '${{ github.workspace }}/LICENSE' ${{ github.workspace }}/scripts/godot/bin/
- uses: actions/upload-artifact@v2
with:
name: ${{matrix.opts.artifact-name}}
path: scripts/godot/bin/*