various #113
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Automatic builds | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- '*' | |
jobs: | |
build_application: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Extract Version & Determine Patch | |
id: version_info | |
run: | | |
MAJOR_MINOR=$(grep "var major_minor" Autoload/Version.gd | awk -F\" '{print $2}') | |
PATCH=$(git rev-list --count HEAD) | |
FULL_VERSION="$MAJOR_MINOR.$PATCH" | |
echo "FULL_VERSION=$FULL_VERSION" >> $GITHUB_OUTPUT | |
echo "PATCH=$PATCH" >> $GITHUB_ENV | |
- name: Update Version in Godot Script | |
run: | | |
sed -i "s/var patch = .*/var patch = \"$PATCH\"/" Autoload/Version.gd | |
- name: Setup Godot and Export Templates | |
run: | | |
wget -q https://downloads.tuxfamily.org/godotengine/3.5.3/Godot_v3.5.3-stable_linux_headless.64.zip | |
wget -q https://downloads.tuxfamily.org/godotengine/3.5.3/Godot_v3.5.3-stable_export_templates.tpz | |
unzip -q Godot_v3.5.3-stable_linux_headless.64.zip | |
unzip -q Godot_v3.5.3-stable_export_templates.tpz | |
mkdir -p ~/.local/share/godot/templates/3.5.3.stable/ | |
mv templates/* ~/.local/share/godot/templates/3.5.3.stable/ | |
chmod +x Godot_v3.5.3-stable_linux_headless.64 | |
- name: Prepare Directories | |
run: | | |
rm -rf ./bin | |
mkdir -p ./bin/ExportLinux/Unearth ./bin/ExportWindows/Unearth | |
- name: Export Godot Game (Linux) | |
run: ./Godot_v3.5.3-stable_linux_headless.64 --export "Linux/X11" ./bin/ExportLinux/Unearth/Unearth.x86_64 | |
- name: Export Godot Game (Windows) | |
run: ./Godot_v3.5.3-stable_linux_headless.64 --export "Windows Desktop" ./bin/ExportWindows/Unearth/Unearth.exe | |
- name: Install Wine | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y wine64 | |
- name: Download rcedit | |
run: | | |
wget https://github.com/electron/rcedit/releases/download/v2.0.0/rcedit-x64.exe -O rcedit.exe | |
- name: Replace Icon in Windows Export with rcedit | |
run: | | |
wine64 rcedit.exe ./bin/ExportWindows/Unearth/Unearth.exe --set-icon Art/UnearthIcon.ico | |
- name: Upload Linux Artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: unearth-${{ steps.version_info.outputs.FULL_VERSION }}-linux | |
path: ./bin/ExportLinux/ | |
- name: Upload Windows Artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: unearth-${{ steps.version_info.outputs.FULL_VERSION }}-windows | |
path: ./bin/ExportWindows/ |