Code Monkey home page Code Monkey logo

Comments (3)

Xananax avatar Xananax commented on May 24, 2024 2

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="[email protected]"

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?

from godot-ci.

OverloadedOrama avatar OverloadedOrama commented on May 24, 2024

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?

from godot-ci.

2shady4u avatar 2shady4u commented on May 24, 2024

this would be nice to have yes :)

from godot-ci.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.