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

Include web export release templates #115

Closed
matheusfillipe opened this issue Jul 7, 2023 · 23 comments
Closed

Include web export release templates #115

matheusfillipe opened this issue Jul 7, 2023 · 23 comments

Comments

@matheusfillipe
Copy link

matheusfillipe commented Jul 7, 2023

My CI fails with:

ERROR: Cannot export project with preset "Web" due to configuration errors:
No export template found at the expected path:
/github/home/.local/share/godot/export_templates/4.0.3.stable/web_debug.zip
No export template found at the expected path:
/github/home/.local/share/godot/export_templates/4.0.3.stable/web_release.zip

Here is my yaml:

name: "godot-ci export"
on: push

env:
  GODOT_VERSION: 4.0.3

jobs:
  export-web:
    name: Web Export
    runs-on: ubuntu-20.04
    container:
      image: barichello/godot-ci:4.0.3
    steps:
      - name: Checkout
        uses: actions/checkout@v2
        with:
          lfs: true

      - name: WhatDoWeHave
        run: ls /root/.local/share/godot/templates/
      - 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: Web Build
        run: |
          mkdir -v -p build/web
          godot -v --headless --export-release "Web" build/web/index.html
      - name: Upload Artifact
        uses: actions/upload-artifact@v1
        with:
          name: web
          path: build/web
      - name: Install rsync 📚
        run: |
          apt-get update && apt-get install -y rsync
      - name: Deploy to GitHub Pages 🚀
        uses: JamesIves/github-pages-deploy-action@v4
        with:
          folder: build/web # The folder the action should deploy.

Ive noticed there is only 4.0.3.stable. Am I doing something wrong? Is there a better example of how to do this for gotot 4?

@loteque
Copy link
Contributor

loteque commented Jul 7, 2023 via email

@matheusfillipe
Copy link
Author

That is already with the templates exported. I have created and exported the cfg. Running it locally works: godot -v --headless --export-release "Web" build/web/index.html

$ cat export_presets.cfg 
[preset.0]

name="Web"
platform="Web"
runnable=true
dedicated_server=false
custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter=""
export_path=""
encryption_include_filters=""
encryption_exclude_filters=""
encrypt_pck=false
encrypt_directory=false
script_encryption_key=""

[preset.0.options]

custom_template/debug=""
custom_template/release=""
variant/extensions_support=false
vram_texture_compression/for_desktop=true
vram_texture_compression/for_mobile=false
html/export_icon=true
html/custom_html_shell=""
html/head_include=""
html/canvas_resize_policy=2
html/focus_canvas_on_start=true
html/experimental_virtual_keyboard=false
progressive_web_app/enabled=false
progressive_web_app/offline_page=""
progressive_web_app/display=1
progressive_web_app/orientation=0
progressive_web_app/icon_144x144=""
progressive_web_app/icon_180x180=""
progressive_web_app/icon_512x512=""

@loteque
Copy link
Contributor

loteque commented Jul 7, 2023

What is the output of this step:

- name: WhatDoWeHave 
  run: ls /root/.local/share/godot/templates/

@matheusfillipe
Copy link
Author

The output of that step is 4.0.3.stable

What is the output of this step:

- name: WhatDoWeHave 
  run: ls /root/.local/share/godot/templates/

@matheusfillipe
Copy link
Author

https://github.com/matheusfillipe/duckhunt/actions/runs/5484625994/jobs/9992418250

@loteque
Copy link
Contributor

loteque commented Jul 7, 2023

Looks like you figured out the error? Well done! What steps did you take for the fix?

@matheusfillipe
Copy link
Author

No that is actually how it has been always failing. The status is displayed wrong on github actions (but thats another issue). I made no progress:
image

ERROR: Cannot export project with preset "Web" due to configuration errors:
No export template found at the expected path:
/github/home/.local/share/godot/export_templates/4.0.3.stable/web_debug.zip
No export template found at the expected path:
/github/home/.local/share/godot/export_templates/4.0.3.stable/web_release.zip

@jonathaneeckhout
Copy link

