builds godot
| -rw-r--r-- | .github/actions/build-godot/action.yml | 57 | ||||
| -rw-r--r-- | .github/actions/upload-artifact/action.yml | 31 | ||||
| -rw-r--r-- | .github/workflows/build.yml | 46 | ||||
| -rw-r--r-- | .github/workflows/linux_builds.yml | 37 | ||||
| -rw-r--r-- | .github/workflows/templates.yml | 119 |
5 files changed, 205 insertions, 85 deletions
diff --git a/.github/actions/build-godot/action.yml b/.github/actions/build-godot/action.yml index d9a1453..e5a44d4 100644 --- a/.github/actions/build-godot/action.yml +++ b/.github/actions/build-godot/action.yml @@ -2,48 +2,37 @@ 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: To build the tools (aka the editor) - required: true platform: description: Platform to build for - default: x11 - required: true - target: - description: Target (debug|release_debug|release) required: true flags: - description: Flags to pass to the build + description: Flags to pass to the build script required: false - artifact-name: - description: Artifact name - required: true - default: godot runs: using: "composite" steps: - - name: Setup + - name: Checkout + run: | + [[ -d godot ]] && exit 0 # already checked out + git clone --depth 1 "${{ inputs.url }}" -b "${{ env.branch }}" godot + cd godot + curl 'https://raw.githubusercontent.com/bend-n/godot-2d-builds/main/.github/custom.py' --output custom.py || wget -nv 'https://raw.githubusercontent.com/bend-n/godot-2d-builds/main/.github/custom.py' -O custom.py + shell: bash + + - name: Install linux dependencies + if: ${{ inputs.platform }} == "x11" run: | - [[ -d godot ]] && exit 0 # we already setup - sudo apt-get update -qq + [[ ${{ 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 - git clone --depth 1 "$URL" -b "$BRANCH" godot - cd godot && wget -nv 'https://raw.githubusercontent.com/bend-n/godot-2d-builds/main/.github/custom.py' - env: - BRANCH: ${{ inputs.branch }} - URL: ${{ inputs.url }} + libpulse-dev libudev-dev libxi-dev libxrandr-dev yasm tree shell: bash - name: Setup Python @@ -62,19 +51,9 @@ runs: - name: Build Godot run: | cd godot - scons -j$(($(nproc)+2)) p=$PLATFORM tools=$TOOLS target=$TARGET use_lto=yes udev=yes $FLAGS + scons_flags=$flags + [[ -z "${{ inputs.flags }}" ]] && scons_flags=${{ inputs.flags }} + scons -j$(($(nproc)+2)) p=${{ inputs.platform }} tools=$tools target=$target use_lto=yes udev=yes $scons_flags strip bin/* || true - ls -lh bin/ - env: - PLATFORM: ${{ inputs.platform }} - FLAGS: ${{ inputs.flags }} - TOOLS: ${{ inputs.tools }} - TARGET: ${{ inputs.target }} + ls bin shell: bash - - - name: Upload artifacts - uses: actions/upload-artifact@v2 - with: - name: ${{ inputs.artifact-name }} - path: godot/bin/* - retention-days: 20 diff --git a/.github/actions/upload-artifact/action.yml b/.github/actions/upload-artifact/action.yml new file mode 100644 index 0000000..3bb9387 --- /dev/null +++ b/.github/actions/upload-artifact/action.yml @@ -0,0 +1,31 @@ +# from https://github.com/godotengine/godot/blob/b3bd08207032ca146319f4b25654bcddd31ee401/.github/actions/upload-artifact/action.yml + +name: Upload artifact +description: Uploads the artifact +inputs: + name: + description: The artifact name. + default: "${{ github.job }}" + required: true + path: + description: The path to upload. + required: true + default: "godot/bin/*" + +runs: + using: "composite" + steps: + - name: Upload Godot Artifact + uses: actions/upload-artifact@v2 + with: + name: ${{ inputs.name }} + path: ${{ inputs.path }} + retention-days: 14 + if-no-files-found: error + + - name: Check files on failure + if: failure() + run: | + pwd || true + tree + shell: bash diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index fbed5b9..0000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: Build godot 2d - -on: - workflow_dispatch: - push: - branches: - - main - -env: - branch: 3.x - -jobs: - build-templates: - runs-on: ubuntu-18.04 - steps: - - name: Build templates - uses: bend-n/godot-2d-builds/.github/actions/build-godot@main - with: - branch: ${{ env.branch }} - tools: no - target: release - artifact-name: godot-templates - flags: disable_3d=yes - - build-editor: - runs-on: ubuntu-18.04 - steps: - - name: Build editor - uses: bend-n/godot-2d-builds/.github/actions/build-godot@main - with: - branch: ${{ env.branch }} - tools: yes - target: release_debug - artifact-name: godot-editor - - build-headless: - runs-on: ubuntu-18.04 - steps: - - name: Build headless - uses: bend-n/godot-2d-builds/.github/actions/build-godot@main - with: - branch: ${{ env.branch }} - tools: yes - platform: server - target: release_debug - artifact-name: godot-headless diff --git a/.github/workflows/linux_builds.yml b/.github/workflows/linux_builds.yml new file mode 100644 index 0000000..9c5dee9 --- /dev/null +++ b/.github/workflows/linux_builds.yml @@ -0,0 +1,37 @@ +name: Build godot 2d headless and editor for linux + +on: + workflow_dispatch: + push: + branches: + - main + +env: + branch: 3.x + tools: yes + target: release_debug + +jobs: + linux-editor: + name: Build editor + runs-on: ubuntu-18.04 + steps: + - name: Build editor + uses: bend-n/godot-2d-builds/.github/actions/build-godot@main + with: + platform: x11 + + - name: Upload artifact + uses: bend-n/godot-2d-builds/.github/actions/upload-artifact@main + + linux-headless: + name: Build headless + runs-on: ubuntu-18.04 + steps: + - name: Build headless + uses: bend-n/godot-2d-builds/.github/actions/build-godot@main + with: + platform: server + + - name: Upload artifact + uses: bend-n/godot-2d-builds/.github/actions/upload-artifact@main diff --git a/.github/workflows/templates.yml b/.github/workflows/templates.yml new file mode 100644 index 0000000..7a0ecf5 --- /dev/null +++ b/.github/workflows/templates.yml @@ -0,0 +1,119 @@ +name: Build godot 2d templates + +on: + workflow_dispatch: + push: + branches: + - main + +env: + branch: 3.x + tools: no + target: release + flags: disable_3d=yes + +jobs: + linux: + name: Build linux templates + runs-on: ubuntu-20.04 + steps: + - name: Compilation + uses: bend-n/godot-2d-builds/.github/actions/build-godot@main + with: + platform: x11 + + - name: Upload artifact + uses: bend-n/godot-2d-builds/.github/actions/upload-artifact@main + + windows: + name: Build windows templates + runs-on: windows-latest + steps: + - name: Compilation + uses: bend-n/godot-2d-builds/.github/actions/build-godot@main + with: + platform: windows + + - name: Upload artifact + uses: bend-n/godot-2d-builds/.github/actions/upload-artifact@main + + android: + name: Build android templates + runs-on: ubuntu-20.04 + steps: + - name: Set up Java 11 + uses: actions/setup-java@v1 + with: + java-version: 11 + + - name: Compilation (armv7) + uses: bend-n/godot-2d-builds/.github/actions/build-godot@main + with: + flags: android_arch=armv7 ${{ env.flags }} + platform: android + + - name: Compilation (arm64v8) + uses: bend-n/godot-2d-builds/.github/actions/build-godot@main + with: + flags: android_arch=arm64v8 ${{ env.flags }} + platform: android + + - name: Generate Godot templates + run: | + cd godot + (cd platform/android/java && ./gradlew generateGodotTemplates) + ls -l bin/ + + - name: Upload artifact + uses: bend-n/godot-2d-builds/.github/actions/upload-artifact@main + + macos: + name: Build macos templates + runs-on: macos-latest + steps: + - name: Compilation + uses: bend-n/godot-2d-builds/.github/actions/build-godot@main + with: + platform: macos + + - name: Upload artifact + uses: bend-n/godot-2d-builds/.github/actions/upload-artifact@main + + javascript: + name: Build javascript templates + runs-on: ubuntu-20.04 + steps: + - name: Set up Emscripten 3.1.10 + uses: mymindstorm/setup-emsdk@v10 + with: + version: 3.1.10 + + - name: Verify Emscripten setup + run: | + emcc -v + + - name: Compilation + uses: bend-n/godot-2d-builds/.github/actions/build-godot@main + with: + platform: javascript + + - name: Upload artifact + uses: bend-n/godot-2d-builds/.github/actions/upload-artifact@main + + bundle: + needs: [javascript, macos, windows, linux, android] + name: Bundle up all templates + runs-on: ubuntu-latest + steps: + - name: Download all artifacts + uses: actions/download-artifact@v2 + + - name: Bundle + run: | + zip -r templates.tpz * + + - name: Upload artifact + uses: bend-n/godot-2d-builds/.github/actions/upload-artifact@main + with: + name: templates.tpz + path: templates.tpz |