Skip to content

Commit

Permalink
Fix web demos CI for Godot 4.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Calinou committed Oct 28, 2024
1 parent 53d3f9c commit 8f6ae60
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 49 deletions.
34 changes: 26 additions & 8 deletions .github/dist/export_presets.cfg
Original file line number Diff line number Diff line change
@@ -1,23 +1,41 @@
[preset.0]

name="HTML5"
platform="HTML5"
name="Web"
platform="Web"
runnable=true
advanced_options=false
dedicated_server=false
custom_features=""
export_filter="all_resources"
include_filter="*.json"
include_filter=""
exclude_filter=""
export_path=""
script_export_mode=1
script_encryption_key=""
encryption_include_filters=""
encryption_exclude_filters=""
encrypt_pck=false
encrypt_directory=false
script_export_mode=2

[preset.0.options]

custom_template/debug=""
custom_template/release=""
variant/export_type=0
variant/extensions_support=false
variant/thread_support=true
vram_texture_compression/for_desktop=true
vram_texture_compression/for_mobile=false
vram_texture_compression/for_mobile=true
html/export_icon=true
html/custom_html_shell=""
html/head_include=""
html/full_window_size=true
html/canvas_resize_policy=2
html/focus_canvas_on_start=true
html/experimental_virtual_keyboard=true
progressive_web_app/enabled=true
progressive_web_app/ensure_cross_origin_isolation_headers=true
progressive_web_app/offline_page=""
progressive_web_app/display=0
progressive_web_app/orientation=1
progressive_web_app/icon_144x144=""
progressive_web_app/icon_180x180=""
progressive_web_app/icon_512x512=""
progressive_web_app/background_color=Color(0, 0, 0, 1)
2 changes: 1 addition & 1 deletion .github/dist/footer.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- The list of demos will be inserted above by the CI process. -->
</ul>
<h2>Unavailable demos</h2>
<h2>Unavailable demos (TODO: Update list)</h2>
<ul>
<li><code>2d/hdr/</code>: Not supported on HTML5 yet.</li>
<li><code>3d/global_illumination/</code>: Not supported on HTML5 yet (freezes the browser).</li>
Expand Down
10 changes: 5 additions & 5 deletions .github/dist/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Godot demos exported to HTML5</title>
<title>Official Godot demos exported to Web</title>
<style>
:root {
--background-color: #fff;
Expand Down Expand Up @@ -96,12 +96,12 @@ <h1>Godot demo projects</h1>
<p>
This page lists
<a href="https://github.com/godotengine/godot-demo-projects">official Godot demo projects</a>
exported to HTML5 for testing purposes. These projects are deployed automatically
exported to the web for testing purposes. These projects are deployed automatically
on every commit on the <code>master</code> branch of the repository.
</p>
<p>
The HTML5 exports on this page are provided for demonstration purposes only.
Some of these demos may not function or render correctly on HTML5,
The web exports on this page are provided for demonstration purposes only.
Some of these demos may not function or render correctly on the web platform,
especially on mobile devices.
For best performance, it's recommended to
<a href="https://godotengine.org/download">download</a> a native editor
Expand All @@ -110,7 +110,7 @@ <h1>Godot demo projects</h1>
<p>
See the
<a href="https://docs.godotengine.org/en/stable/getting_started/workflow/export/exporting_for_web.html">Exporting for the Web</a>
documentation for information on exporting your own projects to HTML5.
documentation for information on exporting your own projects to the web.
</p>

<h2>List of demos</h2>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,55 +1,55 @@
name: Export projects to HTML5 and deploy to GitHub Pages
name: Export projects to Web and deploy to GitHub Pages
on:
push:
branches:
- master
#branches:
# - master !!! FIXME: Uncomment before opening a PR !!!

env:
GODOT_VERSION: 3.3.3
GODOT_VERSION: 4.3

jobs:
export-html5:
name: Export projects to HTML5 and deploy to GitHub Pages
runs-on: ubuntu-20.04
name: Export projects to Web and deploy to GitHub Pages
runs-on: ubuntu-24.04
container:
image: barichello/godot-ci:3.3.3
image: barichello/godot-ci:4.3
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup
run: |
mkdir -p ~/.local/share/godot/templates/
mv /root/.local/share/godot/templates/$GODOT_VERSION.stable ~/.local/share/godot/templates/$GODOT_VERSION.stable
mkdir -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: Export projects to HTML5
- name: Export projects to Web
run: |
apt-get update -qq && apt-get install -qqq imagemagick
# Don't export Mono demos (not supported yet), demos that can't be run in HTML5
# since they're platform-specific or demos that are currently broken in HTML5.
# Don't export Mono demos (not supported yet), demos that can't be run in Web
# since they're platform-specific or demos that are currently broken in Web.
# Remember to update `.github/dist/footer.html` when updating the list of excluded demos.
rm -rf \
2d/hdr/ \
3d/global_illumination/ \
3d/voxel/ \
audio/device_changer/ \
loading/background_load/ \
loading/multiple_threads_loading/ \
loading/threads/ \
misc/matrix_transform/ \
mobile/android_iap/ \
mobile/sensors/ \
mono/ \
networking/ \
plugins/
#rm -rf \
# 2d/hdr/ \
# 3d/global_illumination/ \
# 3d/voxel/ \
# audio/device_changer/ \
# loading/background_load/ \
# loading/multiple_threads_loading/ \
# loading/threads/ \
# misc/matrix_transform/ \
# mobile/android_iap/ \
# mobile/sensors/ \
# mono/ \
# networking/ \
# plugins/
for panorama in 3d/material_testers/backgrounds/*.hdr; do
#for panorama in 3d/material_testers/backgrounds/*.hdr; do
# Decrease the resolution to get below the 20 MB per-file limit.
# Otherwise, the website can't be deployed as files larger than 20 MB
# can't be pushed to GitHub anymore.
mogrify -resize 75% "$panorama"
done
# mogrify -resize 75% "$panorama"
#done
BASEDIR="$PWD"
Expand All @@ -63,13 +63,13 @@ jobs:
mkdir -p "$BASEDIR/.github/dist/$demo"
cd "$BASEDIR/$demo"
# Copy an export template preset file configured for HTML5 exporting.
# Copy an export template preset file configured for Web exporting.
# This way, we don't have to commit `export_presets.cfg` for each project.
cp "$BASEDIR/.github/dist/export_presets.cfg" .
godot --export "HTML5" "$BASEDIR/.github/dist/$demo/index.html"
godot --headless --export-release "Web" "$BASEDIR/.github/dist/$demo/index.html"
# Replace the WASM file with a symbolic link to avoid duplicating files in the pushed branch.
# (WASM files are identical across projects, but not PCK or HTML files.)
# (WASM files are identical across projects, but not PCK or HTML/JavaScript files.)
mv -f "$BASEDIR/.github/dist/$demo/index.wasm" "$BASEDIR/.github/dist/index.wasm"
# The symlink must be relative as it needs to point to a file within the pushed repository.
ln -s "../../index.wasm" "$BASEDIR/.github/dist/$demo/index.wasm"
Expand All @@ -89,7 +89,7 @@ jobs:
run: |
apt-get update -qq && apt-get install -qqq rsync
- name: Deploy to GitHub Pages 🚀
uses: JamesIves/github-pages-deploy-action@releases/v3
uses: JamesIves/github-pages-deploy-action@releases/v4
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# The branch the action should deploy to.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/static_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: [push, pull_request]
jobs:
format:
name: File formatting (file_format.sh)
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down

0 comments on commit 8f6ae60

Please sign in to comment.