builds godot
bundle up the templates
bendn 2022-07-23
parent f98eaf8 · commit b8bb761
-rw-r--r--.github/actions/build-godot/action.yml7
-rw-r--r--.github/workflows/linux_builds.yml17
-rw-r--r--.github/workflows/templates.yml73
3 files changed, 74 insertions, 23 deletions
diff --git a/.github/actions/build-godot/action.yml b/.github/actions/build-godot/action.yml
index faec0b2..254d174 100644
--- a/.github/actions/build-godot/action.yml
+++ b/.github/actions/build-godot/action.yml
@@ -55,8 +55,11 @@ runs:
run: |
cd godot
scons_flags=$flags
- [[ -z "${{ inputs.flags }}" ]] && scons_flags=${{ inputs.flags }}
- scons -j$(($(nproc)+2)) p=${{ inputs.platform }} tools=$tools target=${{ inputs.target }} use_lto=yes udev=yes $scons_flags
+ cores=$(nproc) || cores=$(sysctl -n hw.ncpu)
+ [[ -n "${{ inputs.flags }}" ]] && scons_flags="${{ inputs.flags }}"
+ command="scons -j$((cores+2)) p=${{ inputs.platform }} tools=$tools target=${{ inputs.target }} use_lto=yes udev=yes $scons_flags"
+ echo "running scons: $command"
+ $command
strip bin/* || true
ls bin
shell: bash
diff --git a/.github/workflows/linux_builds.yml b/.github/workflows/linux_builds.yml
index a70e429..92037b6 100644
--- a/.github/workflows/linux_builds.yml
+++ b/.github/workflows/linux_builds.yml
@@ -6,26 +6,25 @@ on:
branches:
- main
-env:
- branch: 3.x
- tools: yes
-
jobs:
build:
strategy:
matrix:
- target: [release, release_debug]
+ platform: [server, x11]
- name: Build editor
+ name: Build
runs-on: ubuntu-18.04
steps:
- name: Build editor
uses: bend-n/godot-2d-builds/.github/actions/build-godot@main
with:
- platform: x11
- target: ${{ matrix.target }}
+ platform: ${{ matrix.platform }}
+ target: release_debug
+ env:
+ branch: 3.x
+ tools: yes
- name: Upload artifact
uses: bend-n/godot-2d-builds/.github/actions/upload-artifact@main
with:
- name: linux-editor-${{ matrix.target }}
+ name: ${{ matrix.platform }}-tools-release
diff --git a/.github/workflows/templates.yml b/.github/workflows/templates.yml
index 7acc22d..8fab414 100644
--- a/.github/workflows/templates.yml
+++ b/.github/workflows/templates.yml
@@ -18,13 +18,13 @@ jobs:
strategy:
matrix:
target: [release, release_debug]
- bits: [32, 64]
+ bits: [64]
steps:
- name: Compilation
uses: bend-n/godot-2d-builds/.github/actions/build-godot@main
with:
target: ${{ matrix.target }}
- flags: -bits=${{ matrix.bits }} ${{ env.flags }}
+ flags: bits=${{ matrix.bits }} ${{ env.flags }}
platform: x11
- name: Upload artifact
@@ -34,7 +34,7 @@ jobs:
strategy:
matrix:
target: [release, release_debug]
- bits: [32, 64]
+ bits: [64]
name: Build windows templates
runs-on: windows-latest
steps:
@@ -42,7 +42,7 @@ jobs:
uses: bend-n/godot-2d-builds/.github/actions/build-godot@main
with:
target: ${{ matrix.target }}
- flags: -bits=${{ matrix.bits }} ${{ env.flags }}
+ flags: bits=${{ matrix.bits }} ${{ env.flags }}
platform: windows
- name: Upload artifact
@@ -54,7 +54,6 @@ jobs:
strategy:
matrix:
target: [release, release_debug]
- bits: [32, 64]
steps:
- name: Set up Java 11
uses: actions/setup-java@v1
@@ -65,14 +64,14 @@ jobs:
uses: bend-n/godot-2d-builds/.github/actions/build-godot@main
with:
target: ${{ matrix.target }}
- flags: -bits=${{ matrix.bits }} android_arch=armv7 ${{ env.flags }}
+ flags: android_arch=armv7 ${{ env.flags }}
platform: android
- name: Compilation (arm64v8)
uses: bend-n/godot-2d-builds/.github/actions/build-godot@main
with:
target: ${{ matrix.target }}
- flags: -bits=${{ matrix.bits }} android_arch=arm64v8 ${{ env.flags }}
+ flags: android_arch=arm64v8 ${{ env.flags }}
platform: android
- name: Generate Godot templates
@@ -88,17 +87,34 @@ jobs:
strategy:
matrix:
target: [release, release_debug]
- bits: [32, 64]
+
name: Build macos templates
runs-on: macos-latest
steps:
- - name: Compilation
+ - name: Compilation(x86_64)
+ uses: bend-n/godot-2d-builds/.github/actions/build-godot@main
+ with:
+ flags: arch=x86_64 ${{ env.flags }}
+ target: ${{ matrix.target }}
+ platform: macos
+
+ - name: Compilation(arm64)
uses: bend-n/godot-2d-builds/.github/actions/build-godot@main
with:
- flags: -bits=${{ matrix.bits }} ${{ env.flags }}
+ flags: arch=arm64 ${{ env.flags }}
target: ${{ matrix.target }}
platform: macos
+ - name: Create universal
+ run: |
+ [[ "${{ matrix.target }}" == *"debug"* ]] && target='.debug'
+ cd godot
+ intel=bin/godot.osx.*.x86_64
+ arm=bin/godot.osx.*.arm64
+ echo "--" && ls bin/ && echo $arm && echo $intel && echo "--"
+ lipo -create $intel $arm -output "bin/godot.osx.opt$target.universal"
+ strip "bin/godot.osx.opt$target.universal"
+
- name: Upload artifact
uses: bend-n/godot-2d-builds/.github/actions/upload-artifact@main
@@ -106,7 +122,7 @@ jobs:
strategy:
matrix:
target: [release, release_debug]
- bits: [32, 64]
+
name: Build javascript templates
runs-on: ubuntu-20.04
steps:
@@ -123,7 +139,7 @@ jobs:
uses: bend-n/godot-2d-builds/.github/actions/build-godot@main
with:
target: ${{ matrix.target }}
- flags: -bits=${{ matrix.bits }} ${{ env.flags }}
+ flags: ${{ env.flags }}
platform: javascript
- name: Upload artifact
@@ -133,10 +149,43 @@ jobs:
needs: [javascript, macos, windows, linux, android]
name: Bundle up all templates
runs-on: ubuntu-latest
+ env:
+ tmps: "../templates"
steps:
- name: Download all artifacts
uses: actions/download-artifact@v2
+ - name: Prepare files
+ run: |
+ mkdir -vp ${tmps}
+ git clone --depth 1 'https://github.com/godotengine/godot' -b 3.x godot-repo
+ echo "Preparing linux"
+ mv linux/godot.x11.opt.64 ${tmps}/linux_x11_64_release
+ mv linux/godot.x11.opt.debug.64 ${tmps}/linux_x11_64_debug
+
+ echo "Preparing windows"
+ mv windows/godot.windows.opt.64.exe ${tmps}/windows_64_release.exe
+ mv windows/godot.windows.opt.debug.64.exe ${tmps}/windows_64_debug.exe
+
+ echo "Preparing android"
+ mv android/android_debug.apk ${tmps}/android_debug.apk
+ mv android/android_release.apk ${tmps}/android_release.apk
+
+ echo "Preparing macos"
+ cp -r godot-repo/misc/dist/osx_template.app .
+ mkdir -p osx_template.app/Contents/MacOS
+ cp macos/godot.osx.opt.universal osx_template.app/Contents/MacOS/godot_osx_release.64
+ cp macos/godot.osx.opt.debug.universal osx_template.app/Contents/MacOS/godot_osx_debug.64
+ chmod +x osx_template.app/Contents/MacOS/godot_osx_*.64
+ zip -q -9 -r ${tmps}/osx.zip osx_template.app
+
+ echo "Preparing web"
+ mv javascript/godot.javascript.opt.zip webassembly_release.zip
+ mv javascript/godot.javascript.opt.debug.zip webassembly_debug.zip
+
+ - name: Prepare bundle
+ run: "zip -q -9 -r templates.tpz ${tmps}/*"
+
- name: Upload artifact
uses: bend-n/godot-2d-builds/.github/actions/upload-artifact@main
with: