builds godot
Diffstat (limited to '.github/workflows/builds.yml')
-rw-r--r--.github/workflows/builds.yml265
1 files changed, 265 insertions, 0 deletions
diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml
new file mode 100644
index 0000000..7ffc0a1
--- /dev/null
+++ b/.github/workflows/builds.yml
@@ -0,0 +1,265 @@
+name: Build godot 2d
+
+on:
+ workflow_dispatch:
+ push:
+ branches:
+ - main
+ pull_request:
+
+env:
+ version-name: 3.5
+ release: rc
+ branch: 3.x
+ tools: no
+ flags: disable_3d=yes
+
+jobs:
+ linux:
+ name: Build linux templates
+ runs-on: ubuntu-20.04
+ strategy:
+ matrix:
+ target: [release, release_debug]
+ 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 }}
+ platform: x11
+
+ - name: Upload artifact
+ uses: bend-n/godot-2d-builds/.github/actions/upload-artifact@main
+ with:
+ path: godot/bin/*.64
+
+ windows:
+ strategy:
+ matrix:
+ target: [release, release_debug]
+ bits: [64]
+ name: Build windows templates
+ runs-on: windows-latest
+ steps:
+ - name: Compilation
+ uses: bend-n/godot-2d-builds/.github/actions/build-godot@main
+ with:
+ target: ${{ matrix.target }}
+ flags: bits=${{ matrix.bits }} ${{ env.flags }}
+ platform: windows
+
+ - name: Upload artifact
+ uses: bend-n/godot-2d-builds/.github/actions/upload-artifact@main
+ with:
+ path: godot/bin/*.exe
+
+ android:
+ name: Build android templates
+ runs-on: ubuntu-20.04
+ strategy:
+ matrix:
+ target: [release, release_debug]
+ steps:
+ - name: Set up Java 11
+ uses: actions/setup-java@v1
+ with:
+ java-version: 11
+
+ - name: Compilation (armv7)
+ uses: bend-n/godot-2d-builds/.github/actions/build-godot@main
+ with:
+ target: ${{ matrix.target }}
+ 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: android_arch=arm64v8 ${{ env.flags }}
+ platform: android
+
+ - name: Generate Godot templates
+ run: |
+ cd godot
+ (cd platform/android/java && ./gradlew generateGodotTemplates)
+
+ - name: Upload artifact
+ uses: bend-n/godot-2d-builds/.github/actions/upload-artifact@main
+ with:
+ path: godot/bin/*.apk
+
+ macos:
+ strategy:
+ matrix:
+ target: [release, release_debug]
+
+ name: Build macos templates
+ runs-on: macos-latest
+ steps:
+ - 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: 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
+ 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
+ with:
+ path: godot/bin/*.universal
+
+ javascript:
+ strategy:
+ matrix:
+ target: [release, release_debug]
+
+ name: Build javascript templates
+ runs-on: ubuntu-20.04
+ steps:
+ - name: Set up Emscripten 3.1.10
+ uses: mymindstorm/setup-emsdk@v10
+ with:
+ version: 3.1.10
+
+ - name: Verify Emscripten setup
+ run: |
+ emcc -v
+
+ - name: Compilation
+ uses: bend-n/godot-2d-builds/.github/actions/build-godot@main
+ with:
+ target: ${{ matrix.target }}
+ flags: ${{ env.flags }}
+ platform: javascript
+
+ - name: Upload artifact
+ uses: bend-n/godot-2d-builds/.github/actions/upload-artifact@main
+ with:
+ path: godot/bin/*.zip
+
+ templates:
+ 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@v3
+
+ - 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 ${tmps}/webassembly_release.zip
+ mv javascript/godot.javascript.opt.debug.zip ${tmps}/webassembly_debug.zip
+
+ - name: Prepare bundle
+ run: "cd ${tmps} && zip -q -9 -r templates.tpz ./*"
+
+ - name: Upload artifact
+ uses: bend-n/godot-2d-builds/.github/actions/upload-artifact@main
+ with:
+ path: ${{ env.tmps }}/templates.tpz
+
+ tools:
+ strategy:
+ matrix:
+ platform: [server, x11]
+
+ name: Build linux tools
+ runs-on: ubuntu-18.04
+ steps:
+ - name: Build editor
+ uses: bend-n/godot-2d-builds/.github/actions/build-godot@main
+ with:
+ platform: ${{ matrix.platform }}
+ target: release_debug
+ env:
+ tools: yes
+ flags: "" # override flags
+
+ - name: Upload artifact
+ uses: bend-n/godot-2d-builds/.github/actions/upload-artifact@main
+ with:
+ name: ${{ matrix.platform }}-tools-release
+ path: godot/bin/*.64
+
+ build-image:
+ name: Build docker image
+ runs-on: ubuntu-latest
+ needs: [tools, templates]
+ steps:
+ - uses: actions/checkout@v3
+
+ - name: Get templates
+ uses: actions/download-artifact@v3
+ with:
+ name: templates
+
+ - name: Get headless
+ uses: actions/download-artifact@v3
+ with:
+ name: server-tools-release
+
+ - run: mv godot_server.x11.opt.tools.64 godot && chmod +x godot
+
+ - name: Login to GitHub Container Registry
+ uses: docker/[email protected]
+ with:
+ registry: ghcr.io
+ username: ${{ github.repository_owner }}
+ password: ${{ secrets.GITHUB_TOKEN }}
+
+ - name: Build and push Docker image
+ uses: docker/build-push-action@v3
+ with:
+ context: .
+ file: Dockerfile
+ push: true
+ tags: ghcr.io/${{ github.repository_owner }}/godot-2d:${{ env.version-name }}${{ env.tag }}
+ build-args: |
+ GODOT_VERSION=${{ env.version-name }}
+ RELEASE_NAME=${{ env.release }}
+ env:
+ tag: ${{ env.release != 'stable' && format('.{0}', env.release) || '' }}