-
Notifications
You must be signed in to change notification settings - Fork 6
170 lines (151 loc) · 6.64 KB
/
windows_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
name: 🏁 Windows Builds
on:
push:
branches:
- 'main'
pull_request:
jobs:
build-windows:
runs-on: "ubuntu-20.04"
name: Build
strategy:
matrix:
include:
- name: 32 Bits
arch: x86_32
bin: godot.windows.template_release.x86_32.exe
template: godot_32.exe
videodecoder: windows_32
- name: 64 Bits
arch: x86_64
bin: godot.windows.template_release.x86_64.exe
template: godot_64.exe
videodecoder: windows_64
steps:
- name: "Checkout RetroHub"
uses: actions/checkout@v3
with:
path: "retrohub"
- name: "Load cached objects (Godot editor)"
uses: actions/cache@v3
id: "cache_editor"
with:
path: cached_builds/editor/godot
key: editor-build
continue-on-error: true
- name: "Load cached objects (Godot templates)"
uses: actions/cache@v3
id: "cache_template"
with:
path: cached_builds/template/${{ matrix.template }}
key: Windows-${{ matrix.arch }}-template-build
continue-on-error: true
- name: "Load cached objects (Videodecoder)"
uses: actions/cache@v3
id: "cache_videodecoder"
with:
path: cached_builds/videodecoder/${{ matrix.videodecoder }}
key: Windows-${{ matrix.arch }}-videodecoder-build
continue-on-error: true
- name: "Checkout Custom Godot"
if: steps.cache_template.outputs.cache-hit != 'true'
uses: actions/checkout@v3
with:
repository: retrohub-org/godot
ref: retrohub_patches_4x
path: "godot"
- name: "Checkout godot-videodecoder"
if: steps.cache_videodecoder.outputs.cache-hit != 'true'
uses: actions/checkout@v3
with:
repository: retrohub-org/godot-videodecoder
submodules: recursive
path: "videodecoder"
- name: "[Videodecoder] Compilation"
if: steps.cache_videodecoder.outputs.cache-hit != 'true'
working-directory: ./videodecoder
env:
PLATFORMS: ${{ matrix.videodecoder }}
run: |
./build_gdextension.sh
mkdir -p -v ../cached_builds/videodecoder
cp -r -v target/* ../cached_builds/videodecoder
- name: "[Godot] Dependencies"
if: steps.cache_template.outputs.cache-hit != 'true'
working-directory: ./godot
shell: bash
run: |
sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
sudo add-apt-repository ppa:kisak/kisak-mesa
sudo apt-get install -qq mesa-vulkan-drivers
sudo dpkg --add-architecture i386
sudo apt-get update
# The actual dependencies
sudo apt-get install build-essential gcc-multilib g++-multilib pkg-config libc6-dev-i386 libx11-dev libx11-dev:i386 \
libxcursor-dev libxcursor-dev:i386 libxinerama-dev libxinerama-dev:i386 libx11-dev:i386 libgl1-mesa-dev \
libgl1-mesa-dev:i386 libglu-dev libasound2-dev libpulse-dev libdbus-1-dev libudev-dev libxi-dev \
libxi-dev:i386 libxrandr-dev libxrandr-dev:i386 yasm xvfb wget unzip mingw-w64
sudo update-alternatives --set i686-w64-mingw32-gcc /usr/bin/i686-w64-mingw32-gcc-posix
sudo update-alternatives --set i686-w64-mingw32-g++ /usr/bin/i686-w64-mingw32-g++-posix
sudo update-alternatives --set x86_64-w64-mingw32-gcc /usr/bin/x86_64-w64-mingw32-gcc-posix
sudo update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix
- name: "[Godot] Setup Godot build cache"
if: steps.cache_template.outputs.cache-hit != 'true'
uses: ./godot/.github/actions/godot-cache
with:
cache-name: windows-template
continue-on-error: true
- name: "[Godot] Setup python and scons"
if: steps.cache_template.outputs.cache-hit != 'true'
uses: ./godot/.github/actions/godot-deps
- name: "[Godot] Compilation [template]"
if: steps.cache_template.outputs.cache-hit != 'true'
uses: ./godot/.github/actions/godot-build
with:
root: ./godot
sconsflags: verbose=yes warnings=all werror=yes use_lto=yes optimize=size arch=${{ matrix.arch }}
platform: windows
target: template_release
tools: false
- name: "[Godot] Clean and cache template build"
if: steps.cache_template.outputs.cache-hit != 'true'
run: |
strip godot/bin/*
mkdir -p -v cached_builds/template
[[ -e godot/bin/${{ matrix.bin }} ]] && mv godot/bin/${{ matrix.bin }} cached_builds/template/${{ matrix.template }}
- name: "[Godot] Download editor"
if: steps.cache_editor.outputs.cache-hit != 'true'
run: |
wget https://downloads.tuxfamily.org/godotengine/4.1/Godot_v4.1-stable_linux.x86_64.zip
unzip Godot_v4.1-stable_linux.x86_64.zip
mkdir -p -v cached_builds/editor
mv Godot_v4.1-stable_linux.x86_64 cached_builds/editor/godot
- name: "Setup templates and libraries"
env:
TEMPLATE_PATH: /home/runner/.local/share/godot/export_templates/4.1.stable
run: |
mkdir -p -v $TEMPLATE_PATH
cp cached_builds/template/${{ matrix.template }} $TEMPLATE_PATH/windows_release_${{ matrix.arch }}.exe
ln -s ../../../cached_builds/videodecoder/${{ matrix.videodecoder }} retrohub/addons/godot-videodecoder/${{ matrix.videodecoder }}
mkdir -p -v export/windows_${{ matrix.arch }}
- name: "Package default themes"
uses: ./retrohub/.github/actions/get-default-themes
- name: "Setup rcedit"
run: |
sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
sudo apt-get update
sudo apt-get install wine-stable
wget https://github.com/electron/rcedit/releases/download/v1.1.1/rcedit-x64.exe
cached_builds/editor/godot --headless --quit
echo "export/windows/wine = \"/usr/bin/wine\"" >> ~/.config/godot/editor_settings-4.tres
echo "export/windows/rcedit = \"$(pwd)/rcedit-x64.exe\"" >> ~/.config/godot/editor_settings-4.tres
tail -n2 ~/.config/godot/editor_settings-4.tres
- name: "Exporting RetroHub"
working-directory: retrohub
run: |
../cached_builds/editor/godot --headless --export-release "Windows (${{ matrix.arch }})" ../export/windows_${{ matrix.arch }}/RetroHub.exe
- name: "Upload Artifacts"
uses: actions/upload-artifact@v3
with:
name: windows-${{ matrix.arch }}
path: export/windows_${{ matrix.arch }}