Closed OverloadedOrama closed 4 months ago
As a workaround to this issue, I added an extra step before the rest of the steps for Windows builds in the workflow file, that downloads and sets up WINE and recedit.
The instructions are these:
- name: Setup WINE and rcedit 🍷
run: |
dpkg --add-architecture i386 && apt-get update && apt-get install -y wine-stable && apt-get install -y wine32
chown root:root -R ~
wget https://github.com/electron/rcedit/releases/download/v1.1.1/rcedit-x64.exe
mkdir -v -p ~/.local/share/rcedit
mv rcedit-x64.exe ~/.local/share/rcedit
godot -q
echo 'export/windows/wine = "/usr/bin/wine"' >> ~/.config/godot/editor_settings-3.tres
echo 'export/windows/rcedit = "/github/home/.local/share/rcedit/rcedit-x64.exe"' >> ~/.config/godot/editor_settings-3.tres
It first downloads WINE. I'm not sure if wine-stable is needed, but if wine32 isn't installed, it complains. dpkg --add-architecture i386
is needed to download wine32. Then, it runs chown
to change the owner of the home (~) directory. Otherwise WINE complains that ~ is not owned by us and refuses to create a configuration directory there.
It then downloads rcedit.x64 from GitHub, and places it in a new ~/.local/share/rcedit directory. I'm not sure if that's the best place for it to be, but it works.
godot -q
runs Godot and quits immediately. We do this in order to create the editor_settings-3.tres
file. And then we simply add the export/windows/wine
and export/windows/rcedit
paths to the editor settings.
This solution might not be the most optimized one, so feel free to suggest improvements. It does work properly though. You can see a full example here: https://github.com/Orama-Interactive/Pixelorama/blob/master/.github/workflows/dev-desktop-builds.yml
I tried writing these instructions inside a Dockerfile, but so far I didn't manage to make it work. The logic should be similar though. Is it best to do it in the workflow, or if this should be done in the Dockerfile itself?
I add Imagemagick
, Wine
, and Rcedit
to the docker.
Wine and RCEdit to integrate the icon, and imagemagick to generate it from a png image (as well as potentially generating the OSX icns with icnsutils, though I haven't gotten there yet)
I also generate inline a small script set-icon
, which takes a png path and a godot exported exe, and sets the icon on it
example usage:
set-icon path/to/icon.png $(pwd)/build/windows/$EXPORT_NAME.exe
Here's the dockerfile:
FROM ubuntu:bionic
LABEL author="me@xananax.com"
ARG GODOT_VERSION=3.2.3
USER root
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
git \
python \
python-openssl \
unzip \
wget \
zip \
wine-stable \
wine64 \
imagemagick \
icnsutils \
curl \
--fix-missing \
&& rm -rf /var/lib/apt/lists/*
ENV GODOT_VERSION=$GODOT_VERSION
ENV WINEDEBUG -all
RUN wget https://downloads.tuxfamily.org/godotengine/${GODOT_VERSION}/Godot_v${GODOT_VERSION}-stable_linux_headless.64.zip \
&& wget https://downloads.tuxfamily.org/godotengine/${GODOT_VERSION}/Godot_v${GODOT_VERSION}-stable_export_templates.tpz \
&& mkdir ~/.cache \
&& mkdir -p ~/.config/godot \
&& mkdir -p ~/.local/share/godot/templates/${GODOT_VERSION}.stable \
&& unzip Godot_v${GODOT_VERSION}-stable_linux_headless.64.zip \
&& mv Godot_v${GODOT_VERSION}-stable_linux_headless.64 /usr/local/bin/godot \
&& unzip Godot_v${GODOT_VERSION}-stable_export_templates.tpz \
&& mv templates/* ~/.local/share/godot/templates/${GODOT_VERSION}.stable \
&& rm -f Godot_v${GODOT_VERSION}-stable_export_templates.tpz Godot_v${GODOT_VERSION}-stable_linux_headless.64.zip
RUN wget https://github.com/electron/rcedit/releases/download/v1.1.1/rcedit-x64.exe \
&& mkdir -p /opt/rcedit \
&& mkdir -p /opt/rcedit/bin \
&& mv rcedit-x64.exe /opt/rcedit
RUN mkdir -p /opt/butler
RUN wget -O /opt/butler/butler.zip https://broth.itch.ovh/butler/linux-amd64/LATEST/archive/default
RUN unzip /opt/butler/butler.zip -d /opt/butler
RUN rm -rf /opt/butler/butler.zip
RUN ls /opt/butler
RUN chmod +x /opt/butler/butler
RUN /opt/butler/butler -V
RUN echo "convert \$1 -define icon:auto-resize=256,128,64,48,32,16 /tmp/icon.ico && wine /opt/rcedit/rcedit-x64.exe \$2 --set-icon /tmp/icon.ico" > /opt/rcedit/bin/set-icon
RUN chmod +x /opt/rcedit/bin/set-icon
ENV PATH="/opt/butler/:/opt/rcedit/bin/:${PATH}"
I have the Godot version as an arg, so you can build the docker this way:
sudo docker build -t xananax/godot-ci:3.2.3 --build-arg GODOT_VERSION=3.2.3 .
Is there any interest in a PR?
this would be nice to have yes :)
Currently, Windows builds generated by godot-ci do not have an icon and the Windows preset options found in
export_presets.cfg
are ignored. To solve this, godot-ci needs to install rcedit (and possibly WINE), and include the paths to these binaries inside Godot's editor settings. See this for more information: https://docs.godotengine.org/en/stable/getting_started/workflow/export/changing_application_icon_for_windows.html