Closed NetSysFire closed 1 month ago
I have found the issue! Credits to paulguy for suggesting that.
You run godot and apparently this has created a dummy config in the past:
However, it does not do that anymore and it is missing the headers. I solved the issue by prepending this to the file:
[gd_resource type="EditorSettings" format=3]
[resource]
I'll PR that here real quick.
For me the first thing you posted actually worked when pointed to the current version:
echo 'export/android/java_sdk_path = "/usr/lib/jvm/java-17-openjdk-amd64"' >> ~/.config/godot/editor_settings-4.3.tres
This is the complete debug step I have now
# Android Debug Job. It will use the generated debug.keystore.
android_debug:
stage: export
script:
- echo 'export/android/java_sdk_path = "/usr/lib/jvm/java-17-openjdk-amd64"' >> ~/.config/godot/editor_settings-4.3.tres
- godot --headless --verbose --export-debug "Android Debug" ./build/android/$EXPORT_NAME.apk
artifacts:
name: $EXPORT_NAME-$CI_JOB_NAME
paths:
- build/android
Somehow this passes
Curious. What user/home does that run in? Maybe invoking godot and exiting immediately does place a config but not in a place where you'd expect it.
what would be a sample job to build a test project now? I'm trying to piece together how to get Android builds to work but no luck so far. (I don't have any github actions experience prior to this so excuse any obvious errors)
my .yml looks something like this: (mac exporting works fine)
name: "godot-ci export"
on: push
env:
GODOT_VERSION: 4.3
EXPORT_NAME: some-name
jobs:
export-android:
name: Android Export
runs-on: ubuntu-20.04
container:
image: barichello/godot-ci:4.3
steps:
- name: Checkout
uses: actions/checkout@v4
with:
lfs: true
- name: Setup
run: |
mkdir -v -p ~/.local/share/godot/export_templates/
mkdir -v -p ~/.config/
echo 'export/android/java_sdk_path = "/usr/lib/jvm/java-17-openjdk-amd64"' >> /root/.config/godot/editor_settings-4.tres
cp /root/.config/godot/editor_settings-4.tres /root/.config/godot/editor_settings-4.3.tres
cp -r /root/.config/godot ~/.config/godot
cp -r /root/.local/share/godot/export_templates/${GODOT_VERSION}.stable ~/.local/share/godot/export_templates/${GODOT_VERSION}.stable
- name: Android Build
run: |
mkdir -v -p build/android
godot --headless --verbose --export-release "Android" "build/android/$EXPORT_NAME.apk"
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: android
path: build/android
export-mac:
name: Mac Export
runs-on: ubuntu-20.04
container:
image: barichello/godot-ci:4.3
steps:
- name: Checkout
uses: actions/checkout@v4
with:
lfs: true
- name: Setup
run: |
mkdir -v -p ~/.local/share/godot/export_templates/
mv /root/.local/share/godot/export_templates/${GODOT_VERSION}.stable ~/.local/share/godot/export_templates/${GODOT_VERSION}.stable
- name: Mac Build
run: |
mkdir -v -p build/mac
godot --headless --verbose --export-release "macOS" build/mac/$EXPORT_NAME.zip
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: mac
path: build/mac
the log looks as follows:
[...]
Loaded system CA certificates
EditorSettings: Save OK!
reimport: begin: (Re)Importing Assets steps: 1
reimport: step 0: icon.svg
EditorFileSystem: Importing file: res://icon.svg
EditorFileSystem: "res://icon.svg" import took 3 ms.
reimport: end
ERROR: Cannot export project with preset "Android" due to configuration errors:
Could not find version of build tools that matches Target SDK, using 33.0.2
A valid Java SDK path is required in Editor Settings.
at: _fs_changed (editor/editor_node.cpp:1012)
ERROR: Project export for preset "Android" failed.
at: _fs_changed (editor/editor_node.cpp:1028)
EditorSettings: Save OK!
XR: Clearing primary interface
XR: Removed interface "Native mobile"
XR: Removed interface "OpenXR"
Orphan StringName: Start (static: 0, total: 1)
Orphan StringName: Node (static: 5, total: 6)
Orphan StringName: End (static: 0, total: 1)
StringName: 3 unclaimed string names at exit.
Error: Process completed with exit code 1.
So the only thing you need to do now is copying the /root godot paths, which I also added to the sample workflow in said PR.
I checked again. The new image has not yet been uploaded to the container registry as no changes have been applied yet. @Calinou, it looks like the workflow responsible for that was skipped. https://github.com/abarichello/godot-ci/actions/runs/11406172834/job/31739349244
@NetSysFire oh, thanks for the follow-up! I was again trying all kinds of stuff haha.
so the sample file should just work when changing "Windows Desktop" to "Android Debug" (with an export template named that, and changing the flag to --export-debug? (I want to deal with the key for signing another day..)
Bummer that there is no sample for Android in the yml file
I'll just wait for the updated docker image then.
In the meantime try the echo 'export/android/java_sdk_path = "/usr/lib/jvm/java-17-openjdk-amd64"' >> ~/.config/godot/editor_settings-4.3.tres
Make sure this runs after you copied /root/.config/godot or it'll create a file with missing headers.
I've requested a manual build of 4.3: https://github.com/abarichello/godot-ci/actions/runs/11416728337
The Mono build is failing since Godot 4.x needs OpenJDK 17 to be exported, but it's not available in the Debian Buster (EOL) repositories, which the mono:latest
image is based on. I don't think this image is needed nowadays, given the Dockerfile would need to be switched over to use .NET 8.
Bummer that there is no sample for Android in the yml file
There is one for GitLab CI, but I don't think one was ever added to the GitHub Actions workflow file. It should be straightforward to port it from GitLab CI to GitHub Actions, the main part that's different will be how you define the export secrets.
In the meantime try the
echo 'export/android/java_sdk_path = "/usr/lib/jvm/java-17-openjdk-amd64"' >> ~/.config/godot/editor_settings-4.3.tres
Make sure this runs after you copied /root/.config/godot or it'll create a file with missing headers.
yep, that did the trick, thanks!
Bummer that there is no sample for Android in the yml file
There is one for GitLab CI, but I don't think one was ever added to the GitHub Actions workflow file. It should be straightforward to port it from GitLab CI to GitHub Actions, the main part that's different will be how you define the export secrets.
I'll probably figure that out somehow, otherwise I'll open another issue for help with that
The manual build of the mono image fails because of
#16 [11/23] RUN echo '[gd_resource type="EditorSettings" format=3]' > ~/.config/godot/editor_settings-${GODOT_VERSION:0:3}.tres
#16 0.213 /bin/sh: 1: Bad substitution
This should not happen. However!
https://github.com/abarichello/godot-ci/blob/b87499e4bd2590c2a40d5f0c4fc5cdfc0fbc17a0/Dockerfile#L1
Ubuntu uses dash and not sh. Only with dash this issue happens. I did not introduce this error, this happened with that earlier PR, #149, which added those substitutions in the editor settings file names. The solution for that is to enforce somehow that /bin/sh is actually /bin/sh and not /bin/dash. Or just use /bin/bash.
@NetSysFire This should be fixed by https://github.com/abarichello/godot-ci/pull/158, can you check?
For the people in this thread: This is fixed for good now. You can remove those temporary fixes, I just tested that myself.
All builds (linux, mac and windows) export well (thanks for your work on this project!), except Android, which fails with the error in the title. I thought this was going to be an easy fix and did the following, as the value is also missing from your dockerfile:
But it still complained about the same error. I tried different editor settings paths, including /root/.config/godot and copying
editor_settings-4.tres
toeditor_settings-4.3.tres
(in both /root and ~/) but none worked. Then I setJAVA_HOME
to the same value as in the config and the exporter was mostly happy. Since this environment variable is independent from the config, see the godot source code, this strongly suggests that, for whatever reason, the editor settings are not being read. There is no option in godot, that I found at least, to make it dump the editor settings it sees for additional debugging.Since the
ANDROID_HOME
env var is in the dockerfile, I believe this is why it did not complain about the Android SDK path. It also saysWARNING: Code Signing: Could not find keystore, unable to export.
, indicating again that the editor settings are not being applied.$XDG_DATA_HOME
and$XDG_DATA_CONFIG
are unset or empty.This is on github actions. You can find the file here: https://github.com/sourceofmana/sourceofmana-ci-test/blob/master/.github/workflows/godot-ci.yml But for the sake of of saving you a click, here is a tidied up version which has some of my debug attempts removed: