Working on adding items and windows build
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
name: Build Godot Project (Linux)
|
||||
name: Build Godot Project (Linux & Windows)
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
@@ -43,7 +43,7 @@ jobs:
|
||||
echo "📥 Cache Miss. Downloading Godot Engine ($VERSION_URL)..."
|
||||
curl -L "https://github.com/godotengine/godot/releases/download/${VERSION_URL}/Godot_v${VERSION_URL}_linux.x86_64.zip" -o godot.zip
|
||||
unzip godot.zip
|
||||
move "Godot_v${VERSION_URL}_linux.x86_64" .godot-cache-storage/godot || mv "Godot_v${VERSION_URL}_linux.x86_64" .godot-cache-storage/godot
|
||||
mv "Godot_v${VERSION_URL}_linux.x86_64" .godot-cache-storage/godot
|
||||
chmod +x .godot-cache-storage/godot
|
||||
|
||||
echo "📥 Downloading Export Templates ($VERSION_URL)..."
|
||||
@@ -80,3 +80,66 @@ jobs:
|
||||
with:
|
||||
name: linux-build
|
||||
path: build/linux/
|
||||
|
||||
build-windows:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Detect Godot Version
|
||||
id: detect-version
|
||||
run: |
|
||||
VERSION_SHORT=$(grep "config/features" project.godot | sed -E 's/^[^\"]*\"([^\"]+)\".*/\1/' | xargs)
|
||||
if [ -z "$VERSION_SHORT" ]; then VERSION_SHORT="4.7"; fi
|
||||
echo "VERSION_SHORT=${VERSION_SHORT}" >> $GITHUB_OUTPUT
|
||||
echo "VERSION_URL=${VERSION_SHORT}-stable" >> $GITHUB_OUTPUT
|
||||
echo "VERSION_FILE=${VERSION_SHORT}.stable" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Cache Godot Engine and Windows Templates
|
||||
id: godot-cache-windows
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: .godot-cache-windows-storage
|
||||
key: godot-${{ steps.detect-version.outputs.VERSION_FILE }}-windows-v1
|
||||
|
||||
- name: Download Godot Engine and Windows Templates (On Cache Miss)
|
||||
if: steps.godot-cache-windows.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
VERSION_URL="${{ steps.detect-version.outputs.VERSION_URL }}"
|
||||
mkdir -p .godot-cache-windows-storage
|
||||
|
||||
# We still download the Linux engine binary because our runner environment is Linux
|
||||
curl -L "https://github.com/godotengine/godot/releases/download/${VERSION_URL}/Godot_v${VERSION_URL}_linux.x86_64.zip" -o godot.zip
|
||||
unzip godot.zip
|
||||
mv "Godot_v${VERSION_URL}_linux.x86_64" .godot-cache-windows-storage/godot
|
||||
chmod +x .godot-cache-windows-storage/godot
|
||||
|
||||
# Download the export templates, pulling the windows binary out of the compressed file
|
||||
curl -L "https://github.com/godotengine/godot/releases/download/${VERSION_URL}/Godot_v${VERSION_URL}_export_templates.tpz" -o templates.zip
|
||||
unzip templates.zip
|
||||
mv templates/windows_release_x86_64.exe .godot-cache-windows-storage/windows_release_x86_64.exe
|
||||
|
||||
rm godot.zip templates.zip
|
||||
rm -rf templates/
|
||||
|
||||
- name: Map Engine and Windows Templates
|
||||
run: |
|
||||
VERSION_FILE="${{ steps.detect-version.outputs.VERSION_FILE }}"
|
||||
cp .godot-cache-windows-storage/godot ./godot
|
||||
|
||||
mkdir -p ~/.local/share/godot/export_templates/${VERSION_FILE}
|
||||
cp .godot-cache-windows-storage/windows_release_x86_64.exe ~/.local/share/godot/export_templates/${VERSION_FILE}/windows_release_x86_64.exe
|
||||
|
||||
- name: Export Windows Binary
|
||||
run: |
|
||||
mkdir -p build/windows
|
||||
# Ensure "Windows" matches the exact name of your export preset in Godot
|
||||
./godot --headless --export-release "Windows" build/windows/godot_number_factory.exe
|
||||
|
||||
- name: Upload Windows Build Artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: windows-build
|
||||
path: build/windows/
|
||||
|
||||
Reference in New Issue
Block a user