abarichello / godot-ci

Docker image to export Godot Engine games. Templates for Gitlab CI and GitHub Actions to deploy to GitLab Pages/GitHub Pages/Itch.io.
https://hub.docker.com/r/barichello/godot-ci
MIT License
759 stars 133 forks source link

Unable to load any resources (4.2.1) #127

Open Jodebu opened 11 months ago

Jodebu commented 11 months ago

When exporting, the engine is not able to find any of the resources of the project, The binaries will build, but they will be completely broken when you try to execute them. This issue does not appear on local.

The only thing I can think of is that the .godot/imported/ folder is not being generated on the expected place, but I am really not sure. Could you please provide where is it supposed to be?

Here is my YAML file:

name: "Build and export"
on: 
  push:
    branches:
      - main
      - develop

env:
  GODOT_VERSION: 4.2.1
  EXPORT_NAME: OBMar
  PROJECT_PATH: .
  EXPORT_TYPE: ${{ github.ref_name == 'main' && 'release' || 'debug'}}

jobs:
  export:
    name: Export
    runs-on: ubuntu-20.04
    container:
      image: barichello/godot-ci:4.2.1
    strategy: 
      matrix:
        include:
          - os: "windows"
            name: "Windows Desktop"
            extension: "exe"
          - os: "linux"
            name: "Linux/X11"
            extension: "x86_64"
          - os: "mac"
            name: "Mac OSX"
            extension: "zip"
    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/templates/${GODOT_VERSION}.stable ~/.local/share/godot/export_templates/${GODOT_VERSION}.stable
      - name: Build
        run: |
          mkdir -v -p build/${{ matrix.os }}
          cd $PROJECT_PATH
          godot --headless --verbose --export-${EXPORT_TYPE} "${{ matrix.name }}" build/${{ matrix.os }}/$EXPORT_NAME.${{ matrix.extension }}
      - name: Upload Artifact
        uses: actions/upload-artifact@v1
        with:
          name: ${{ matrix.os }}
          path: build/${{ matrix.os }}

And here is an extract from one of the jobs: imagen

Thank you very much in advance

Calinou commented 11 months ago

The GDExtension library error message implies you're using Windows runners to export the project, which sounds unexpected.

Can you reproduce this if you remove the Git plugin from the project files then commit changes?

Calinou commented 11 months ago

Judging from the CI log in the commit log, it looks like this is a regression from https://github.com/abarichello/godot-ci/pull/113. However, you're already using 4.2.1 in your CI manifest, so I don't know what's causing this.

komdog commented 10 months ago

I'm having the same issue; it won't import any of my assets, and my classes with static variables and functions aren't recognized either.

image

image

Save.gd is a standalone script with a few static functions and variables. that are being called / reference by an autoload singleton called SceneManager

HunterNN commented 10 months ago

We're encountering a similar issue. When we started our CI workflow with Godot 4.2.1, we thought that manually starting Godot once was necessary to generate the '.godot' folder. We used the following command as a workaround: godot --project . --headless --quit-after 200 -e 2>/dev/null

However, we later encountered another issue where our shader did not work on web export due to problems with the '.godot' folder. Upon reviewing example repositories, we realized that this initial step should not be necessary at all. It seems that the '.godot' folder should also be generated when running godot --headless --export-release ... (?). Could this be a bug in Godot itself?

jeremyhcho commented 9 months ago

I can't seem to get this to work with 4.2.1 on Linux. The general workaround that I've been reading around this has been to run something like timeout 20s godot --headless --editor and then run Godot with --export-release but nothing I do gets the .godot/imported folder to generate.

I've gotten the workaround to behave as expected on a Windows machine :/

HonKLam commented 9 months ago

Not sure if it will help anyone, but I encountered this problem as well and just disabled all plugins / remove all plugins I was using in the project (it wasn't many) and after that I didn't get this error anymore.

Maybe it was just coincidence and it magically worked after a couple of trial and errors, but thought I might just get this one out there.

EvolHeartrise commented 9 months ago

Not sure if it will help anyone, but I encountered this problem as well and just disabled all plugins / remove all plugins I was using in the project (it wasn't many) and after that I didn't get this error anymore.

Maybe it was just coincidence and it magically worked after a couple of trial and errors, but thought I might just get this one out there.

Can also confirm, I have two projects in 4.2.1, one with addons/plugins, and one without. The one without had no issues at all, but the one with addons/plugins errored out.

LocoNeko commented 7 months ago

This is affecting me as well. Godot 4.2.1 on Linux, one add-on (Terrain 3D), and I get the Script Error / Parse Error. I can confirm my projects exports properly on my local machine using godot --headless.

Calinou commented 7 months ago

Does it work if you use this instead? The first command imports resources, the second one exports the project with resources already imported beforehand:

godot --headless --verbose --editor --quit-after 10
godot --headless --verbose --export-${EXPORT_TYPE} "${{ matrix.name }}" build/${{ matrix.os }}/$EXPORT_NAME.${{ matrix.extension }
LocoNeko commented 7 months ago

Does it work if you use this instead? The first command imports resources, the second one exports the project with resources already imported beforehand:

godot --headless --verbose --editor --quit-after 10
godot --headless --verbose --export-${EXPORT_TYPE} "${{ matrix.name }}" build/${{ matrix.os }}/$EXPORT_NAME.${{ matrix.extension }

No, I got the same error. This, however, works without any issues from the command line.

markim commented 3 months ago

Not sure if anyone is still getting errors from this, but as of Godot 4.3, the initial "Import-assets" step for gitlab ci should be this line:

godot --headless --verbose --import

keyword being: --import flag to import assets

Hope this helps someone!