Coder Social home page Coder Social logo

abarichello / godot-ci Goto Github PK

View Code? Open in Web Editor NEW
612.0 19.0 115.0 12.18 MB

Docker image to export Godot Engine games. Templates for Gitlab CI and GitHub Actions to deploy to GitLab Pages/GitHub Pages/Itch.io.

Home Page: https://hub.docker.com/r/barichello/godot-ci

License: MIT License

Dockerfile 94.61% Shell 5.39%
godot-engine godot gitlab gitlab-ci ci-cd docker dockerfile github-actions github-page github-pages

godot-ci's Introduction

godot-ci

Docker image to export Godot Engine games and deploy to GitLab/GitHub Pages and Itch.io using GitLab CI and GitHub Actions.

Docker Hub

https://hub.docker.com/r/barichello/godot-ci/

How To Use

.gitlab-ci.yml and .github/workflows/godot-ci.yml are included in this project as reference.
For live projects, examples and tutorials using this template check the list below:

Mono/C#

To build a Godot project with Mono (C#) enabled, you must do two things for each job:

  1. Change the container's image tag from barichello/godot-ci:VERSION to barichello/godot-ci:mono-VERSION in .gitlab-ci.yml (Gitlab) or godot-ci.yml (Github). (e.g. barichello/godot-ci:mono-3.2.1).
  2. You will also need to change your "Setup" step's run commands (looks like run: mv /root/.local ...) from ending with ...${GODOT_VERSION}.stable to ending with ...${GODOT_VERSION}.stable.mono. You will need to do this for both directories in the command.
mv /root/.local/share/godot/export_templates/${GODOT_VERSION}.stable ~/.local/share/godot/export_templates/${GODOT_VERSION}.stable

becomes:

mv /root/.local/share/godot/export_templates/${GODOT_VERSION}.stable.mono ~/.local/share/godot/export_templates/${GODOT_VERSION}.stable.mono

Android

To build a debug release (debug.keystore), use the android_debug job example in the gitlab-ci.yml file.

If you want to export for Android with your own keystore, you can do this with the following steps:

  1. Take your generated keystore and convert it to Base64: Linux & macOS: base64 release.keystore -w 0 Windows: certutil -encodehex -f release.keystore encoded.txt 0x40000001
  2. Go to GitLab Project > Settings > CI/CD > Variables and copy the Base64-encoded keystore value in a new variable SECRET_RELEASE_KEYSTORE_BASE64 as type variable.
  3. Create a second variable SECRET_RELEASE_KEYSTORE_USER as type variable with the alias of your keystore as value.
  4. Create a third variable SECRET_RELEASE_KEYSTORE_PASSWORD as type variable with the password of your keystore as value.
  5. Use the android job example in the gitlab-ci.yml file.

GDNative/C++

See this repository for automating GDNative C++ compilation, which is based off this repository.

Modules

You have to compile Godot with the modules included first. See this excellent repository by Calinou for automating Godot builds.

After that, you would use the custom build to export your project as usual. See this guide by Greenfox on how to use a custom Godot build for automated exports.

iOS

Not available yet. Automating Xcode projects is doable but not trivial, and macOS runners only recently became available for GitHub actions, so it will happen eventually.

Platforms

Here's a mapping between each supported CI service, the template jobs and a live example.

CI Template Example
GitLab CI Godot Exports / GitHub Pages / GitLab Pages / Itch.io GitLab CI Pipelines
GitHub Actions Godot Exports GitHub Actions running

Environment configuration

First you need to remove unused jobs/stages from the .yml file you are using as a template(.gitlab-ci.yml or .github/workflows/godot-ci.yml).
Then you have to add these environments to a configuration panel depending on the chosen CI and jobs:

  • GitHub: https://github.com/<username>/<project-name>/settings/secrets
  • GitLab: https://gitlab.com/<username>/<repo-name>/settings/ci_cd

GitHub Pages

Secrets needed for a GitHub Pages deploy via GitLab CI:

Variable Description Example
REMOTE_URL The git remote where the web export will be hosted (in this case GitHub), it should contain your deploy/personal access token https://<github username>:<deploy token>@github.com/<username>/<repository>.git
GIT_EMAIL Git email of the account that will commit to the gh-pages branch. [email protected]
GIT_USERNAME Username of the account that will commit to the gh-pages branch. username

Others variables are set automatically by the gitlab-runner, see the documentation for predefined variables.

Itch.io

Deployment to Itch.io is done via Butler.
Secrets needed for a Itch.io deploy via GitLab CI:

Variable Description Example
ITCHIO_USERNAME Your username on Itch.io, as in your personal page will be at https://<username>.itch.io username
ITCHIO_GAME the name of your game on Itchio, as in your game will be available at https://<username>.itch.io/<game> game
BUTLER_API_KEY An Itch.io API key is necessary for Butler so that the CI can authenticate on Itch.io on your behalf. Make that API key Masked(GitLab CI) to keep it secret xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Troubleshoot

Problems while exporting

  • Check that the export presets file (export_presets.cfg) is committed to version control. In other words, export_presets.cfg must not be in .gitignore.
    • Make sure you don't accidentally commit Android release keystore or Windows codesigning credentials. These credentials cannot be revoked if they are leaked!
  • Check that the export names on export_presets.cfg match the ones used in your CI script (case-sensitive). Export preset names that contain spaces must be written within quotes (single or double).
  • Check the paths used in your CI script. Some commands may be running in the wrong place if you are keeping the project in a folder (like the test-project template) or not.

Authentication errors with Butler

Additional Resources

Greenfox has an excellent repo that is also for automating Godot exports.

godot-ci's People

Contributors

2shady4u avatar abarichello avatar bisa avatar bjoernakamanf avatar calinou avatar dsnopek avatar dzil123 avatar hunternn avatar ktar5 avatar lallmon avatar lazaromenezes avatar loteque avatar maxim-sheronov avatar mk-5 avatar overloadedorama avatar rcorre avatar realkotob avatar rogerclotet avatar seanmaxwell avatar theorioli avatar xuv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

godot-ci's Issues

Mono: Adding .NET

Certain plugins( such as https://github.com/31/GodotOnReady) might rely on the dotnet CLI being used to build the C# project. The current docker image is built on top of the mono:latest and does not include the .NET SDK and CLI tools.

The current workaround ( and potential solution) is to execute the following commands before building:

wget https://packages.microsoft.com/config/debian/10/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
dpkg -i packages-microsoft-prod.deb
rm packages-microsoft-prod.deb
apt-get update -qq
apt-get install -y apt-transport-https
apt-get update -qq
apt-get install -y dotnet-sdk-6.0

which seems to be all that is required for Godot to prefer using the dotnet commands when building. Running these commands in the existing Dockerfile should work out of the box.

Some other potential solutions are:

  • Modify mono.Dockerfile to use mcr.microsoft.com/dotnet/sdk:6.0 or preferably mcr.microsoft.com/dotnet/sdk:6.0-alpine, which would be weird since the image is published as mono and might break workflows
  • a new image is built: godot-ci:dotnet which uses the above mentioned images, unfortunately this would add a third image to maintain

No CI for the docker images themselves

Hi, first of all, love the existing work.
I was just wondering how the images get to the docker hub. I assume @abarichello is pushing them manually at the moment because the github and gitlab CI only demonstrate the godot CI. If that is the case I suggest replacing the current CI by jobs that build the godot-ci images and automatically push and tag them on the docker hub for specific branches like master or 3.2. This would ensure that the images on the dockerhub are always in sync with the repository and it would make the image contents more transparent to the users. The godot-ci will still be demonstrated by the existing example repositories.

If desired, I could possibly submit a pull request implementing this as soon as I get to it.

Best regards

Please add export android in mono.Dockerfile

Hi,

I could not export android using godot mono.
I checked that mono.Dockerfile do not have android installation like Dockerfile.
Please consider to support export android in mono.Dockerfile.

`java.io.IOException: Invalid keystore format`

When I build our Godot app with your CI for Android I get this:

...
ADDING: res/mipmap/icon_foreground.png
ADDING: resources.arsc
	export: step 1: Adding files...
	export: step 103: Aligning APK...
Starting signing of the APK binary using /usr/lib/android-sdk/build-tools/30.0.3/apksigner
	export: step 104: Signing release APK...
Failed to load signer "signer #1"
java.io.IOException: Invalid keystore format
	at sun.security.provider.JavaKeyStore.engineLoad(JavaKeyStore.java:666)
	at sun.security.provider.JavaKeyStore$JKS.engineLoad(JavaKeyStore.java:57)
	at sun.security.provider.KeyStoreDelegator.engineLoad(KeyStoreDelegator.java:224)
	at sun.security.provider.JavaKeyStore$DualFormatJKS.engineLoad(JavaKeyStore.java:71)
	at java.security.KeyStore.load(KeyStore.java:1445)
	at com.android.apksigner.SignerParams.loadKeyStoreFromFile(SignerParams.java:353)
	at com.android.apksigner.SignerParams.loadPrivateKeyAndCertsFromKeyStore(SignerParams.java:239)
	at com.android.apksigner.SignerParams.loadPrivateKeyAndCerts(SignerParams.java:181)
	at com.android.apksigner.ApkSignerTool.getSignerConfig(ApkSignerTool.java:395)
	at com.android.apksigner.ApkSignerTool.sign(ApkSignerTool.java:316)
	at com.android.apksigner.ApkSignerTool.main(ApkSignerTool.java:88)

export: end
ERROR: Project export failed with error code 20 for preset "Android".
   at: _fs_changed (editor/editor_node.cpp:801)
EditorSettings: Save OK!

I followed the steps in the documentation of the CI config to encode the key and all that. I verified multiple times now that the from base64 decoded key is exactly the same as the original non base64 key. I have no idea what this error means.

Android Release CI fails due to base64: invalid input

Could there be a little bit more information on how to actually encode the release key with base64?

I encoded the keystore key as indicated, but I am unable to recover the key again once it has been encoded.
Using WSL (Ubuntu) I get the following errors messages:
Capture

It also crashes on the Gitlab runner (evidently):
image

I just took the content of the generated "key" file and copy-pasted it into the Gitlab variables section, but since it doesn't
work on WSL, it also logically won't work on the Godot-CI image....

What am I doing wrong here?
Could there be some more information added to the docs?

Add deploy to Itch.io

Hello @abarichello

This is not an issue, but a feature request. I'm submitting this especially because your docker image is so popular among all the Godot docker images available. And for a good reason, it provides excellent documentation. Thanks a lot for that.

Since you already have all these excellent examples on how to deploy the HTML5 game to Git(hub|lab) Pages. Adding deployment to Itch.io would complete this set as it's one of the most popular platform for Windows, Linux and Mac indie games.

Itch.io Butler needs to be available in the docker image. Here is some inspiration on how to add it ;)

And the user would need to provide his/her own Itch.io API key.

Let me know what you think.

Create Multistage Dockerfiles

It would be great, if the Dockerfile will be multistage, because it could reduce the base container size for downloading it locally.

Undocumented Errors, no clue what I'm doing

First off I am really glad this exists and I want to get this working, but I have never set up github actions before and I dunno what I'm doing.
At first, I had an error code 2 where it couldn't CD to my project folder - this was resolved by moving the whole Godot project into its own folder while the github actions remained in the root folder of the project. I could not find
Now, I have error code 1 where every job fails with this:
image
I dunno what to do with this and I'm left in the dark. Does it have to do something with my project lacking export presets?
If you have any ideas please let me know!

Godot-ci update script

Since Docker Hub's automated builds are now locked behind a $60/year plan creating a script to check for new godot releases everyday would help keep this project up to date with minimal manual intervention.

Workflow:

  1. Check for a new godot release everyday.
  2. If a new release is available build the docker image with the GODOT_ENV variable updated.
  3. Commit a new tag and create a new GitHub release in this repository.

Mac OS and Linux Export Failed

Hello,

I'm not too experienced with CI/CD script, so there's high chance I overlooked something simple rather than finding a bug or something. (Also, sorry if my English is confusing)

I use Godot 3.2.2 for this project. Windows export works well.

My gitlab-ci.yaml snippet looks like this:

linux:
    stage: export
    script:
        - mkdir -v -p build/linux
        - cd $EXPORT_NAME
        - godot -v --export "Linux/X11" ../build/linux/$EXPORT_NAME.x86_64
    artifacts:
        name: $EXPORT_NAME-$CI_JOB_NAME
        paths:
            - build/linux

mac:
    stage: export
    script:
        - mkdir -v -p build/mac
        - cd $EXPORT_NAME
        - godot -v --export "Mac OSX" ../build/mac/$EXPORT_NAME.zip
    artifacts:
        name: $EXPORT_NAME-$CI_JOB_NAME
        paths:
            - build/mac

And the error appeared is:

ERROR: _fs_changed: Invalid export preset name: Linux/X11.
   At: editor/editor_node.cpp:634.
EditorSettings: Save OK!
ERROR: ~List: Condition "_first != __null" is true.
   At: ./core/self_list.h:112.
ERROR: cleanup: There are still MemoryPool allocs in use at exit!
   At: core/pool_vector.cpp:69.
ERROR: _fs_changed: Invalid export preset name: Mac OSX.
   At: editor/editor_node.cpp:634.
EditorSettings: Save OK!
ERROR: ~List: Condition "_first != __null" is true.
   At: ./core/self_list.h:112.
ERROR: cleanup: There are still MemoryPool allocs in use at exit!
   At: core/pool_vector.cpp:69.

Thank you.

Missing .translation-files

The recommended .gitignore for Godot (https://github.com/github/gitignore/blob/master/Godot.gitignore) says to ignore the export_presets.cfg which is of course not a good idea if you need to run godot-ci.

Similarly the .gitignore recommends not pushing the auto-generated .translation-files to the remote.
Unfortunately this leads to errors in the Gitlab runner output due to missing .translation-files.

My question is thus: Should .translation-files be pushed to the remote in the case of godot-ci or not?
And if yes, could this mentioned somewhere in the README.md?

Can't successfully build on 3.3

During the build I am seeing

ERROR: _fs_changed: Cannot export project with preset 'Windows Desktop' due to configuration errors:
No export template found at the expected path:
/github/home/.local/share/godot/templates/3.3.stable.mono/windows_64_debug.exe
No export template found at the expected path:
/github/home/.local/share/godot/templates/3.3.stable.mono/windows_64_release.exe

   At: editor/editor_node.cpp:732.
ERROR: _fs_changed: Project export failed for preset 'Windows Desktop', the export template appears to be missing.
   At: editor/editor_node.cpp:755.

Which seems to indicate that there are export templates missing. Am I missing something?

name: "godot-ci export"
on: push

env:
GODOT_VERSION: 3.3
EXPORT_NAME: combat-engineers

jobs:
export-windows:
 name: Windows Export
 runs-on: ubuntu-latest
 container:
   image: barichello/godot-ci:mono-3.3
 steps:
   - name: Checkout
     uses: actions/checkout@v2
     with:
       lfs: true
   - name: Windows Build
     run: |
       mkdir -v -p build
       godot -v --export "Windows Desktop" build/$EXPORT_NAME.exe
   - name: Upload Artifact
     uses: actions/upload-artifact@v1
     with:
       name: windows
       path: build

export-linux:
 name: Linux Export
 runs-on: ubuntu-latest
 container:
   image: barichello/godot-ci:mono-3.3
 steps:
   - name: Checkout
     uses: actions/checkout@v2
     with:
       lfs: true
   - name: Linux Build
     run: |
       mkdir -v -p build
       godot -v --export "Linux/X11" build/$EXPORT_NAME.x86_64.bin
   - name: Upload Artifact
     uses: actions/upload-artifact@v1
     with:
       name: linux
       path: build

Mono 3.2.2 Builds failing, as template doesn't exist.

Hi, I am receiving this message in my builds:

mv: cannot stat '/root/.local/share/godot/templates/3.2.2.stable': No such file or directory

I am using the barichello/godot-ci:mono-3.2.2 container.

That folder doesn't exist.

root@99379c0bcc4a:~/.local/share/godot/templates# ls
3.2.2.beta3.mono

While that's not an issue, because I can change it, it does mean that there is an issue in your template. If nothing else, maybe mention it in the instructions, so that people know that they may need to edit this?

Mac Build Problems

Hi, for me the mac build is not working. It tells me the executable is damaged and I should move it to the trash when trying to run it.

Gitlab CI Jobs randomly fail

Did you ever encounter weird phenomena like these:

Running with gitlab-runner 13.8.0 (775dd39d)
  on newest xxxxxx
Resolving secrets
00:00
Preparing the "docker" executor
...
Preparing environment
00:01
Running on runner-xxxxxxxx-project-169-concurrent-0 via c9efa222138c...
Getting source from Git repository
00:04
Fetching changes with git depth set to 50...
Reinitialized existing Git repository in /builds/<group>/<project>/.git/
fatal: shallow file has changed since we read it
Cleaning up file based variables
00:02
ERROR: Job failed: exit code 1

?

It happens randomly to different jobs (mostly linux and windows export stages), sometimes files go missing, sometimes I get this. It's frustrating. I'm running a docker-in-docker gitlab-runner setup.

EDIT: I am running a docker-in-docker runner configuration and set concurrent=4 in the runner toml file so there should never be more jobs than this setting allows. I was able to workaround this issue by adding retries to the jobs inside the .gitlab-ci.yml file. Unsure if this is a GitLab, Godot command line or godot-ci -specific bug.

Android CI is not implemented in older Docker images (<= 3.2.3)

I'm probably missing something here...?

When running the Android Debug job on Gitlab-CI I get following error:
image

Is there a gitlab variable I'm missing somewhere? If yes, which one and could this then be updated in the README?

my yml:

# Android Debug Job. It will use the generated debug.keystore. 
android_debug:
  stage: export
  script:
    - mkdir -v -p build/android
    - cd godot_project
    - godot -v --export-debug "Android Debug" ../build/android/$EXPORT_NAME-debug.apk
    - test -e ../build/android/$EXPORT_NAME-debug.apk
  artifacts:
    name: $EXPORT_NAME-$CI_JOB_NAME
    paths:
      - build/android
  only:
    - master

What am I missing here?

Target path appears to be invalid?

ERROR: Project export failed for preset "Linux". The target path "../build/linux/chess.x86_64" appears to be invalid.
   at: _fs_changed (editor/editor_node.cpp:801)

This is probably 'not our bug' but I don't understand it.

Script class not found

When I build the project with this docker image, I get for example this error:
**SCRIPT ERROR**: Parse Error: The identifier "Health" isn't a valid type (not a script or class), or couldn't be found on base "self".

But building it locally works fine. I tried 3.2.2, 3.2.1 and latest but they all cause this error. Not sure if the problem is in this docker image. I assume it is since it works locally.

`editor_settings-3.tres` not set by dockerfile?

see here:

cat: /github/home/.config/godot/editor_settings-3.tres: No such file or directory
find: '/github/home/.config': No such file or directory
...
ERROR: Cannot export project with preset "Android" due to configuration errors:
Debug keystore not configured in the Editor Settings nor in the preset.
A valid Android SDK path is required in Editor Settings.
   at: _fs_changed (editor/editor_node.cpp:778)
ERROR: Project export failed with error code 3 for preset "Android".
   at: _fs_changed (editor/editor_node.cpp:801)

Android export fail : no valid Android SDK Path

ERROR: _fs_changed: Cannot export project with preset 'Android Debug' due to configuration errors:
A valid Android SDK path is required in Editor Settings.

This error appears when android debug export is setup using the demo ci stage. I don't know if I did something wrong or if it's a bug that needs to be fixed in the docker image.

Version: 3.3.2

Recommended way to get SVG support (or install anything at all)

Hello, thank you for this repo!
I was wondering how to add SVG load support inside of the VM, because I'm getting these errors at the moment:
Capture

I tried the following, but installing with apt-get doesn't seem to work:

image: barichello/godot-ci:3.2

stages:
  - export

before_script:
  - mkdir -v -p build/windows

windows:
  stage: export
  script:
    - apt-get update -y
    - apt-get install -y gwenview
    - cd GodotProject
    - godot -v --export-debug "Windows Desktop" ../build/windows/$EXPORT_NAME.exe
    - test -e ../build/windows/$EXPORT_NAME.exe
  artifacts:
    name: $EXPORT_NAME-$CI_JOB_NAME
    paths:
      - build/windows
  only:
      - master

Any idea how I should do this?

3.2.4rc3 temporary build

I'm here because I have an M1 mac and I'd like to use this CI build. Could we have a build for the latest RC?

Support android exports

Just polling how hard it would be to add a way to export to Android?
Would it be a lot of work or is it just a single text line away?

Update to 3.1

Provide docker image for alpha builds of 3.1 while the stable version isn't released.

Failing Windows build on missing template

Yo, trying to get the basic workflow set up, and I'm running into this error trying to get it working with Godot mono 3.2.3

ERROR: copy: Failed to open res://bin/win64/release/libgitapi.dll
savepack: end
   At: core/os/dir_access.cpp:298.
ERROR: _fs_changed: Project export failed for preset 'Windows', the export template appears to be missing.
   At: editor/editor_node.cpp:753.
reimport: end
ERROR: init_library:  does not have a library for the current platform.
   At: modules/gdnative/nativescript/nativescript.cpp:1483.
EditorSettings: Save OK!
Mono: Finalizing scripts domain...
Mono: Unloading scripts domain...
Mono: Runtime cleanup...
Mono: Finalized
Error: Process completed with exit code 1.

Anything I'm doing wrong here? All I changed from the example build yml in the main repo was the versions and changed to using the root file path instead of a subdir like test-proj

Here's a link to my workflow yml

mv: cannot stat '/root/.local/share/godot/templates/3.4.4.stable': No such file or directory

Steps to reproduce:
[in .yml]

name: "godot-ci export"
on: push

env:
  GODOT_VERSION: 3.4.4
  EXPORT_NAME: export_name

jobs:
  export-windows:
    name: Windows Export
    runs-on: ubuntu-20.04
    container:
      image: barichello/godot-ci:mono-3.4.4
    steps:
      - name: Checkout
        uses: actions/checkout@v2
        with:
          lfs: true
          
      - name: Setup
        run: |
          mkdir -v -p ~/.local/share/godot/templates
          mv /root/.local/share/godot/templates/${GODOT_VERSION}.stable ~/.local/share/godot/templates/${GODOT_VERSION}.stable
      - name: Windows Build
        run: |
          mkdir -v -p build/windows
          cd $EXPORT_NAME
          godot -v --export "Windows Desktop" ../build/windows/$EXPORT_NAME.exe
      - name: Upload Artifact
        uses: actions/upload-artifact@v1
        with:
          name: windows
          path: build/windows

Error @setup

Run mkdir -v -p ~/.local/share/godot/templates
  mkdir -v -p ~/.local/share/godot/templates
  mv /root/.local/share/godot/templates/${GODOT_VERSION}.stable ~/.local/share/godot/templates/${GODOT_VERSION}.stable
  shell: sh -e {0}
  env:
    GODOT_VERSION: 3.4.4
    EXPORT_NAME: test-project
mkdir: created directory '/github/home/.local'
mkdir: created directory '/github/home/.local/share'
mkdir: created directory '/github/home/.local/share/godot'
mkdir: created directory '/github/home/.local/share/godot/templates'
mv: cannot stat '/root/.local/share/godot/templates/3.4.4.stable': No such file or directory
Error: Process completed with exit code 1.

Gitlab Pages

Currently I'm trying to use your image in gitlab ci/cd to deploy the game in gitlab pages. The game is exported and the artifact uploaded but the page it's not being served. You know anything about it? I'm sorry I know this isn't the propper channel but I couldn't find any answer so far.

image: barichello/godot-ci:3.1.1

variables:
  EXPORT_NAME: Hormiga de Langhton

stages:
  - build

web:
  stage: build
  script:
    - mkdir public
    - godot -v --export HTML5 public/index.html
  artifacts:
    name: $EXPORT_NAME-$CI_JOB_NAME
    paths:
    - public
  only:
    - master

iOS and Android export

Is it possible to create iOS and/or Android builds with this action? I want to deploy my test builds to Firebase App Distribution and/or Testflight/Google Play Beta Testing.

Add Git LFS support to GitHub Actions

I came across this issue and was convinced that #42 was the solution, as Git LFS is just a pointer to an asset file, yet on my action I'm still getting this during the Godot build step.

 Loading resource: res://default_bus_layout.tres
CORE API HASH: 17947557007960061372
EDITOR API HASH: 513236543915789544
Loading resource: res://default_env.tres
Construct gdnative interface

Destruct gdnative interface

Class 'BulletPhysicsDirectBodyState' is not exposed, skipping.
Class 'BulletPhysicsDirectSpaceState' is not exposed, skipping.
Class 'BulletPhysicsServer' is not exposed, skipping.
Class 'GDScriptNativeClass' is not exposed, skipping.
Class 'IP_Unix' is not exposed, skipping.
Class 'InputDefault' is not exposed, skipping.
Class 'Physics2DDirectBodyStateSW' is not exposed, skipping.
Class 'Physics2DDirectSpaceStateSW' is not exposed, skipping.
Class 'Physics2DServerSW' is not exposed, skipping.
Class 'ResourceImporterOGGVorbis' is not exposed, skipping.
Loaded builtin certs
EditorSettings: Save OK!
ERROR: get_dependencies: Cannot open file 'res://.import/main_drone.wav-e7b91ac508da6fec514ab395df887ae8.sample'.
reimport: begin: (Re)Importing Assets steps: 2
   At: core/io/resource_format_binary.cpp:1047.
WARNING: check_error: Not a PNG file
   At: drivers/png/png_driver_common.cpp:56.
ERROR: png_to_image: Condition "!success" is true. Returned: ERR_FILE_CORRUPT
   At: drivers/png/png_driver_common.cpp:69.
ERROR: load_image: Error loading image: res://characters/player/dropship.png
   At: core/io/image_loader.cpp:69.
ERROR: _reimport_file: Error importing 'res://characters/player/dropship.png'.
   At: editor/editor_file_system.cpp:1801.
ERROR: import: Method failed. Returning: ERR_FILE_UNRECOGNIZED
   At: editor/import/resource_importer_wav.cpp:110.
ERROR: _reimport_file: Error importing 'res://levels/start/main_drone.wav'.
   At: editor/editor_file_system.cpp:1801.
	reimport: step 0: dropship.png
	reimport: step 1: main_drone.wav
savepack: begin: Packing steps: 102
	savepack: step 2: Storing File: res://characters/player/Dropship.gdc
	savepack: step 12: Storing File: res://characters/player/Dropship.tscn
	savepack: step 22: Storing File: res://characters/player/dropship.png.import
	savepack: step 32: Storing File: res://default_bus_layout.tres
	savepack: step 42: Storing File: res://default_env.tres
	savepack: step 52: Storing File: res://levels/start/debug_overlay.gdc
	savepack: step 62: Storing File: res://levels/start/debug_overlay.tscn
	savepack: step 72: Storing File: res://levels/start/main.gdc
	savepack: step 82: Storing File: res://levels/start/main.tscn
	savepack: step 92: Storing File: res://levels/start/main_drone.wav.import
	savepack: step 102: Storing File: res://characters/player/Dropship.gd.remap
	savepack: step 102: Storing File: res://levels/start/debug_overlay.gd.remap
	savepack: step 102: Storing File: res://levels/start/main.gd.remap
	savepack: step 102: Storing File: res://project.binary
savepack: end
reimport: end
EditorSettings: Save OK!

I'm not sure what is going wrong, as the same command on my local Linux install ends up with this output:

Loading resource: res://default_bus_layout.tres
CORE API HASH: 17947557007960061372
EDITOR API HASH: 513236543915789544
Loading resource: res://default_env.tres
Construct gdnative interface

Destruct gdnative interface

Class 'BulletPhysicsDirectBodyState' is not exposed, skipping.
Class 'BulletPhysicsDirectSpaceState' is not exposed, skipping.
Class 'BulletPhysicsServer' is not exposed, skipping.
Class 'GDScriptNativeClass' is not exposed, skipping.
Class 'IP_Unix' is not exposed, skipping.
Class 'InputDefault' is not exposed, skipping.
Class 'Physics2DDirectBodyStateSW' is not exposed, skipping.
Class 'Physics2DDirectSpaceStateSW' is not exposed, skipping.
Class 'Physics2DServerSW' is not exposed, skipping.
Class 'ResourceImporterOGGVorbis' is not exposed, skipping.
Loading resource: /home/lallmon/.config/godot/editor_settings-3.tres
EditorSettings: Load OK!
Loaded builtin certs
Socket error: 98
Failed to bind socket.
EditorSettings: Save OK!
savepack: begin: Packing steps: 102
        savepack: step 2: Storing File: res://characters/player/Dropship.gdc
        savepack: step 12: Storing File: res://characters/player/Dropship.tscn
        savepack: step 22: Storing File: res://.import/dropship.png-52d39f01f20c8beea9e2a7cba7aee1d1.stex
        savepack: step 22: Storing File: res://characters/player/dropship.png.import
        savepack: step 32: Storing File: res://default_bus_layout.tres
        savepack: step 42: Storing File: res://default_env.tres
        savepack: step 52: Storing File: res://levels/start/debug_overlay.gdc
        savepack: step 62: Storing File: res://levels/start/debug_overlay.tscn
        savepack: step 72: Storing File: res://levels/start/main.gdc
        savepack: step 82: Storing File: res://levels/start/main.tscn
        savepack: step 92: Storing File: res://.import/main_drone.wav-e7b91ac508da6fec514ab395df887ae8.sample
        savepack: step 92: Storing File: res://levels/start/main_drone.wav.import
        savepack: step 102: Storing File: res://characters/player/Dropship.gd.remap
        savepack: step 102: Storing File: res://levels/start/debug_overlay.gd.remap
        savepack: step 102: Storing File: res://levels/start/main.gd.remap
        savepack: step 102: Storing File: res://project.binary
savepack: end
Loading resource: res://levels/start/debug_overlay.gd
Loading resource: res://characters/player/Dropship.gd
Loading resource: res://levels/start/main.gd
EditorSettings: Save OK!

Any ideas as to why this might be happening? It results in a build that crashes on startup.

😢

Add mono version

I made a mono version recently and it works fine.

We opted to update this repo instead of linking to a separate one, see #15.

  • Modify Dockerfile to build mono #16
  • Add new builds to docker hub
  • Update readme with usage instructions for the mono image

Error when exporting project

Hi,

It might not be at all an issue of the Docker image but I figured someone might have encountered that issue already.

I'm using Circle CI to export my project for HTML, Windows and macOS. For each of them I'm getting this error when running godot --export:

ERROR: ~List: Condition "_first != __null" is true.
 
   At: ./core/self_list.h:112.
 
ERROR: cleanup: There are still MemoryPool allocs in use at exit!
 
   At: core/pool_vector.cpp:69.

The build still passes and the builds are there but it seems they are broken (I can only test the macOS/HTML one).

When I run godot --export on my machine it works fine.

Any idea on what's going on?

This is the Circle CI config file:

version: 2.1
jobs:
  build:
    docker: 
      - image: barichello/godot-ci
    steps:
      - checkout
      - run: |
          mkdir -p ./build/chroma-dungeon-browser
          mkdir -p ./build/windows
          mkdir -p ./build/macos
      - run: godot --export windows-desktop ./build/windows/chroma-dungeon.exe
      - run: godot --export macos ./build/macos/chroma-dungeon.dmg
      - run: godot --export html ./build/chroma-dungeon-browser/index.html
      - run: butler push ./build/windows/chroma-dungeon.exe caldera-games/chroma-dungeon:windows
      - run: butler push ./build/macos/chroma-dungeon.dmg caldera-games/chroma-dungeon:macos
      - run: butler push ./build/chroma-dungeon-browser caldera-games/chroma-dungeon:browser

Another "a valid android sdk path is required in editor settings", no valid Android SDK Path, same as #59 and #68

Using image barichello/godot-ci:3.4.4 (with GitHub), basically the same issue as #59 and #68. To get it to see the Android SDK path in /usr/lib/android-sdk, I had to run in the steps:

sed 's|export/android/android_sdk_path = ".*"|export/android/android_sdk_path = "'/usr/lib/android-sdk'"|g' -i /root/.config/godot/editor_settings-3.tres
mkdir -v -p ~/.config/godot
cp -v /root/.config/godot/editor_settings-3.tres ~/.config/godot/

Before doing this, it wouldn't detect the Android SDK path at all, but after these lines are added it worked perfectly.

Git Worktree

Hey, I'm getting this error when deploying to github pages.

/usr/bin/git worktree add --checkout github-pages-deploy-action-temp-deployment-folder origin/gh-pages
Preparing github-pages-deploy-action-temp-deployment-folder (identifier github-pages-deploy-action-temp-deployment-folder)
HEAD is now at 0b4b99a Deploying to gh-pages from @ 59d1b5aa0c54698bf3976c1b5e2f8451916e17c8 🚀
/usr/bin/rsync -q -av --checksum --progress build/web/. github-pages-deploy-action-temp-deployment-folder --exclude .ssh --exclude .git --exclude .github
/usr/bin/git status --porcelain
M index.pck
/usr/bin/git add --all .
/usr/bin/git checkout -b github-pages-deploy-action/yqcvcm0um
Switched to a new branch 'github-pages-deploy-action/yqcvcm0um'
M index.pck
/usr/bin/git commit -m Deploying to gh-pages from @ 9027b690b7b0935ebd6e953cfca476acb0f83308 🚀 --quiet
/usr/bin/git push --force ***github.com/ugdt/zelcrawler.git github-pages-deploy-action/yqcvcm0um:gh-pages
To https://github.com/ugdt/zelcrawler.git
0b4b99a..8119bbc github-pages-deploy-action/yqcvcm0um -> gh-pages
Changes committed to the gh-pages branch… 📦
/usr/bin/git checkout --progress --force 9027b690b7b0935ebd6e953cfca476acb0f83308
HEAD is now at 9027b69... Update github-pages
Running post deployment cleanup jobs… 🗑️
/usr/bin/git worktree remove github-pages-deploy-action-temp-deployment-folder --force
usage: git worktree add [] []
or: git worktree list []
or: git worktree lock []
or: git worktree prune []
or: git worktree unlock

##[error]The process '/usr/bin/git' failed with exit code 129

Gitlab pages CI requires git fetch

Gitlab pages, out of the box, doesn't seem to want to checkout my "pages" orphan branch.

failure

Adding a "git fetch" command to the command stack seems to fix the issue.

success

Would it be possible and/or a good idea to add "git fetch" to the command stack to avoid any unnecessary headaches for future adopters? I don't think there's any big disadvantage that appears when adding it?

Usage tip for mono: Non-build jobs (like uploading to itch) should use non-mono image

The mono image is significantly larger. Using the non-mono image for jobs other than building results in almost a minute less time for each of these jobs.

It is possible to change the image for separate jobs manually but it has to be added to each job separately as an extra specifier.

We currently only have one gitlab-ci.yml script in the repo so it would be weird to change it since it would make the non-mono users confused. It would work better as a tip in the README file.

I wonder if we can use an ENV variable as an image reference and have that be used for non-build jobs? That would make it so there's only one extra line that needs to be changed when updating the version, and wouldn't annoy non-mono users as much.

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.