Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Commit

Permalink
Implement linux export test as CI GitHub action
Browse files Browse the repository at this point in the history
  • Loading branch information
dorianpercic committed Apr 24, 2024
1 parent 7e356b4 commit ec3560e
Show file tree
Hide file tree
Showing 7 changed files with 97 additions and 12 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/gut.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: "Godot"
on: push

on: [push]

jobs:
execute-gut:
Expand All @@ -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
2 changes: 1 addition & 1 deletion .github/workflows/linux_build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Linux Build Test
name: Linux Build

on: [push]

Expand Down
81 changes: 81 additions & 0 deletions .github/workflows/linux_export.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
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 --target aarch64-linux-android --release

- name: Godot Check
run: |
godot --version
- name: Godot Export
run: |
cd godot
ls ../dependencies/android-sdk
godot --headless --export-release "Android" "../export/android/Godot Spike.apk"
2 changes: 1 addition & 1 deletion .github/workflows/windows_build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Windows Build Test
name: Windows Build

on: [push]

Expand Down
15 changes: 9 additions & 6 deletions godot/RustPlugin.gdextension
Original file line number Diff line number Diff line change
Expand Up @@ -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.release.arm64 = "res://../rust/target/aarch64-linux-android/debug/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"
2 changes: 1 addition & 1 deletion godot/export_presets.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ encrypt_pck=false
encrypt_directory=false

[preset.4.options]

export/android/android_sdk_path = "../dependencies/android-sdk"
export/distribution_type=1
binary_format/architecture="universal"
custom_template/debug=""
Expand Down
2 changes: 1 addition & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ windows-debug:

[windows]
windows-release:
{{rustdir}} cargo build --target x86_64-pc-windows-gnu --release
{{rustdir}} cargo build --target x86_64-pc-windows-msvc --release
{{godotdir}} godot --headless --export-release "Windows Desktop" "../export/windows/Godot Spike.exe"

[macos]
Expand Down

0 comments on commit ec3560e

Please sign in to comment.