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

Workflows: Download and cache Godot Engine for build #21

Merged
merged 1 commit into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 35 additions & 7 deletions .github/workflows/github-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,23 +46,51 @@ jobs:
- check
if: ${{ needs.check.outputs.enabled }}
runs-on: ubuntu-latest
container:
image: barichello/godot-ci:4.3
steps:
- name: Checkout
uses: actions/checkout@v4
with:
lfs: true

- name: Set up export templates
- name: Cache Godot Engine downloads
id: cache-godot
uses: actions/cache@v4
with:
path: |
build/godot
build/._sc_
build/editor_data/export_templates/${{ env.GODOT_VERSION }}.stable
key: godot-${{ env.GODOT_VERSION }}

- name: Download Godot Engine from GitHub release
id: download
if: steps.cache-godot.outputs.cache-hit != 'true'
run: |
mkdir -v -p ~/.local/share/godot/export_templates/
mv /root/.local/share/godot/export_templates/${GODOT_VERSION}.stable ~/.local/share/godot/export_templates/${GODOT_VERSION}.stable
mkdir -p build && cd build

# Download Godot Engine itself
wget https://github.com/godotengine/godot/releases/download/${GODOT_VERSION}-stable/Godot_v${GODOT_VERSION}-stable_linux.x86_64.zip && \
unzip Godot_v${GODOT_VERSION}-stable_linux.x86_64.zip && \
mv Godot_v${GODOT_VERSION}-stable_linux.x86_64 godot

# Download export templates
mkdir -p editor_data/export_templates
wget https://github.com/godotengine/godot/releases/download/${GODOT_VERSION}-stable/Godot_v${GODOT_VERSION}-stable_export_templates.tpz && \
unzip Godot_v${GODOT_VERSION}-stable_export_templates.tpz && \
mv templates editor_data/export_templates/${GODOT_VERSION}.stable

# Tell Godot Engine to run in "self-contained" mode so it looks for
# templates here instead of in ~/.local/share/godot/
touch ._sc_

- name: Web Build
run: |
mkdir -v -p build/web
godot --headless --verbose --export-release "Web" ./build/web/index.html
mkdir -v -p build/web && cd build

# Note that the export path can be confusing; it's relative to the
# Godot project path, NOT necessarily the current directory or Godot
# binary location
./godot --headless --verbose --path ../ --export-release "Web" ./build/web/index.html

- name: Upload Artifact
uses: actions/upload-pages-artifact@v3
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
# Godot 4+ specific ignores
.godot/

# Working directory
build/
Loading