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@v2 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