Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use dotnet image for godot 4 #106

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

AdrasteonDev
Copy link

This pull request allows to use the .NET Docker image instead of the mono image for Godot 4 (the mono image is still used for Godot 3). It is related to #80 (it adds the possibility to use the dotnet command for Godot 4).

As long as there is currently no godot-ci image for Godot 4 on Docker Hub, it will not break existing CI pipelines for Godot 4.

I decided to use "dotnet/sdk:6.0-focal" because I could not install "python-openssl" with the "bullseye-slim" version (and because focal is also used in the dockerfile of the non-mono version of Godot).

I also added a few comments in the YAML files related to Godot 4, and I corrected a bug in mono.Dockerfile.

I made sample projects to be sure that the images are usable for CI:

I verified that the Linux and Windows executables created by the CI pipelines of these projects run correctly.

Let me know if you have any comments or suggestions about this pull request.

@MSchmoecker
Copy link

I can confirm this works for Windows builds, Linux also built but I did not run the executable.
MacOS resulted in an empty zip and the Web export is not yet supported by Godot 4.0.2, see here godotengine/godot#70796

For anyone who wants a quick summary of the needed changes for this PR:

@AdrasteonDev
Copy link
Author

Thank you for this first review.

With the Godot 4 image, it is also required to use --export "macOS" instead of --export "Mac OSX". I added a comment about that in .gitlab-ci.yml and godot-ci.yml.
I suppose the empty zip you got with macOS is due to that.

@Calinou Calinou added bug Something isn't working enhancement New feature or request labels Apr 29, 2023
@MSchmoecker
Copy link

MSchmoecker commented Apr 29, 2023

The export target was already changed to macOS.
But after comparing everything with your example project, it turns out codesign/entitlements/disable_library_validation=true must be set in the export_presets.cfg. It is false by default when creating the export present inside Godot.

@AdrasteonDev
Copy link
Author

I merged the Gitlab CI file following #107 and #108. I will see if I need to add commits to adapt the code of the mono version following these PR

@AdrasteonDev
Copy link
Author

I added a commit to use the jammy .NET image (to match the ubuntu version used in Dockerfile following #107 and #108).

I also made modifications in these test repositories:

I tested the macOS executables: it works (for Godot 3 and 4)

@AdrasteonDev
Copy link
Author

Do you know if it will be possible to see this PR merged before the release of Godot 4.1 ? Perhaps I need to wait a little longer for the changes to be verified ?

@pcen
Copy link

pcen commented Jun 28, 2023

Ran into what I believe is this issue trying to use the image adrasteondev/godot-ci:mono-4.0.3.

Running in a github ci workflow with something like:

jobs:
  test-dotnet:
    name: Test Dotnet
    runs-on: ubuntu-20.04
    container:
      image: adrasteondev/godot-ci:mono-4.0.3
    steps:
      - name: Check Version
        run: |
            /usr/share/dotnet --version

Fails with /usr/share/dotnet: Permission denied. Attempting to invoke dotnet gives a dotnet not found error. It would be useful to be able to invoke dotnet commands in the container in order to build and run C# tests in CI.

@AdrasteonDev
Copy link
Author

AdrasteonDev commented Jul 16, 2023

Thank you for the test.

Two problems prevented your job from working correctly:

  • The dotnet image is based on Ubuntu 22.04 (not Ubuntu 20.04)
  • The dotnet command should be used directly (not /usr/share/dotnet)

You can check this repository for a working example.

I have also

  • added comments in godot-ci.yml about the Ubuntu version for Godot 4
  • created two Gitlab repositories to test the use of the dotnet command with my docker image

@davidschreiber
Copy link

davidschreiber commented Sep 18, 2023

I'm curious: What is the state of this PR? Is any help required to put this ahead? Since Godot 4.1.1 is already available, is it reasonable to update this PR to the latest stable?

@AdrasteonDev
Copy link
Author

The PR is ready to be merged if maintainers agree. I don't think it's necessary to update the PR.

If necessary you can temporarily use the image I built myself to test this PR: https://hub.docker.com/r/adrasteondev/godot-ci/tags

@liperium
Copy link

Why isn't this merged? Csharp+github is really not plug and play right now. Been fiddling with it for a couple of hours, don't even have the solution yet. ( let's hope this is it )

@gdomjan83
Copy link

gdomjan83 commented Nov 27, 2023

@AdrasteonDev AdrasteonDev
Hi. I've been using your adrasteondev/godot-ci:mono-4.1.2 docker image for running a gitlab pipeline and it works perfectly.
I'm trying to learn how to make a docker image for godot mono exports, would you mind sharing the dockerfile for that docker image?

Barichello/godot-ci image, which yours is based on has a dockerfile available, but after I tried it, it seems to me it is not working properly.

@AdrasteonDev
Copy link
Author

@AdrasteonDev AdrasteonDev Hi. I've been using your adrasteondev/godot-ci:mono-4.1.2 docker image for running a gitlab pipeline and it works perfectly. I'm trying to learn how to make a docker image for godot mono exports, would you mind sharing the dockerfile for that docker image?

Hi ! Good to see my image is useful :)

You can find it here.

You can also look at the "build-mono" job in this CI file (the variables used by the Dockerfile are defined here).

@gdomjan83
Copy link

@AdrasteonDev AdrasteonDev Hi. I've been using your adrasteondev/godot-ci:mono-4.1.2 docker image for running a gitlab pipeline and it works perfectly. I'm trying to learn how to make a docker image for godot mono exports, would you mind sharing the dockerfile for that docker image?

Hi ! Good to see my image is useful :)

You can find it here.

You can also look at the "build-mono" job in this CI file (the variables used by the Dockerfile are defined here).

Thank you, I will give it a spin. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants