Skip to content

Commit

Permalink
Merge pull request #21 from cassidyjames/ci-improvements
Browse files Browse the repository at this point in the history
Workflows: Download and cache Godot Engine for build
  • Loading branch information
wjt authored Jan 7, 2025
2 parents ca69811 + 40d5ddd commit 2d641a3
Showing 2 changed files with 38 additions and 7 deletions.
42 changes: 35 additions & 7 deletions .github/workflows/github-pages.yml
Original file line number Diff line number Diff line change
@@ -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
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/

0 comments on commit 2d641a3

Please sign in to comment.