firebelley / godot-export

Automatically exports your Godot games.
MIT License
460 stars 53 forks source link

Game won't export with action, but exports fine via Editor #129

Closed scharissis closed 6 months ago

scharissis commented 6 months ago

Exporting a Windows binary works fine via editor, but when exporting via godot-export action, I get 2000+ lines of errors and a binary which has no assets or signals and just generally doesn't run past its own main menu.

The game is written with GDScript and there is just one export template which is for Windows. Godot version: 4.2.1-stable (both editor and via Action) firebelley/godot-export: v5.2.1

Export settings: image

Action workflow:

name: Export, Tag & Release

on:
  workflow_dispatch:
  push:
    branches:
      - main

env:
  GODOT_VERSION: 4.2.1

jobs:
  release:
    runs-on: ubuntu-latest
    permissions: write-all
    name: Export & Github Release
    steps:
    - name: checkout
      uses: actions/checkout@v4
      with:
        fetch-depth: 0

    - name: export game
      id: export
      uses: firebelley/godot-export@v5.2.1
      with:
        godot_executable_download_url: https://github.com/godotengine/godot/releases/download/${{env.GODOT_VERSION}}-stable/Godot_v${{env.GODOT_VERSION}}-stable_linux.x86_64.zip
        godot_export_templates_download_url: https://github.com/godotengine/godot/releases/download/${{env.GODOT_VERSION}}-stable/Godot_v${{env.GODOT_VERSION}}-stable_export_templates.tpz
        relative_project_path: ./
        archive_output: true

The workflow has many many errors. Here is a sampling:

Exporting preset Windows Desktop
  /home/runner/.local/share/godot/godot_executable/Godot_v4.2.1-stable_linux.x86_64 /home/runner/work/game-cave-escape/game-cave-escape/project.godot --headless --export-release Windows Desktop /home/runner/.local/share/godot/builds/Windows Desktop/cave_escape.exe
  Godot Engine v4.2.1.stable.official.b09f793f5 - https://godotengine.org/
...
  ERROR: Unable to open file: res://.godot/imported/torch_01.png-bd6514e6684243296866378cdd76aa01.ctex.
     at: _load_data (scene/resources/compressed_texture.cpp:41)
  ERROR: Failed loading resource: res://.godot/imported/torch_01.png-bd6514e6684243296866378cdd76aa01.ctex. Make sure resources have been imported by opening the project in the editor at least once.
     at: _load (core/io/resource_loader.cpp:274)
  ERROR: Failed loading resource: res://assets/img/cursor/torch_01.png. Make sure resources have been imported by opening the project in the editor at least once.
     at: _load (core/io/resource_loader.cpp:274)
  WARNING: Custom cursor shape not supported by this display server.
       at: cursor_set_custom_image (servers/display_server.cpp:505)
...
ERROR: Failed to load script "res://src/autoloads/game_manager.gd" with error "Parse error".
     at: load (modules/gdscript/gdscript.cpp:2788)
...
  ERROR: Error importing 'res://assets/sounds/ambient/dungeon-air-6983.mp3'.
     at: _reimport_file (editor/editor_file_system.cpp:2050)
  ERROR: Failed to decode mp3 file. Make sure it is a valid mp3 audio file
...
ERROR: Condition "!success" is true. Returning: ERR_FILE_CORRUPT
     at: png_to_image (drivers/png/png_driver_common.cpp:69)
...
ERROR: Error importing 'res://assets/sounds/effects/voices/female/completion/all_done.wav'.
     at: _reimport_file (editor/editor_file_system.cpp:2050)
ERROR: Not a WAV file. File should start with 'RIFF', but found 'vers', in file of size 131 bytes
     at: import (editor/import/resource_importer_wav.cpp:110)
...
   WARNING: Project export for preset "Windows Desktop" completed with warnings.
       at: _fs_changed (editor/editor_node.cpp:997)
  reimport: end
  ERROR: 1 RID allocations of type 'P11GodotArea2D' were leaked at exit.
  ERROR: 1 RID allocations of type 'P12GodotShape2D' were leaked at exit.
  ERROR: 37 RID allocations of type 'N18RendererCanvasCull4ItemE' were leaked at exit.
  ERROR: 3 RID allocations of type 'N18RendererCanvasCull6CanvasE' were leaked at exit.
  ERROR: 23 RID allocations of type 'PN13RendererDummy14TextureStorage12DummyTextureE' were leaked at exit.
  ERROR: 25 RID allocations of type 'PN18TextServerAdvanced22ShapedTextDataAdvancedE' were leaked at exit.
  ERROR: 2 RID allocations of type 'PN18TextServerAdvanced12FontAdvancedE' were leaked at exit.
  WARNING: ObjectDB instances leaked at exit (run with --verbose for details).
       at: cleanup (core/object/object.cpp:2208)
  ERROR: Resources still in use at exit (run with --verbose for details).
     at: clear (core/io/resource.cpp:493)
  ERROR: Pages in use exist at exit in PagedAllocator: N7Variant5Pools11BucketSmallE
     at: ~PagedAllocator (./core/templates/paged_allocator.h:170)
scharissis commented 6 months ago

I am happy to report that this was actually my fault, not the action's. I simply hadn't configured my git-checkout step to use LFS, thus the fules were truly not present on the build host. This was the fix:

+++ b/.github/workflows/release.yaml
@@ -21,6 +21,7 @@ jobs:
       uses: actions/checkout@v4
       with:
         fetch-depth: 0
+        lfs: true