Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions .github/workflows/export-ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,24 +40,28 @@ jobs:
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles
- name: "Download and Install Godot 4.3"
continue-on-error: false
continue-on-error: true
shell: bash
run: |
GODOT_VERSION=4.3
brew install --cask https://raw.githubusercontent.com/Homebrew/homebrew-cask/83c65eee142d41cbef5de9b2026a33a353819ffe/Casks/g/godot.rb

wget https://raw.githubusercontent.com/Homebrew/homebrew-cask/83c65eee142d41cbef5de9b2026a33a353819ffe/Casks/g/godot.rb
brew install --HEAD -s godot.rb
- name: "Download Export Templates"
run: |
GODOT_VERSION=4.3
mkdir -v -p "/Users/runner/Library/Application Support/Godot/export_templates"
GODOT_TEMPLATES_PACKAGE=Godot_v$GODOT_VERSION-stable_export_templates.tpz
wget -q https://github.com/godotengine/godot/releases/download/$GODOT_VERSION-stable/$GODOT_TEMPLATES_PACKAGE -P ${{ runner.temp }}
unzip ${{ runner.temp }}/$GODOT_TEMPLATES_PACKAGE -d "/Users/runner/Library/Application Support/Godot/export_templates"
mv "/Users/runner/Library/Application Support/Godot/export_templates/templates" "/Users/runner/Library/Application Support/Godot/export_templates/$GODOT_VERSION.stable"

- name: "Update Project"
if: ${{ !cancelled() }}
timeout-minutes: 1
continue-on-error: true # we still ignore the timeout, the script is not quit and we run into a timeout
shell: bash
run: |
godot -e --path . -s res://addons/gdUnit4/bin/ProjectScanner.gd --headless --audio-driver Dummy
godot --headless --audio-driver Dummy --import --editor --quit-after 2
- name: Install release presets
run: |
rm export_presets.cfg
Expand All @@ -74,7 +78,7 @@ jobs:
continue-on-error: true
run: |
mkdir -v -p build/ios
godot -v --headless --audio-driver Dummy --export-release "ios" "build/ios/ratwars-ios.ipa"
godot -v --headless --audio-driver Dummy --export-release "ios" "build/ios/ratwars-ios.ipa" --quit-after 5
- name: Check build
if: ${{ !cancelled() }}
run: |
Expand Down
79 changes: 42 additions & 37 deletions .github/workflows/export.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,15 @@ jobs:
security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
security list-keychain -d user -s $KEYCHAIN_PATH
- name: "Download and Install Godot 4.3"
continue-on-error: false
continue-on-error: true
shell: bash
run: |
GODOT_VERSION=4.3
brew install --cask https://raw.githubusercontent.com/Homebrew/homebrew-cask/83c65eee142d41cbef5de9b2026a33a353819ffe/Casks/g/godot.rb

wget https://raw.githubusercontent.com/Homebrew/homebrew-cask/83c65eee142d41cbef5de9b2026a33a353819ffe/Casks/g/godot.rb
brew install --HEAD -s godot.rb
- name: "Download Export Templates"
run: |
GODOT_VERSION=4.3
mkdir -v -p "/Users/runner/Library/Application Support/Godot/export_templates"
GODOT_TEMPLATES_PACKAGE=Godot_v$GODOT_VERSION-stable_export_templates.tpz
wget -q https://github.com/godotengine/godot/releases/download/$GODOT_VERSION-stable/$GODOT_TEMPLATES_PACKAGE -P ${{ runner.temp }}
Expand All @@ -97,9 +100,9 @@ jobs:
brew install gnu-sed
PATH="/usr/local/opt/gnu-sed/libexec/gnubin:$PATH"
echo -n "$APPSTORE_KEY" >$RUNNER_TEMP/appstore.p8
sed 's@notarization/api_uuid=".*"@notarization/api_uuid="'${{ secrets.APPSTORE_ISSUER_ID }}'"@g' -i export_presets.cfg
sed 's@notarization/api_key=".*"@notarization/api_key="'$RUNNER_TEMP/appstore.p8'"@g' -i export_presets.cfg
sed 's@notarization/api_key_id=".*"@notarization/api_key_id="'${{ secrets.APPSTORE_API_KEY_ID }}'"@g' -i export_presets.cfg
gsed 's@notarization/api_uuid=".*"@notarization/api_uuid="'${{ secrets.APPSTORE_ISSUER_ID }}'"@g' -i export_presets.cfg
gsed 's@notarization/api_key=".*"@notarization/api_key="'$RUNNER_TEMP/appstore.p8'"@g' -i export_presets.cfg
gsed 's@notarization/api_key_id=".*"@notarization/api_key_id="'${{ secrets.APPSTORE_API_KEY_ID }}'"@g' -i export_presets.cfg
- name: Install production config
if: ${{ success() }}
run: |
Expand All @@ -108,9 +111,10 @@ jobs:
- name: Build
if: ${{ success() }}
timeout-minutes: 10
continue-on-error: true
run: |
mkdir -v -p build/macos
godot -v --headless --audio-driver Dummy --export-release "macos" "build/macos/ratwars-macos.zip"
godot -v --headless --audio-driver Dummy --export-release "macos" "build/macos/ratwars-macos.zip" --quit-after 5
- name: Check build
if: ${{ !cancelled() }}
run: |
Expand All @@ -135,7 +139,7 @@ jobs:
asset_name: ratwars-macos.zip
asset_content_type: application/octet-stream
- name: Set up butler
uses: jdno/setup-butler@v1
uses: remarkablegames/setup-butler@v1
- name: Push to healthnoise.itch.io
if: ${{ github.ref_type == 'tag' && startsWith(github.ref, 'refs/tags/v') && success() }}
run: butler push build/macos/ratwars-macos.zip healthnoise/ratwars:macos --userversion ${{github.ref_name}}
Expand Down Expand Up @@ -190,7 +194,7 @@ jobs:
continue-on-error: true # we still ignore the timeout, the script is not quit and we run into a timeout
shell: bash
run: |
godot -e --path . -s res://addons/gdUnit4/bin/ProjectScanner.gd --headless --audio-driver Dummy
godot --headless --audio-driver Dummy --import --editor --quit-after 2

- name: Install release presets
run: |
Expand All @@ -205,20 +209,15 @@ jobs:
sed 's@keystore/release=".*"@keystore/release="'/root/release.keystore'"@g' -i export_presets.cfg
sed 's@keystore/release_user=".*"@keystore/release_user="'${{ secrets.ANDROID_RELEASE_KEYSTORE_USER }}'"@g' -i export_presets.cfg
sed 's@keystore/release_password=".*"@keystore/release_password="'${{ secrets.ANDROID_RELEASE_KEYSTORE_PASSWORD }}'"@g' -i export_presets.cfg
sed 's|export/android/android_sdk_path = ".*"|export/android/android_sdk_path = "'/usr/lib/android-sdk'"|g' -i /root/.config/godot/editor_settings-4.tres
sed 's|export/android/android_sdk_path = ".*"|export/android/android_sdk_path = "'/usr/lib/android-sdk'"|g' -i /root/.config/godot/editor_settings-4.3.tres
mkdir -v -p ~/.config/godot
cp -v /root/.config/godot/editor_settings-4.tres ~/.config/godot/
cp -v /root/.config/godot/editor_settings-4.3.tres ~/.config/godot/

- name: Setup (Windows)
if: ${{matrix.build.preset == 'win' }}
run: |
apt update && apt -yy install wine64
WINE_PATH=$(which wine64)
cp .github/rcedit-x64.exe $RUNNER_TEMP/
sed 's|export/windows/rcedit = ".*"|export/windows/rcedit = "'$RUNNER_TEMP/rcedit-x64.exe'"|g' -i /root/.config/godot/editor_settings-4.tres
sed 's|export/windows/wine = ".*"|export/windows/wine = "$WINE_PATH"|g' -i /root/.config/godot/editor_settings-4.tres
mkdir -v -p ~/.config/godot
cp -v /root/.config/godot/editor_settings-4.tres ~/.config/godot
mkdir -v -p ~/.config/
mv /root/.config/godot ~/.config/godot

- name: Install production config
if: ${{ !cancelled() && github.ref_type == 'tag' && startsWith(github.ref, 'refs/tags/v') }}
Expand All @@ -230,28 +229,34 @@ jobs:
- name: Build
if: ${{ !cancelled() }}
timeout-minutes: 10
continue-on-error: true
run: |
mkdir -v -p ${{matrix.build.path}}
godot -v --headless --audio-driver Dummy --export-release "${{matrix.build.preset}}" "${{matrix.build.output}}"

- name: Build (Android Play Store)
timeout-minutes: 10
if: ${{ matrix.build.preset == 'android' }}
shell: bash
run: |
mkdir -v -p build/android-aab
sed 's@gradle_build/export_format=.*@gradle_build/export_format=1@g' -i export_presets.cfg
godot -v --headless --audio-driver Dummy --export-release "${{matrix.build.preset}}" "build/android-aab/RatWars.aab"
if [ ! -f "build/android-aab/RatWars.aab" ]; then
echo "Build failed"
exit 1
godot -v --headless --export-release "${{matrix.build.preset}}" "${{matrix.build.output}}" || true
if [ ! -f "${{matrix.build.output}}" ]; then
godot -v --headless --export-release "${{matrix.build.preset}}" "${{matrix.build.output}}"
fi

# - name: Build (Android Play Store)
# timeout-minutes: 10
# if: ${{ matrix.build.preset == 'android' }}
# shell: bash
# continue-on-error: true
# run: |
# mkdir -v -p build/android-aab
# sed 's@gradle_build/export_format=.*@gradle_build/export_format=1@g' -i export_presets.cfg
# godot -v --headless --audio-driver Dummy --export-release "${{matrix.build.preset}}" "build/android-aab/RatWars.aab" --quit-after 5
# if [ ! -f "build/android-aab/RatWars.aab" ]; then
# echo "Build failed"
# exit 1
# fi

- name: Check build
if: ${{ !cancelled() }}
run: |
if [ ! -f "${{matrix.build.output}}" ]; then
echo "Build failed"
ls -laR ./build
exit 1
fi

Expand All @@ -268,12 +273,12 @@ jobs:
name: ratwars-${{matrix.build.tag}}
path: ${{matrix.build.path}}

- name: Publish Artifact (Android Play Store)
if: ${{ success() && matrix.build.preset == 'android' }}
uses: actions/upload-artifact@v4
with:
name: ratwars-${{matrix.build.tag}}-aab
path: build/android-aab/RatWars.aab
# - name: Publish Artifact (Android Play Store)
# if: ${{ success() && matrix.build.preset == 'android' }}
# uses: actions/upload-artifact@v4
# with:
# name: ratwars-${{matrix.build.tag}}-aab
# path: build/android-aab/RatWars.aab

- name: Upload Release Asset
if: ${{ github.ref_type == 'tag' && startsWith(github.ref, 'refs/tags/v') && success() }}
Expand Down
2 changes: 1 addition & 1 deletion android/.build_version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.2.stable
4.3.stable
5 changes: 4 additions & 1 deletion android/build/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.godot.game"
android:versionCode="1"
android:versionName="1.0"
android:installLocation="auto" >
Expand All @@ -25,6 +24,10 @@
android:hasFragileUserData="false"
android:requestLegacyExternalStorage="false"
tools:ignore="GoogleAppIndexingWarning" >
<profileable
android:shell="true"
android:enabled="true"
tools:targetApi="29" />

<!-- Records the version of the Godot editor used for building -->
<meta-data
Expand Down
4 changes: 3 additions & 1 deletion android/build/assetPacks/installTime/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
apply plugin: 'com.android.asset-pack'
plugins {
id 'com.android.asset-pack'
}

assetPack {
packName = "installTime" // Directory name for the asset pack
Expand Down
88 changes: 73 additions & 15 deletions android/build/build.gradle
Original file line number Diff line number Diff line change
@@ -1,17 +1,4 @@
// Gradle build config for Godot Engine's Android port.
buildscript {
apply from: 'config.gradle'

repositories {
google()
mavenCentral()
}
dependencies {
classpath libraries.androidGradlePlugin
classpath libraries.kotlinGradlePlugin
}
}

plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
Expand All @@ -23,6 +10,8 @@ allprojects {
repositories {
google()
mavenCentral()
gradlePluginPortal()
maven { url "https://plugins.gradle.org/m2/" }

// Godot user plugins custom maven repos
String[] mavenRepos = getGodotPluginsMavenRepos()
Expand All @@ -42,8 +31,8 @@ configurations {
}

dependencies {
implementation libraries.kotlinStdLib
implementation libraries.androidxFragment
implementation "androidx.fragment:fragment:$versions.fragmentVersion"
implementation "androidx.core:core-splashscreen:$versions.splashscreenVersion"

if (rootProject.findProject(":lib")) {
implementation project(":lib")
Expand Down Expand Up @@ -88,6 +77,8 @@ android {

assetPacks = [":assetPacks:installTime"]

namespace = 'com.godot.game'

defaultConfig {
// The default ignore pattern for the 'assets' directory includes hidden files and directories which are used by Godot projects.
aaptOptions {
Expand Down Expand Up @@ -126,6 +117,20 @@ android {
if (shouldNotStrip()) {
doNotStrip '**/*.so'
}

jniLibs {
// Setting this to true causes AGP to package compressed native libraries when building the app
// For more background, see:
// - https://developer.android.com/build/releases/past-releases/agp-3-6-0-release-notes#extractNativeLibs
// - https://stackoverflow.com/a/44704840
useLegacyPackaging shouldUseLegacyPackaging()
}

// Always select Godot's version of libc++_shared.so in case deps have their own
pickFirst 'lib/x86/libc++_shared.so'
pickFirst 'lib/x86_64/libc++_shared.so'
pickFirst 'lib/armeabi-v7a/libc++_shared.so'
pickFirst 'lib/arm64-v8a/libc++_shared.so'
}

signingConfigs {
Expand Down Expand Up @@ -207,37 +212,90 @@ android {
}

task copyAndRenameDebugApk(type: Copy) {
// The 'doNotTrackState' is added to disable gradle's up-to-date checks for output files
// and directories. Otherwise this check may cause permissions access failures on Windows
// machines.
doNotTrackState("No need for up-to-date checks for the copy-and-rename operation")

from "$buildDir/outputs/apk/debug/android_debug.apk"
into getExportPath()
rename "android_debug.apk", getExportFilename()
}

task copyAndRenameDevApk(type: Copy) {
// The 'doNotTrackState' is added to disable gradle's up-to-date checks for output files
// and directories. Otherwise this check may cause permissions access failures on Windows
// machines.
doNotTrackState("No need for up-to-date checks for the copy-and-rename operation")

from "$buildDir/outputs/apk/dev/android_dev.apk"
into getExportPath()
rename "android_dev.apk", getExportFilename()
}

task copyAndRenameReleaseApk(type: Copy) {
// The 'doNotTrackState' is added to disable gradle's up-to-date checks for output files
// and directories. Otherwise this check may cause permissions access failures on Windows
// machines.
doNotTrackState("No need for up-to-date checks for the copy-and-rename operation")

from "$buildDir/outputs/apk/release/android_release.apk"
into getExportPath()
rename "android_release.apk", getExportFilename()
}

task copyAndRenameDebugAab(type: Copy) {
// The 'doNotTrackState' is added to disable gradle's up-to-date checks for output files
// and directories. Otherwise this check may cause permissions access failures on Windows
// machines.
doNotTrackState("No need for up-to-date checks for the copy-and-rename operation")

from "$buildDir/outputs/bundle/debug/build-debug.aab"
into getExportPath()
rename "build-debug.aab", getExportFilename()
}

task copyAndRenameDevAab(type: Copy) {
// The 'doNotTrackState' is added to disable gradle's up-to-date checks for output files
// and directories. Otherwise this check may cause permissions access failures on Windows
// machines.
doNotTrackState("No need for up-to-date checks for the copy-and-rename operation")

from "$buildDir/outputs/bundle/dev/build-dev.aab"
into getExportPath()
rename "build-dev.aab", getExportFilename()
}

task copyAndRenameReleaseAab(type: Copy) {
// The 'doNotTrackState' is added to disable gradle's up-to-date checks for output files
// and directories. Otherwise this check may cause permissions access failures on Windows
// machines.
doNotTrackState("No need for up-to-date checks for the copy-and-rename operation")

from "$buildDir/outputs/bundle/release/build-release.aab"
into getExportPath()
rename "build-release.aab", getExportFilename()
}

/**
* Used to validate the version of the Java SDK used for the Godot gradle builds.
*/
task validateJavaVersion {
if (JavaVersion.current() != versions.javaVersion) {
throw new GradleException("Invalid Java version ${JavaVersion.current()}. Version ${versions.javaVersion} is the required Java version for Godot gradle builds.")
}
}

/*
When they're scheduled to run, the copy*AARToAppModule tasks generate dependencies for the 'app'
module, so we're ensuring the ':app:preBuild' task is set to run after those tasks.
*/
if (rootProject.tasks.findByPath("copyDebugAARToAppModule") != null) {
preBuild.mustRunAfter(rootProject.tasks.named("copyDebugAARToAppModule"))
}
if (rootProject.tasks.findByPath("copyDevAARToAppModule") != null) {
preBuild.mustRunAfter(rootProject.tasks.named("copyDevAARToAppModule"))
}
if (rootProject.tasks.findByPath("copyReleaseAARToAppModule") != null) {
preBuild.mustRunAfter(rootProject.tasks.named("copyReleaseAARToAppModule"))
}
Loading
Loading