builds godot
actions
bendn 2022-07-21
parent 4db67e1 · commit ede61af
-rw-r--r--.github/actions/build-godot/action.yml75
-rw-r--r--.github/workflows/build.yml37
2 files changed, 112 insertions, 0 deletions
diff --git a/.github/actions/build-godot/action.yml b/.github/actions/build-godot/action.yml
new file mode 100644
index 0000000..b104485
--- /dev/null
+++ b/.github/actions/build-godot/action.yml
@@ -0,0 +1,75 @@
+name: Build godot
+description: Builds godot with a certain version and certain flags
+
+inputs:
+ branch:
+ description: The branch of godot to build
+ default: 3.x
+ required: true
+ url:
+ description: Godot git url
+ default: https://github.com/godotengine/godot
+ required: true
+ tools:
+ description: Editor / templates
+ default: no
+ required: true
+ platform:
+ description: Platform to build for
+ default: x11
+ required: true
+ target:
+ description: Target
+ default: release
+ required: true
+ flags:
+ description: Flags to pass to the build
+ required: false
+
+runs:
+ using: "composite"
+ steps:
+ - name: Setup
+ run: |
+ [[ -d godot ]] && exit 0 # we already setup
+ sudo apt-get update -qq
+ sudo apt-get install -qqq \
+ build-essential pkg-config libx11-dev libxcursor-dev \
+ libxinerama-dev libgl1-mesa-dev libglu-dev libasound2-dev \
+ libpulse-dev libudev-dev libxi-dev libxrandr-dev yasm
+ git clone --depth 1 "$URL" -b "$BRANCH" godot
+ env:
+ BRANCH: ${{ inputs.branch }}
+ URL: ${{ inputs.url }}
+ shell: bash
+
+ - name: Setup Python
+ uses: actions/setup-python@v2
+ with:
+ python-version: "3.9.1"
+
+ - name: Setup SCons
+ run: |
+ python -c "import sys; print(sys.version)"
+ python -m pip install scons
+ python --version
+ scons --version
+ shell: bash
+
+ - name: Build Godot
+ run: |
+ cd godot
+ scons -j$(($(nproc)+2)) p=$PLATFORM tools=$TOOLS target=$TARGET use_lto=yes udev=yes $FLAGS
+ ls -lh bin/
+ env:
+ PLATFORM: ${{ inputs.platform }}
+ FLAGS: ${{ inputs.flags }}
+ TOOLS: ${{ inputs.tools }}
+ TARGET: ${{ inputs.target }}
+ shell: bash
+
+ - name: Upload artifacts
+ uses: actions/upload-artifact@v2
+ with:
+ path: godot/bin/*
+ retention-days: 20
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
new file mode 100644
index 0000000..5f1ef2f
--- /dev/null
+++ b/.github/workflows/build.yml
@@ -0,0 +1,37 @@
+name: Build godot 2d
+
+on: workflow_dispatch
+
+jobs:
+ build-templates:
+ runs-on: ubuntu-18.04
+ steps:
+ - name: Build templates
+ uses: bend-n/godot-2d-builds/.github/actions/build-godot@main
+ with:
+ branch: 3.5
+ tools: no
+ platform: x11
+ target: release
+
+ build-editor:
+ runs-on: ubuntu-18.04
+ steps:
+ - name: Build editor
+ uses: bend-n/godot-2d-builds/.github/actions/build-godot@main
+ with:
+ branch: 3.5
+ tools: yes
+ platform: x11
+ target: release
+
+ build-headless:
+ runs-on: ubuntu-18.04
+ steps:
+ - name: Build headless
+ uses: bend-n/godot-2d-builds/.github/actions/build-godot@main
+ with:
+ branch: 3.5
+ tools: yes
+ platform: server
+ target: release_debug