Skip to content

Added basic tower and game scenes. #83

Added basic tower and game scenes.

Added basic tower and game scenes. #83

Workflow file for this run

# This is a workflow to build and release for platforms defined in the export configuration file (export_template.cfg)
name: CI / CD
env:
GODOT_VERSION: 4.5.1
# Whenever a tag push matching pattern "v*" then run the job
on:
push:
tags:
- "v*"
workflow_dispatch:
pull_request:
branches: [ main ]
jobs:
build-game:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Git Diff Pre-Build
run: |
git status
git diff
- name: Build game
id: build
# Use latest version (see releases for all versions)
uses: firebelley/godot-export@v5.2.1
with:
# Defining all the required inputs
godot_executable_download_url: https://github.com/godotengine/godot-builds/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-builds/releases/download/${{ env.GODOT_VERSION }}-stable/Godot_v${{ env.GODOT_VERSION }}-stable_export_templates.tpz
relative_project_path: ./project
use_preset_export_path: true
archive_output: true
export_debug: ${{ !startsWith(github.ref, 'refs/tags/') }}
- name: Validate Git Diff
run: |
./scripts/validate_git_diff.sh
- name: Debug - Show build outputs
run: |
echo "=== Build Directory ==="
echo "Path: ${{ steps.build.outputs.build_directory }}"
if [ -d "${{ steps.build.outputs.build_directory }}" ]; then
ls -laR "${{ steps.build.outputs.build_directory }}"
else
echo "Build directory does not exist!"
fi
echo ""
echo "=== Archive Directory ==="
echo "Path: ${{ steps.build.outputs.archive_directory }}"
if [ -d "${{ steps.build.outputs.archive_directory }}" ]; then
ls -laR "${{ steps.build.outputs.archive_directory }}"
else
echo "Archive directory does not exist!"
fi
echo ""
echo "=== All ZIP files in workspace ==="
find . -name "*.zip" -type f 2>/dev/null || echo "No zip files found"
- name: Test release build size for itch.io
if: startsWith(github.ref, 'refs/tags/')
run: |
python3 ./scripts/test_release_size.py ${{ steps.build.outputs.build_directory }}/web_release
- name: Upload Windows artifacts
uses: actions/upload-artifact@v4
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
with:
name: windows-export
path: ${{ steps.build.outputs.archive_directory }}/**/windows.zip
retention-days: 1
compression-level: 0
if-no-files-found: error
- name: Upload Linux artifacts
uses: actions/upload-artifact@v4
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
with:
name: linux-export
path: ${{ steps.build.outputs.archive_directory }}/**/linux_release.zip
retention-days: 1
compression-level: 0
if-no-files-found: error
- name: Create release
if: startsWith(github.ref, 'refs/tags/')
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
generateReleaseNotes: true
tag: ${{ github.ref_name }}
artifacts: |
${{ steps.build.outputs.archive_directory }}/**/*.zip
- name: Deploy to itch.io
if: startsWith(github.ref, 'refs/tags/')
run: |
./get_butler.sh
BUTLER_API_KEY=${{ secrets.BUTLER_API_KEY }} ./butler --verbose push ${{ steps.build.outputs.build_directory }}/web_release ${{ vars.ITCHIO_USERNAME }}/${{ vars.ITCHIO_GAME }}:web
- name: Send Discord notification
if: startsWith(github.ref, 'refs/tags/')
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_RELEASE_WEBHOOK }}
uses: Ilshidur/action-discord@master
with:
args: 'WildJamProject ${{ github.ref_name }} has been released to : https://${{ vars.ITCHIO_USERNAME }}.itch.io/${{ vars.ITCHIO_GAME }} Password: ${{ secrets.ITCHIO_PAGE_PASS }}'
test-linux-build:
needs: build-game
runs-on: ubuntu-latest
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
steps:
- name: Checkout (for scripts if needed)
uses: actions/checkout@v4
- name: Download Linux artifact
uses: actions/download-artifact@v4
with:
name: linux-export
path: ./linux-build
- name: Show artifact directory
run: |
echo "=== Downloaded Artifact Contents ==="
echo "Path: ./linux-build"
ls -laR ./linux-build
- name: Unzip artifact
run: |
mkdir -p ./test_game
# Find the zip file (handles nested paths)
ZIP_FILE=$(find ./linux-build -name "linux_release.zip" -o -name "*.zip" | head -n 1)
if [ -z "$ZIP_FILE" ]; then
echo "ERROR: No zip file found in artifact!"
exit 1
fi
echo "Unzipping: $ZIP_FILE"
unzip "$ZIP_FILE" -d ./test_game
# Make executable
chmod +x ./test_game/* 2>/dev/null || true
echo "=== Test game directory ==="
ls -la ./test_game
- name: Find executable
id: find_exe
run: |
# Try to find the executable
EXECUTABLE=$(find ./test_game -type f -executable -name "*.x86_64" | head -n 1)
if [ -z "$EXECUTABLE" ]; then
echo "ERROR: No executable found!"
echo "Contents of test_game:"
ls -laR ./test_game
exit 1
fi
echo "Found executable: $EXECUTABLE"
echo "executable=$EXECUTABLE" >> $GITHUB_OUTPUT
- name: Run tests
run: |
set -e
set -o pipefail
TEMP_FILE=/tmp/test_linux_release.log
EXECUTABLE="${{ steps.find_exe.outputs.executable }}"
echo "Running: $EXECUTABLE"
$EXECUTABLE --headless --render-thread safe --single-threaded-scene --verbose --quit-after 1000 2>&1 | tee $TEMP_FILE
echo ""
echo ""
echo ""
echo ""
echo ""
echo "#####################"
echo " RESULTS "
echo "#####################"
FAILED=0
# Check for any error lines (case-insensitive)
# Ignores null time for textures: https://github.com/godotengine/godot/issues/108994
FILTERED_ERRORS=$(grep "ERROR" "$TEMP_FILE" | grep -v 'ERROR: Parameter "t" is null.' || true)
if [ -n "$FILTERED_ERRORS" ]; then
echo "❌ CI FAILED BECAUSE OF THESE GODOT ERRORS"
echo "$FILTERED_ERRORS"
echo ""
FAILED=1
fi
# Check for invalid UID warnings which will cause problems for other people
FILTERED_WARNINGS=$(grep "WARNING" "$TEMP_FILE" | grep 'invalid UID:' || true)
if [ -n "$FILTERED_WARNINGS" ]; then
echo "❌ CI FAILED BECAUSE OF THESE GODOT WARNINGS"
echo "$FILTERED_WARNINGS"
echo ""
FAILED=1
fi
if [ "$FAILED" -eq 0 ]; then
echo "✅ ALL GOOD :) :) :)"
echo ""
echo ""
echo ""
echo ""
echo ""
fi
exit $FAILED
- name: Upload test logs on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: test-logs
path: /tmp/test_linux_release.log
retention-days: 7