-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
action.yml
96 lines (84 loc) · 4.02 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: 'Godot Android Export'
description: 'Godot Engine 3.x and 4.x Android export'
author: 'Simon Dalvai @dulvui'
branding:
color: blue
icon: upload-cloud
inputs:
working-directory:
description: 'The working directory'
required: false
default: '.'
godot-version:
description: 'Godot Engine version. Supported are 4.x versions'
required: true
godot-channel:
description: 'Godot Engine release channel (stable, beta, rc1, rc2, rc3...). Defaults to stable'
required: false
default: 'stable'
runs:
using: "composite"
steps:
- name: Check is running on Linux
if: runner.os != 'Linux'
shell: bash
run: exit 1
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
- name: Setup Android SDK
uses: android-actions/setup-android@v2
- name: Cache Godot files
id: cache-godot
uses: actions/cache@v4
with:
path: |
~/.local/share/godot/**
/usr/local/bin/godot
~/.config/godot/**
key: ${{ runner.os }}-godot-${{ inputs.godot-version }}
- name: Download and config Godot Engine linux server and templates
shell: bash
if: steps.cache-godot.outputs.cache-hit != 'true'
run: |
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/
touch ~/.config/godot/editor_settings-4.tres
mv templates/* ~/.local/share/godot/export_templates/${{ inputs.godot-version }}.${{ inputs.godot-channel }}
rm -f Godot_v${{ inputs.godot-version }}-${{ inputs.godot-channel }}_linux.x86_64.zip Godot_v${{ inputs.godot-version }}-${{ inputs.godot-channel }}_export_templates.tpz
mv ./Godot_v${{ inputs.godot-version }}-${{ inputs.godot-channel }}_linux.x86_64 /usr/local/bin/godot
- name: Set Android SDK path in Godot Editor settings
if: steps.cache-godot.outputs.cache-hit != 'true'
shell: bash
env:
SETTINGS: |
[gd_resource type="EditorSettings" format=3]
[resource]
export/android/android_sdk_path = "/usr/local/lib/android/sdk"
export/android/shutdown_adb_on_exit = true
export/android/force_system_user = false
export/android/debug_keystore = "${{ github.action_path }}/debug.keystore"
export/android/debug_keystore_user = "androiddebugkey"
export/android/debug_keystore_pass = "android"
run: echo $SETTINGS >> ~/.config/godot/editor_settings-4.tres
- name: Install Android build template
shell: bash
run: |
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/export_templates/${{ inputs.godot-version }}.stable/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 --headless --path ${{ inputs.working-directory }} -e
- name: Export
shell: bash
run: godot --headless --path ${{ inputs.working-directory }} --export-release Android