builds godot
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: Build godot
description: Builds godot with a certain version and certain flags

inputs:
  url:
    description: Godot git url
    default: https://github.com/godotengine/godot
    required: true
  platform:
    description: Platform to build for
    required: true
  flags:
    description: Flags to pass to the build script
    required: false
  target:
    description: Target (release, release_debug, debug)
    required: true

runs:
  using: "composite"
  steps:
    - name: Setup
      uses: bend-n/godot-builds/.github/actions/setup@main
      with:
        ref: ${{ env.ref }}

    - name: Install linux dependencies
      if: ${{ inputs.platform }} == "x11"
      run: |
        [[ ${{ inputs.platform }} != "x11" ]] && exit 0
        sudo apt-get update -q
        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 \
          libspeechd-dev speech-dispatcher \
          tree
      shell: bash

    - name: Setup scons
      run: pip install scons
      shell: bash

    - name: Build Godot
      run: |
        cd godot
        scons_flags=$flags
        cores=$(nproc) || cores=$(sysctl -n hw.ncpu)
        [[ -n "${{ inputs.flags }}" ]] && scons_flags="${{ inputs.flags }}"
        scons -j$((cores+2)) p=${{ inputs.platform }} tools=$tools target=${{ inputs.target }} use_lto=yes udev=yes $scons_flags
        strip bin/* || true
        ls bin
      shell: bash