Skip to content

Commit

Permalink
Update automation
Browse files Browse the repository at this point in the history
- Fix rcedit and wine not working
- Add comments
- Cache Godot binaries
- Run exports in parallel
- Report error if no artifacts are uploaded
- General overhaul
  • Loading branch information
Kiisu-Master committed Apr 10, 2024
1 parent eb8cb30 commit 422561a
Show file tree
Hide file tree
Showing 3 changed files with 113 additions and 35 deletions.
44 changes: 44 additions & 0 deletions .github/actions/setup-godot/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Setup Godot
inputs:
version:
required: true
release:
required: true
runs:
using: composite
steps:
- name: Make folders
shell: bash
run: |
# Set up folders for Godot editor and export templates.
# This is done before the download step because this uses caching and doesn't always need to download.
# The ~/godot directory is for the editor, so it can be added to PATH.
mkdir -v -p ~/.local/share/godot/export_templates/${{ inputs.version }}.${{ inputs.release }}
mkdir -v -p ~/godot
- name: Use cache
id: godot-cache
uses:
actions/cache@v4
with:
key: ${{ inputs.version }}-${{ inputs.release }}
path: |
~/.local/share/godot/export_templates/${{ inputs.version }}.${{ inputs.release }}
~/godot
- name: Download Godot
if: ${{ steps.godot-cache.outputs.cache-hit != 'true' }}
shell: bash
run: |
# Download Godot editor and export templates from godot-builds repo.
wget -q https://github.com/godotengine/godot-builds/releases/download/${{ inputs.version }}-${{ inputs.release }}/Godot_v${{ inputs.version }}-${{ inputs.release }}_export_templates.tpz &
wget -q https://github.com/godotengine/godot-builds/releases/download/${{ inputs.version }}-${{ inputs.release }}/Godot_v${{ inputs.version }}-${{ inputs.release }}_linux.x86_64.zip &
wait
# Unpack the files.
unzip Godot_v${{ inputs.version }}-${{ inputs.release }}_linux.x86_64.zip -d ~ &
unzip Godot_v${{ inputs.version }}-${{ inputs.release }}_export_templates.tpz -d ~ &
wait
# Move to correct places.
mv ~/templates/* ~/.local/share/godot/export_templates/${{ inputs.version }}.${{ inputs.release }}
mv ~/Godot_v${{ inputs.version }}-${{ inputs.release }}_linux.x86_64 ~/godot/godot
- name: Add Godot to path
shell: bash
run: echo "~/godot" >> $GITHUB_PATH
100 changes: 67 additions & 33 deletions .github/workflows/dev-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,53 +7,87 @@ on:
pull_request:
branches: [ main ]


env:
GODOT_VERSION: 4.2.2-rc2
GODOT_VERSION_DOT: 4.2.2.rc2
EXPORT_NAME: GodSVG
GODOT_VERSION: 4.2.2
GODOT_RELEASE: rc3
PROJECT_NAME: GodSVG


jobs:
export:
name: Export GodSVG
export-windows:
name: Export GodSVG for Windows
runs-on: ubuntu-latest
env:
PLATFORM: "Windows Desktop"
EXTENSION: "exe"
BUILD_NAME: "windows-64bit"
steps:
- name: Setup Godot and folders
run: |
mkdir -v -p ~/build/windows-64bit ~/build/linux-64bit ~/.local/share/godot/export_templates
wget -q https://github.com/godotengine/godot-builds/releases/download/${GODOT_VERSION}/Godot_v${GODOT_VERSION}_export_templates.tpz
wget -q https://github.com/godotengine/godot-builds/releases/download/${GODOT_VERSION}/Godot_v${GODOT_VERSION}_linux.x86_64.zip
unzip Godot_v${GODOT_VERSION}_linux.x86_64.zip -d ~
unzip Godot_v${GODOT_VERSION}_export_templates.tpz -d ~
mv ~/templates/ ~/.local/share/godot/export_templates/${GODOT_VERSION_DOT}
~/Godot_v${GODOT_VERSION}_linux.x86_64 --headless --quit
- name: Setup WINE and rcedit for Windows export
- name: Checkout repo
uses: actions/checkout@v4
- name: Set up Godot
uses: ./.github/actions/setup-godot
with:
version: ${{ env.GODOT_VERSION }}
release: ${{ env.GODOT_RELEASE }}
- name: Set up WINE and rcedit for Windows export
run: |
dpkg --add-architecture i386 && apt-get update && apt-get install -y wine-stable && apt-get install -y wine32
wget -q https://github.com/electron/rcedit/releases/download/v1.1.1/rcedit-x64.exe
# Download rcedit and intall wine.
wget -q https://github.com/electron/rcedit/releases/download/v1.1.1/rcedit-x64.exe &
sudo dpkg --add-architecture i386 &
sudo apt-get update
sudo apt-get install -y wine-stable
sudo apt-get install -y wine32
wait
mkdir -v -p ~/.local/share/rcedit
mv rcedit-x64.exe ~/.local/share/rcedit
cd ~
# Run Godot to generate config file.
godot --headless --quit
# Add wine and rcedit paths to Godot config.
echo 'export/windows/wine = "/usr/bin/wine"' >> ~/.config/godot/editor_settings-4.tres
echo 'export/windows/rcedit = "/github/home/.local/share/rcedit/rcedit-x64.exe"' >> ~/.config/godot/editor_settings-4.tres
echo 'export/windows/rcedit = "/home/runner/.local/share/rcedit/rcedit-x64.exe"' >> ~/.config/godot/editor_settings-4.tres
- name: Build
run: |
mkdir -v -p ~/build/${BUILD_NAME}
godot --headless -v --export-release "${PLATFORM}" ~/build/${BUILD_NAME}/${PROJECT_NAME}.${EXTENSION}
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.BUILD_NAME }}
path: ~/build/${{ env.BUILD_NAME }}/
if-no-files-found: error
retention-days: 14

export-linux:
name: Export GodSVG for Linux
runs-on: ubuntu-latest
env:
PLATFORM: "Linux/X11"
EXTENSION: "x86_64"
BUILD_NAME: "linux-64bit"
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Build Windows executable
- name: Set up Godot
uses: ./.github/actions/setup-godot
with:
version: ${{ env.GODOT_VERSION }}
release: ${{ env.GODOT_RELEASE }}
- name: Build
run: |
~/Godot_v${GODOT_VERSION}_linux.x86_64 --headless -v --export-release "Windows Desktop" ~/build/windows-64bit/$EXPORT_NAME.exe
- name: Build Linux executable
mkdir -v -p ~/build/${BUILD_NAME}
godot --headless -v --export-release "${PLATFORM}" ~/build/${BUILD_NAME}/${PROJECT_NAME}.${EXTENSION}
- name: Make Linux export runnable
run: |
~/Godot_v${GODOT_VERSION}_linux.x86_64 --headless -v --export-release "Linux/X11" ~/build/linux-64bit/$EXPORT_NAME.x86_64
chmod +x ~/build/linux-64bit/$EXPORT_NAME.x86_64
# Set run permission.
chmod +x ~/build/${BUILD_NAME}/${PROJECT_NAME}.x86_64
cd ~/build
tar zcvf linux-64bit.tar.gz linux-64bit
- name: Upload Windows Artifact
tar zcvf ${BUILD_NAME}.tar.gz ${BUILD_NAME}
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: Windows-64bit
path: ~/build/windows-64bit/
name: ${{ env.BUILD_NAME }}
path: ~/build/${{ env.BUILD_NAME }}.tar.gz
if-no-files-found: error
retention-days: 14
- name: Upload Linux Artifact
uses: actions/upload-artifact@v4
with:
name: Linux-64bit
path: ~/build/linux-64bit.tar.gz
retention-days: 14
4 changes: 2 additions & 2 deletions export_presets.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ export_filter="exclude"
export_files=PackedStringArray()
include_filter=""
exclude_filter="web-build/*, *.md, *.ico, visual/editor_only/*"
export_path="../GodSVG meta/GodSVG exports/GodSVG.html"
export_path=""
encryption_include_filters=""
encryption_exclude_filters=""
encrypt_pck=false
Expand All @@ -226,7 +226,7 @@ encrypt_directory=false
[preset.3.options]

custom_template/debug=""
custom_template/release="/home/volter/Desktop/godot/bin/web_release.zip"
custom_template/release=""
variant/extensions_support=false
vram_texture_compression/for_desktop=true
vram_texture_compression/for_mobile=false
Expand Down

0 comments on commit 422561a

Please sign in to comment.