Sign inSign up

jezsonic/build-tools

By jezsonic

Updated 3 months ago

Image with preinstalled tools to perform cross-compilation of GDExtension for Godot 4.x

Image
Languages & frameworks
Integration & delivery
Operating systems
1

7.9K

jezsonic/build-tools repository overview

Usage

Warning: 32-bit desktop platforms are not supported Warning: Android targets must be built on image with .android in its tag

Basic usage with Dockerfile (remember to have your project directory mounted)

FROM jezsonic/build-tools:{version}
# Only works with Android, Windows, Linux and Mac OS.
# Use only with Godot GDExtention version 4.x in the root directory of your project
# This will compile appropriate godot-cpp bindings automatically

# Replace these commands to suit your needs, for now only scons, make and cmake build systems are supported
RUN scons platform="android" arch="x86_64"
RUN scons platform="android" arch="x86_32"
RUN scons platform="android" arch="arm64"
RUN scons platform="android" arch="arm32"
RUN scons platform="windows" arch="x86_64"
RUN scons platform="windows" arch="x86_32"
RUN scons platform="linux" arch="x86_64"
RUN scons platform="linux" arch="x86_32"

Or with docker-compose.yml

services:
  builder:
    image: jezsonic/build-tools:{version}
    container_name: builder
    entrypoint: /var/gdextension_code/docker-storage/entrypoint.sh #put all the build commands here
    volumes:
      - type: bind
        source: ./
        target: /var/gdextension_code #can be anything you want
#!/bin/bash
cd /var/gdextension_code
scons platform="windows" arch="x86_64"
scons platform="linux" arch="x86_64"

Example with GitHub Actions

docker-compose.yml

services:
  windows_x86_64:
    image: jezsonic/build-tools:latest
    container_name: windows_x86_64
    entrypoint: /var/gdextension_code/docker-storage/entrypoint.sh -p windows -a x86_64
    volumes:
      - type: bind
        source: ./
        target: /var/gdextension_code
  linux_x86_64:
    image: jezsonic/build-tools:latest
    container_name: linux_x86_64
    entrypoint: /var/gdextension_code/docker-storage/entrypoint.sh -p linux -a x86_64
    volumes:
      - type: bind
        source: ./
        target: /var/gdextension_code
  android_x86_64:
    image: jezsonic/build-tools:latest
    container_name: android_x86_64
    entrypoint: /var/gdextension_code/docker-storage/entrypoint.sh -p android -a x86_64
    volumes:
      - type: bind
        source: ./
        target: /var/gdextension_code
  android_x86_32:
    image: jezsonic/build-tools:latest
    container_name: android_x86_32
    entrypoint: /var/gdextension_code/docker-storage/entrypoint.sh -p android -a x86_32
    volumes:
      - type: bind
        source: ./
        target: /var/gdextension_code
  android_arm64:
    image: jezsonic/build-tools:latest
    container_name: android_arm64
    entrypoint: /var/gdextension_code/docker-storage/entrypoint.sh -p android -a arm64
    volumes:
      - type: bind
        source: ./
        target: /var/gdextension_code
  android_arm32:
    image: jezsonic/build-tools:latest
    container_name: android_arm32
    entrypoint: /var/gdextension_code/docker-storage/entrypoint.sh -p android -a arm32
    volumes:
      - type: bind
        source: ./
        target: /var/gdextension_code

.github/workflows/build.yml

name: docker-build
# This workflow represents a set of basic End-to-End tests
on:
  push:
  workflow_dispatch:

jobs:
  build-debug-windows:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4
        with:
          submodules: recursive
          token: ${{ secrets.PAT_TOKEN }}

      - name: Docker build Windows x86_64
        run: sudo chmod 777 docker-storage/entrypoint.sh |
          docker compose run windows_x86_64

      - uses: actions/upload-artifact@v4
        with:
          name: bin-debug
          path: bin/

  build-debug-linux:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4
        with:
          submodules: recursive
          token: ${{ secrets.PAT_TOKEN }}

      - name: Docker build Linux x86_64
        run: sudo chmod 777 docker-storage/entrypoint.sh |
          docker compose run linux_x86_64

      - uses: actions/upload-artifact@v4
        with:
          name: bin-debug
          path: bin/linux

  build-debug-android:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4
        with:
          submodules: recursive
          token: ${{ secrets.PAT_TOKEN }}

      - name: Docker build Android x86_64
        run: sudo chmod 777 docker-storage/entrypoint.sh |
          docker compose run android_x86_64

      - name: Docker build Android x86_32
        run: sudo chmod 777 docker-storage/entrypoint.sh |
          docker compose run android_x86_32

      - name: Docker build Android arm64
        run: sudo chmod 777 docker-storage/entrypoint.sh |
          docker compose run android_arm64

      - name: Docker build Android arm32
        run: sudo chmod 777 docker-storage/entrypoint.sh |
          docker compose run android_arm32

      - uses: actions/upload-artifact@v4
        with:
          name: bin-debug
          path: bin/android

docker-storage/entrypoint.sh

#!/bin/bash
echo "Creating Dynamic-linked libraries..."
cd /var/gdextension_code
while getopts a:p: flag
do
    # shellcheck disable=SC2220
    case "${flag}" in
        p) platform=${OPTARG};;
        a) arch=${OPTARG};;
    esac
done
scons platform="$platform" arch="$arch"

FaQ

  1. Is this going to be maintained and updated in the future for never Godot Engine versions? Yes. If there is any version missing, hit me up at https://newdev.web.app/contact
  2. Will Apple platforms be added there? No. You can build your image based on this by adding OSXCross toolchain anyway

Tag summary

Content type

Image

Digest

sha256:3ef1f1dbf

Size

3.3 GB

Last updated

3 months ago

docker pull jezsonic/build-tools:4.5.stable.android