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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
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