From 11cc738fd4e45d5a2fba981114fc4b64bacda9c6 Mon Sep 17 00:00:00 2001 From: Simon Dalvai Date: Mon, 9 Sep 2024 21:19:13 +0200 Subject: [PATCH] add godot-channel to inputs and make godot version required --- README.md | 5 +++-- action.yml | 44 +++++++++++++++++++++++++------------------- 2 files changed, 28 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 17e3b4d..fb2b68b 100644 --- a/README.md +++ b/README.md @@ -23,8 +23,9 @@ If you really need Godot 4.x support, pull requests are always welcome :-) or si ## Parameters | key | required | default | description | | ----|----------|---------|-------------| +| godot-version | true | . | Godot Engine version. Supported are 4.x versions. Check versions [here](https://github.com/godotengine/godot-builds/releases) | +| godot-channel | false | stable | Godot Engine release channel (stable, beta, rc1, rc2, rc3...). Defaults to 'stable' Check release channels [here](https://github.com/godotengine/godot-builds/releases) | | working-directory | false | . | Path to project.godot file | -| godot-version | false | 3.5.3 | Check versions [here](https://downloads.tuxfamily.org/godotengine/) | ## Working examples You an find a working examples here: @@ -37,4 +38,4 @@ Now this actions follows the Unix philosophy of simply doing one thing well. You can then upload the aab/apk export of your game where ever you want. ## License -This software is licensed under the [MIT license](LICENSE). \ No newline at end of file +This software is licensed under the [MIT license](LICENSE). diff --git a/action.yml b/action.yml index 2111279..7ffda6c 100644 --- a/action.yml +++ b/action.yml @@ -6,19 +6,22 @@ branding: icon: upload-cloud inputs: + godot-version: + description: 'Godot Engine version' + required: true + godot-channel: + description: 'Godot Engine release channel (${{ inputs.godot-channel }}, beta, rc1, rc2, rc3...). Defaults to ${{ inputs.godot-channel }}' + required: false + default: '${{ inputs.godot-channel }}' working-directory: description: 'The working directory' required: false default: '.' - godot-version: - description: 'Godot Engine version' - required: false - default: '3.5.3' runs: using: "composite" steps: - - name: Set up JDK 1.8 + - name: Set up Java JDK uses: actions/setup-java@v4 with: distribution: 'temurin' @@ -26,8 +29,6 @@ runs: - name: Setup Android SDK uses: android-actions/setup-android@v2 - env: - ANDROID_HOME: /usr/local/lib/android/sdk - name: Cache Godot files id: cache-godot @@ -43,17 +44,17 @@ runs: if: steps.cache-godot.outputs.cache-hit != 'true' shell: bash run: | - wget -q https://downloads.tuxfamily.org/godotengine/${{ inputs.godot-version }}/Godot_v${{ inputs.godot-version }}-stable_linux_headless.64.zip - wget -q https://downloads.tuxfamily.org/godotengine/${{ inputs.godot-version }}/Godot_v${{ inputs.godot-version }}-stable_export_templates.tpz - mkdir ~/.cache + wget -q https://github.com/godotengine/godot-builds/releases/download/${{ inputs.godot-version }}-${{ inputs.godot-channel}}/Godot_v${{ inputs.godot-version }}-${{ inputs.godot-channel }}_linux.x86_64.zip + wget -q https://github.com/godotengine/godot-builds/releases/download/${{ inputs.godot-version }}-${{ inputs.godot-channel}}/Godot_v${{ inputs.godot-version }}-${{ inputs.godot-channel }}_export_templates.tpz + unzip Godot_v${{ inputs.godot-version }}-${{ inputs.godot-channel }}_linux.x86_64.zip + unzip Godot_v${{ inputs.godot-version }}-${{ inputs.godot-channel }}_export_templates.tpz + mkdir -p ~/.local/share/godot/export_templates/${{ inputs.godot-version }}.${{ inputs.godot-channel }} mkdir -p ~/.config/godot - mkdir -p ~/.local/share/godot/templates/${{ inputs.godot-version }}.stable - unzip Godot_v${{ inputs.godot-version }}-stable_linux_headless.64.zip - mv Godot_v${{ inputs.godot-version }}-stable_linux_headless.64 /usr/local/bin/godot - unzip Godot_v${{ inputs.godot-version }}-stable_export_templates.tpz - mv templates/* ~/.local/share/godot/templates/${{ inputs.godot-version }}.stable - rm -f Godot_v${{ inputs.godot-version }}-stable_linux_headless.64.zip Godot_v${{ inputs.godot-version }}-stable_export_templates.tpz - godot -e -q + unzip Godot_v${{ inputs.godot-version }}-${{ inouts.godot-channel }}_linux_headless.64.zip + mv Godot_v${{ inputs.godot-version }}-${{ inputs.godot-channel }}_linux_headless.64 /usr/local/bin/godot + unzip Godot_v${{ inputs.godot-version }}-${{ inputs.godot-channel }}_export_templates.tpz + mv templates/* ~/.local/share/godot/templates/${{ inputs.godot-version }}.${{ inputs.godot-channel }} + rm -f Godot_v${{ inputs.godot-version }}-${{ inputs.godot-channel }}_linux_headless.64.zip Godot_v${{ inputs.godot-version }}-${{ inputs.godot-channel }}_export_templates.tpz - name: Set Android SDK path in Godot Editor settings if: steps.cache-godot.outputs.cache-hit != 'true' @@ -71,8 +72,13 @@ runs: mkdir -p ${{ inputs.working-directory }}/android/plugins mkdir -p ${{ inputs.working-directory }}/android/build touch ${{ inputs.working-directory }}/android/build/.gdignore - echo ${{ inputs.godot-version }}.stable >> ${{ inputs.working-directory }}/android/.build_version - unzip ~/.local/share/godot/templates/${{ inputs.godot-version }}.stable/android_source.zip -d ${{ inputs.working-directory }}/android/build + echo ${{ inputs.godot-version }}.${{ inputs.godot-channel }} >> ${{ inputs.working-directory }}/android/.build_version + unzip ~/.local/share/godot/templates/${{ inputs.godot-version }}.${{ inputs.godot-channel }}/android_source.zip -d ${{ inputs.working-directory }}/android/build + + - name: Open project once to import assets in editor mode + shell: bash + continue-on-error: true # timeout will exit with code 124 + run: timeout 25 godot --path ${{ inputs.working-directory }} -e - name: Export shell: bash