jonathaneeckhout commented Jul 7, 2023

Getting the same error for linux:

ERROR: Cannot export project with preset "Linux/X11" due to configuration errors:
No export template found at the expected path:
/github/home/.local/share/godot/export_templates/4.1.stable/linux_debug.x86_64
No export template found at the expected path:
/github/home/.local/share/godot/export_templates/4.1.stable/linux_release.x86_64

Run:
https://github.com/jonathaneeckhout/jdungeon-level-server/actions/runs/5489147462/jobs/10002923664

But I am trying with Godot 4.1. Workflow can be found here:
https://github.com/jonathaneeckhout/jdungeon-level-server/blob/main/.github/workflows/godot-ci.yml

@loteque
Copy link
Contributor

loteque commented Jul 7, 2023

ok, the error is telling us that no templates are present when they should be. I haven't been using godot 4 yet but I use CI for Godot 3 often. I'm going to investigate a little further. It looks like this is happening for both Godot 4.1 and 4.0.3. If you add this task what is its output:

- name: listTemplates
  run: ls /root/.local/share/godot/templates/{GODOT_VERSION}.stable/

@jonathaneeckhout
Copy link

(I don't want to hijack the issue if I am not looking at the same thing) But I already did so:

Run ls /root/.local/share/godot/templates/4.1.stable/
android_debug.apk
android_release.apk
android_source.zip
ios.zip
linux_debug.x86_32
linux_debug.x86_64
linux_release.x86_32
linux_release.x86_64
macos.zip
version.txt
web_debug.zip
web_dlink_debug.zip
web_dlink_release.zip
web_release.zip
windows_debug_x86_32.exe
windows_debug_x86_32_console.exe
windows_debug_x86_64.exe
windows_debug_x86_64_console.exe
windows_release_x86_32.exe
windows_release_x86_32_console.exe
windows_release_x86_64.exe
windows_release_x86_64_console.exe

@jonathaneeckhout
Copy link

Seems like there is something going wrong with the copy, When I do a "ls" of the final directory, it fails:

Run ls /github/home/.local/share/godot/export_templates/4.1.stable/
ls: cannot access '/github/home/.local/share/godot/export_templates/4.1.stable/': No such file or directory

@matheusfillipe
Copy link
Author

      - name: listTemplates
        run: ls /root/.local/share/godot/templates/*/
Run ls /root/.local/share/godot/templates/*/
android_debug.apk
android_release.apk
android_source.zip
ios.zip
linux_debug.x86_32
linux_debug.x86_64
linux_release.x86_32
linux_release.x86_64
macos.zip
version.txt
web_debug.zip
web_dlink_debug.zip
web_dlink_release.zip
web_release.zip
windows_debug_x86_32.exe
windows_debug_x86_32_console.exe
windows_debug_x86_64.exe
windows_debug_x86_64_console.exe
windows_release_x86_32.exe
windows_release_x86_32_console.exe
windows_release_x86_64.exe
windows_release_x86_64_console.exe

@jonathaneeckhout
Copy link

I think I've found the issue:
https://github.com/abarichello/godot-ci/blob/master/.github/workflows/godot-ci.yml#L22

This path should be:
mkdir -v -p ~/.local/share/godot/export_templates

Next line needs to be adjusted as well.

Testing it right now.

@jonathaneeckhout
Copy link

It did fix the initial error but a new one popped up:

reimport: begin: (Re)Importing Assets steps: 1
reimport: step 0: icon.svg
ERROR: Prepare Template: The given export path doesn't exist.
at: add_message (editor/export/editor_export_platform.h:178)
ERROR: Project export for preset "Linux/X11" failed.
at: _fs_changed (editor/editor_node.cpp:1003)

@jonathaneeckhout
Copy link

Got it working, thanks for help:
https://github.com/jonathaneeckhout/jdungeon-level-server/actions/runs/5489502541

I needed to adjust my path of the output dir:
https://github.com/abarichello/godot-ci/blob/master/.github/workflows/godot-ci.yml#L53
Changed that line to:
build/linux/$EXPORT_NAME.x86_64

@matheusfillipe
Copy link
Author

I think I've found the issue: https://github.com/abarichello/godot-ci/blob/master/.github/workflows/godot-ci.yml#L22

This path should be: mkdir -v -p ~/.local/share/godot/export_templates

Next line needs to be adjusted as well.

Testing it right now.

That fixes the issue, I also have other issues now: https://github.com/matheusfillipe/duckhunt/actions/runs/5489488472/jobs/10003706813

This is godot 4 specific godotengine/godot#63093

@matheusfillipe
Copy link
Author

@matheusfillipe let us know if making these changes to your yml fixes your issue!

Yes it does!

@loteque
Copy link
Contributor

loteque commented Jul 7, 2023

That fixes the issue, I also have other issues now: https://github.com/matheusfillipe/duckhunt/actions/runs/5489488472/jobs/10003706813

Error: The deploy step encountered an error: The process '/usr/bin/git' failed with exit code 128 ❌

Make sure read and write permissions are set on workflows:
https://github.com/<your-github-username>/<your-repository-name>/settings/actions
image

@matheusfillipe
Copy link
Author

Thanks a lot @loteque and @jonathaneeckhout. All is working now. Also had to set to deploy from a branch:

image

name: "godot-ci export"
on: push

env:
  GODOT_VERSION: 4.0.3

jobs:
  export-web:
    name: Web Export
    runs-on: ubuntu-20.04
    container:
      image: barichello/godot-ci:4.0.3
    steps:
      - name: Checkout
        uses: actions/checkout@v2
        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: Web Build
        run: |
          mkdir -v -p build/web
          godot -v --headless --export-release "Web" build/web/index.html
      - name: Upload Artifact
        uses: actions/upload-artifact@v1
        with:
          name: web
          path: build/web
      - name: Install rsync 📚
        run: |
          apt-get update && apt-get install -y rsync
      - name: Deploy to GitHub Pages 🚀
        uses: JamesIves/github-pages-deploy-action@v4
        with:
          folder: build/web # The folder the action should deploy.

I think is not possible to host games on github pages anymore though:

image

Don't know if they have such configuration.

@matheusfillipe
Copy link
Author

Anyway thats another issue and nothing to do with what this workflow should do. Feel free to close this one!

@matheusfillipe
Copy link
Author

Based on the comments here I have a very hacky workaround for that:

    name: "godot-ci export"
on: push

env:
  GODOT_VERSION: 4.0.3

jobs:
  export-web:
    name: Web Export
    runs-on: ubuntu-20.04
    container:
      image: barichello/godot-ci:4.0.3
    steps:
      - name: Checkout
        uses: actions/checkout@v2
        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: Web Build
        run: |
          mkdir -v -p build/web
          godot -v --headless --export-release "Web" build/web/index.html
      - name: Install rsync 📚
        run: |
          apt-get update && apt-get install -y rsync curl
      - name: Patch for Cross Origin Isolation and SharedArrayBuffer
        run: |
          cd build/web/
          curl https://raw.githubusercontent.com/josephrocca/clip-image-sorter/92b108dc670d0b56bd6b72963b0e86c4c862412e/enable-threads.js --output enable-threads.js
          sed -i 's|headers.set("Cross-Origin-Embedder-Policy", "credentialless")|headers.set("Cross-Origin-Embedder-Policy", "require-corp")|g'  enable-threads.js
          sed -i 's|<script src="index.js"></script>|<script src="enable-threads.js"></script><script src="index.js"></script>|g' index.html
      - name: Upload Artifact
        uses: actions/upload-artifact@v1
        with:
          name: web
          path: build/web
      - name: Deploy to GitHub Pages 🚀
        uses: JamesIves/github-pages-deploy-action@v4
        with:
          folder: build/web # The folder the action should deploy.

The game loads after taking quite a while to load but loads.

@loteque
Copy link
Contributor

loteque commented Jul 7, 2023

@matheusfillipe can you open a new issue concerning the crossorigin requirements? That seems like something we should make visible.

@matheusfillipe
Copy link
Author

#116

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants