on: [push]
jobs:
  build:
    runs-on: docker
    steps:
     - run: |
        #  mkdir -v -p build
        #  mkdir -v -p build/.tools
        #  cd build/.tools
        #  wget https://github.com/godotengine/godot/releases/download/${{vars.GODOT_VERSION}}-${{vars.RELEASE_NAME}}/Godot_v${{vars.GODOT_VERSION}}-${{vars.RELEASE_NAME}}_${{vars.GODOT_PLATFORM}}.zip
        #  unzip Godot_v3.5.3-stable_x11.64.zip

        wget https://github.com/godotengine/godot/releases/download/${{vars.GODOT_VERSION}}-${{vars.RELEASE_NAME}}/Godot_v${{vars.GODOT_VERSION}}-${{vars.RELEASE_NAME}}_${{vars.GODOT_PLATFORM}}.zip \
            && wget https://github.com/godotengine/godot/releases/download/${{vars.GODOT_VERSION}}-${{vars.RELEASE_NAME}}/Godot_v${{vars.GODOT_VERSION}}-${{vars.RELEASE_NAME}}_export_templates.tpz \
            && mkdir ~/.cache \
            && mkdir -p ~/.config/godot \
            && mkdir -p ~/.local/share/godot/export_templates/${{ vars.GODOT_VERSION }}.${{ vars.RELEASE_NAME}} \
            && unzip Godot_v${{ vars.GODOT_VERSION }}-${{ vars.RELEASE_NAME}}_${{ vars.GODOT_PLATFORM}}.zip \
            && mv Godot_v${{ vars.GODOT_VERSION }}-${{ vars.RELEASE_NAME}}_${{ vars.GODOT_PLATFORM}} /usr/local/bin/godot \
            && unzip Godot_v${{ vars.GODOT_VERSION }}-${{ vars.RELEASE_NAME}}_export_templates.tpz \
            && mv templates/* ~/.local/share/godot/export_templates/${{ vars.GODOT_VERSION }}.${{ vars.RELEASE_NAME}} \
            && rm -f Godot_v${{ vars.GODOT_VERSION }}-${{ vars.RELEASE_NAME}}_export_templates.tpz Godot_v${{ vars.GODOT_VERSION }}-${{ vars.RELEASE_NAME}}_${{ vars.GODOT_PLATFORM}}.zip

         mkdir -v -p build/windows
         godot --headless --verbose --export-release "Windows Desktop" build/windows/package.exe
     - uses: actions/upload-artifact@v3
       with:
         name: artifacts
         path: ../build