diff --git a/.github/workflows/gut.yml b/.github/workflows/gut.yml index c62201f..660b4e3 100644 --- a/.github/workflows/gut.yml +++ b/.github/workflows/gut.yml @@ -1,5 +1,6 @@ name: "Godot" -on: push + +on: [push] jobs: execute-gut: @@ -11,6 +12,6 @@ jobs: - name: Execute GUT Unit Test uses: ceceppa/godot-gut-ci@main with: - godot_version: 4.2.1 + godot_version: 4.2.2 gut_params: -gdir=res://src/test/unit -gprefix=test_ -gsuffix=.gd project_path: godot \ No newline at end of file diff --git a/.github/workflows/linux_build.yml b/.github/workflows/linux_build.yml index a0b5ba0..85a79e8 100644 --- a/.github/workflows/linux_build.yml +++ b/.github/workflows/linux_build.yml @@ -1,4 +1,4 @@ -name: Linux Build Test +name: Linux Build on: [push] diff --git a/.github/workflows/linux_export.yml b/.github/workflows/linux_export.yml new file mode 100644 index 0000000..870ca78 --- /dev/null +++ b/.github/workflows/linux_export.yml @@ -0,0 +1,94 @@ +name: Linux Export + +on: [push] + +env: + CARGO_TERM_COLOR: always + RUSTFLAGS: -Dwarnings + CARGO_INCREMENTAL: 0 + +jobs: + export-linux: # For now only debug export, as the release export has a bug on the Godot side + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: rui314/setup-mold@v1 + - uses: chickensoft-games/setup-godot@v1 + name: Setup Godot + with: + version: 4.2.2 + include-templates: true + use-dotnet: false + - uses: Swatinem/rust-cache@v2 + with: + workspaces: "rust -> target" + cache-all-crates: "true" + - name: Build + run: cd rust; cargo build + + - name: Godot Check + run: | + godot --version + + - name: Godot Export + run: | + cd godot + godot --headless --import --export-debug "Linux/X11" "../export/linux/Godot Spike.x86_64" + + export-android: # Release export + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: rui314/setup-mold@v1 + - uses: actions/setup-java@v4 + with: + distribution: "oracle" + java-version: "22" + - uses: chickensoft-games/setup-godot@v1 + name: Setup Godot + with: + version: 4.2.2 + include-templates: true + use-dotnet: false + - uses: Swatinem/rust-cache@v2 + with: + workspaces: "rust -> target" + cache-all-crates: "true" + + - name: Setup Android + run: | + keytool --version + rustup target add aarch64-linux-android + cargo install cargo-ndk + scripts/install-android-tools.sh + test -f "secrets/debug.keystore" || \ + keytool -keyalg RSA -genkeypair -alias androiddebugkey \ + -keypass android -keystore "secrets/debug.keystore" \ + -storepass android -dname "CN=Android Debug,O=Android,C=US" \ + -validity 9999 -deststoretype pkcs12 + + - name: Build + run: | + cd rust + cargo build --release --target aarch64-linux-android + + - name: Godot Check + run: | + godot --version + + - name: Godot Export + run: | + touch ~/.local/share/godot/editor_settings-4.tres + pwd + ls secrets + ls $(pwd)/secrets + echo "[gd_resource type=\"EditorSettings\" format=3]" >> ~/.local/share/godot/editor_settings-4.tres + echo "[resource]" >> ~/.local/share/godot/editor_settings-4.tres + echo "export/android/android_sdk_path = \"$(pwd)/dependencies/android-sdk\"" >> ~/.local/share/godot/editor_settings-4.tres + echo "export/android/debug_keystore = \"$(pwd)/secrets/debug.keystore\"" >> ~/.local/share/godot/editor_settings-4.tres + echo "export/android/debug_keystore_user = \"androiddebugkey\"" >> ~/.local/share/godot/editor_settings-4.tres + echo "export/android/debug_keystore_pass = \"android\"" >> ~/.local/share/godot/editor_settings-4.tres + cat ~/.local/share/godot/editor_settings-4.tres + cd godot + ls ../dependencies/android-sdk + godot --headless --export-release "Android" "../export/android/Godot Spike.apk" diff --git a/.github/workflows/windows_build.yml b/.github/workflows/windows_build.yml index 8293c4c..0d2dc8b 100644 --- a/.github/workflows/windows_build.yml +++ b/.github/workflows/windows_build.yml @@ -1,4 +1,4 @@ -name: Windows Build Test +name: Windows Build on: [push] diff --git a/godot/RustPlugin.gdextension b/godot/RustPlugin.gdextension index d08c21d..1df900b 100644 --- a/godot/RustPlugin.gdextension +++ b/godot/RustPlugin.gdextension @@ -4,17 +4,20 @@ compatibility_minimum = 4.2 reloadable = false [libraries] -linux.release.x86_64 = "res://../rust/target/release/libgodot_plugin.so" linux.debug.x86_64 = "res://../rust/target/debug/libgodot_plugin.so" +linux.release.x86_64 = "res://../rust/target/release/libgodot_plugin.so" + +android.debug.x86_64 = "res://../rust/target/x86_64-linux-android/debug/libgodot_plugin.so" +android.release.x86_64 = "res://../rust/target/x86_64-linux-android/release/libgodot_plugin.so" -android.release.arm64 = "res://../rust/target/aarch64-linux-android/debug/libgodot_plugin.so" -android.debug.arm64 = "res://../rust/target/aarch64-linux-android/release/libgodot_plugin.so" +android.debug.arm64 = "res://../rust/target/aarch64-linux-android/debug/libgodot_plugin.so" +android.release.arm64 = "res://../rust/target/aarch64-linux-android/release/libgodot_plugin.so" -windows.debug.x86_64 = "res://../rust/target/debug/godot_plugin.dll" -windows.release.x86_64 = "res://../rust/target/release/godot_plugin.dll" +windows.debug.x86_64 = "res://../rust/target/x86_64-pc-windows-msvc/debug/godot_plugin.dll" +windows.release.x86_64 = "res://../rust/target/x86_64-pc-windows-msvc/release/godot_plugin.dll" macos.debug = "res://../rust/target/debug/libgodot_plugin.dylib" macos.release = "res://../rust/target/release/libgodot_plugin.dylib" -#macos.debug.arm64 = "res://../rust/target/debug/lib{YourCrate}.dylib" -#macos.release.arm64 = "res://../rust/target/release/lib{YourCrate}.dylib" +#macos.debug.arm64 = "res://../rust/target/debug/lib{YourCrate}.dylib" +#macos.release.arm64 = "res://../rust/target/release/lib{YourCrate}.dylib" diff --git a/godot/export_presets.cfg b/godot/export_presets.cfg index c8917d3..f9e8a7f 100644 --- a/godot/export_presets.cfg +++ b/godot/export_presets.cfg @@ -202,7 +202,7 @@ gradle_build/target_sdk="" architectures/armeabi-v7a=false architectures/arm64-v8a=true architectures/x86=false -architectures/x86_64=false +architectures/x86_64=true version/code=1 version/name="" package/unique_name="org.catroid.godotspike" diff --git a/justfile b/justfile index 146ee1e..2560d62 100644 --- a/justfile +++ b/justfile @@ -29,7 +29,7 @@ android-debug: [linux] android-release: - {{rustdir}} cargo build --target aarch64-linux-android --release + {{rustdir}} cargo build --release --target aarch64-linux-android {{godotdir}} godot --headless --export-release "Android" "../export/android/Godot Spike.apk" [windows] @@ -39,7 +39,7 @@ windows-debug: [windows] windows-release: - {{rustdir}} cargo build --target x86_64-pc-windows-gnu --release + {{rustdir}} cargo build --release --target x86_64-pc-windows-msvc {{godotdir}} godot --headless --export-release "Windows Desktop" "../export/windows/Godot Spike.exe" [macos] @@ -61,7 +61,7 @@ ios-debug: [macos] ios-release: # NOTE: can only work on MacOS with xcode - {{rustdir}} cargo build --target aarch64-apple-ios --release + {{rustdir}} cargo build --release --target aarch64-apple-ios {{godotdir}} godot --headless --export-release "iOS" "../export/ios/Godot Spike.ipa" # -------------------------------------------------