-
Notifications
You must be signed in to change notification settings - Fork 0
160 lines (139 loc) · 6.34 KB
/
Copy pathbuild.yml
File metadata and controls
160 lines (139 loc) · 6.34 KB
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
name: build
on:
workflow_dispatch:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
# Which godot version to use for exporting.
GODOT_VERSION: 4.5
# Which godot release to use for exporting. (stable/rc/beta/alpha)
GODOT_RELEASE: beta1
# Used in the editor config file name. Do not change this for patch releases.
GODOT_FEATURE_VERSION: 4.5
# Commit hash
GODOT_COMMIT_HASH: 46c495ca2
PROJECT_NAME: GodSVG Mobile
BUILD_OPTIONS: target=template_release lto=full production=yes deprecated=no minizip=no brotli=no vulkan=no openxr=no use_volk=no disable_3d=yes disable_physics_2d=yes disable_navigation_2d=yes modules_enabled_by_default=no module_freetype_enabled=yes module_gdscript_enabled=yes module_svg_enabled=yes module_jpg_enabled=yes module_text_server_adv_enabled=yes graphite=no module_webp_enabled=yes module_mbedtls_enabled=yes swappy=no build_profile=../godsvg/.github/disabled_classes.build
GODOT_REPO: https://github.com/godotengine/godot.git
jobs:
format:
name: File formatting (file_format.sh)
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install dependencies
run: sudo apt-get update -qq && sudo apt-get install -yq --no-install-recommends dos2unix recode
- name: File formatting checks (file_format.sh)
run: bash ./.github/file_format.sh
build-android:
name: Export for Android
runs-on: ubuntu-latest
env:
PLATFORM: "Android"
steps:
- name: Cache Template
id: cache-template
uses: actions/cache@v3
with:
key: template-${{ env.PLATFORM }}-${{ env.GODOT_VERSION }}-${{ env.GODOT_RELEASE }}-${{ env.BUILD_OPTIONS }}
path: |
~/.local/share/godot/export_templates/
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 17
distribution: temurin
- name: Set up Android SDK
uses: android-actions/setup-android@v3
- name: Check Installed Android SDK Packages
run: |
echo "Checking installed Android SDK packages..."
/usr/local/lib/android/sdk/cmdline-tools/latest/bin/sdkmanager --list_installed
- name: Set up Godot Editor
run: |
mkdir -p ~/godot-editor
cd ~/godot-editor
wget -q https://github.com/godotengine/godot-builds/releases/download/${GODOT_VERSION}-${GODOT_RELEASE}/Godot_v${GODOT_VERSION}-${GODOT_RELEASE}_linux.x86_64.zip
unzip Godot_v${GODOT_VERSION}-${GODOT_RELEASE}_linux.x86_64.zip
mv ./Godot_v${GODOT_VERSION}-${GODOT_RELEASE}_linux.x86_64 ~/godot-editor/godot
echo "~/godot-editor" >> $GITHUB_PATH
- if: ${{ steps.cache-template.outputs.cache-hit != 'true' }}
name: Install dependencies
run: sudo apt-get install -y scons python3
- if: ${{ steps.cache-template.outputs.cache-hit != 'true' }}
name: Clone Godot repository
run: git clone $GODOT_REPO godot
- if: ${{ steps.cache-template.outputs.cache-hit != 'true' }}
name: Checkout specific commit
run: |
cd godot
git fetch
git checkout $GODOT_COMMIT_HASH
- name: Checkout repository
uses: actions/checkout@v4
with:
path: godsvg
- if: ${{ steps.cache-template.outputs.cache-hit != 'true' }}
name: Build Godot template for Android
run: |
cd godot
scons p=android arch=arm64 generate_apk=yes ${BUILD_OPTIONS} target=template_debug
mkdir -p ~/.local/share/godot/export_templates/${GODOT_VERSION}.${GODOT_RELEASE}/
mv ./bin/android_debug.apk ~/.local/share/godot/export_templates/${GODOT_VERSION}.${GODOT_RELEASE}/android_debug.apk
mv ./bin/android_source.zip ~/.local/share/godot/export_templates/${GODOT_VERSION}.${GODOT_RELEASE}/android_source.zip
- if: ${{ steps.cache-template.outputs.cache-hit != 'true' }}
name: Build Godot release template for Android
run: |
cd godot
scons p=android arch=arm32 ${BUILD_OPTIONS} target=template_release
scons p=android arch=arm64 ${BUILD_OPTIONS} target=template_release generate_apk=yes
mkdir -p ~/.local/share/godot/export_templates/${GODOT_VERSION}.${GODOT_RELEASE}/
mv ./bin/android_release.apk ~/.local/share/godot/export_templates/${GODOT_VERSION}.${GODOT_RELEASE}/android_release.apk
mv ./bin/android_source.zip ~/.local/share/godot/export_templates/${GODOT_VERSION}.${GODOT_RELEASE}/android_source.zip
- name: Export debug project
env:
GODOT_ANDROID_KEYSTORE_DEBUG_PATH: "./godot_only/debug.keystore"
GODOT_ANDROID_KEYSTORE_DEBUG_USER: "androiddebugkey"
GODOT_ANDROID_KEYSTORE_DEBUG_PASSWORD: "android"
run: |
cd godsvg
mkdir -p build/android
godot --headless --export-debug "Android" build/android/GodSVG-Mobile-debug.apk
- name: Export release project
if: github.event.pull_request.head.repo.fork != true
env:
GODOT_ANDROID_KEYSTORE_RELEASE_PATH: "/tmp/release.keystore"
GODOT_ANDROID_KEYSTORE_RELEASE_USER: ${{ secrets.KEY_ALIAS }}
GODOT_ANDROID_KEYSTORE_RELEASE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
run: |
cd godsvg
mkdir -p build/android
echo "${{ secrets.KEYSTORE }}" | base64 -d > /tmp/release.keystore
godot --headless --export-release "Android(arm32)" build/android/GodSVG-Mobile-arm32.apk
godot --headless --export-release "Android" build/android/GodSVG-Mobile.apk
- name: Upload debug artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.PROJECT_NAME }}.debug
path: godsvg/build/android/GodSVG-Mobile-debug.apk
if-no-files-found: error
retention-days: 28
- name: Upload release artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.PROJECT_NAME }}
path: godsvg/build/android/GodSVG-Mobile.apk
if-no-files-found: ignore
retention-days: 28
- name: Upload arm32 APK
uses: actions/upload-artifact@v4
with:
name: ${{ env.PROJECT_NAME }}-arm32
path: godsvg/build/android/GodSVG-Mobile-arm32.apk
if-no-files-found: ignore
retention-days: 28