Skip to content

Commit

Permalink
add godot-channel to inputs and make godot version required
Browse files Browse the repository at this point in the history
  • Loading branch information
dulvui committed Sep 9, 2024
1 parent 4472e8f commit 11cc738
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 21 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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).
This software is licensed under the [MIT license](LICENSE).
44 changes: 25 additions & 19 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,29 @@ 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'
java-version: 17

- 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
Expand All @@ -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'
Expand All @@ -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
Expand Down

0 comments on commit 11cc738

Please sign in to comment.