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
name: "Setup"
description: "Setup the environment for building"

inputs:
  repo:
    description: Godot github owner/repo
    default: godotengine/godot
    required: true
  ref:
    description: Which ref to build
    required: true

runs:
  using: "composite"
  steps:
    - name: Check if clean
      id: clean
      run: |
        if [[ -d godot ]]; then echo "::set-output name=clean::false";
        else echo "::set-output name=clean::true"; fi
      shell: bash

    - uses: actions/checkout@v3
      if: steps.clean.outputs.clean == 'true'
      with:
        repository: ${{ inputs.repo }}
        ref: ${{ inputs.ref }}
        path: "godot"

    - uses: actions/checkout@v3
      if: steps.clean.outputs.clean == 'true'
      with:
        path: "repo"

    - name: Setup Python
      if: steps.clean.outputs.clean == 'true'
      uses: actions/setup-python@v4
      with:
        python-version: 3.9

    - name: Apply patches to godot
      if: steps.clean.outputs.clean == 'true'
      run: |
        # Patch godot
        echo "::group::Patch godot"
        (cd repo && mv "${{ env.modules }}" ../godot/custom.py && mv patches ../godot)
        cd godot
        for patch in patches/*; do git apply --ignore-whitespace "$patch" || echo "::error file={${patch}}::Go update your patch"; done
        echo "::endgroup::"
      shell: bash