This repository has been archived by the owner on Jun 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement linux export test as CI GitHub action (#80)
- Implement release export on linux for linux and android - Change dependabot to daily execution - Modify install-android-tools.sh in order to be cross platform - Modify justfile
- Loading branch information
1 parent
caa038d
commit 05944f5
Showing
11 changed files
with
185 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Linux Build Test | ||
name: Linux Build | ||
|
||
on: [push] | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
name: Linux Export | ||
|
||
on: [push] | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
RUSTFLAGS: -Dwarnings | ||
CARGO_INCREMENTAL: 0 | ||
|
||
jobs: | ||
export-linux: | ||
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: Install just | ||
run: cargo install just | ||
|
||
- name: just Check | ||
run: just --version | ||
|
||
- name: Godot Check | ||
run: | | ||
godot --version | ||
- name: Godot Export | ||
run: | | ||
set -x | ||
touch godot/.godot/extension_list.cfg | ||
echo "res://rust.gdextension" >> godot/.godot/extension_list.cfg | ||
cargo build --manifest-path=rust/Cargo.toml | ||
just linux-release | ||
export-android: | ||
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: Install just | ||
run: cargo install just | ||
|
||
- name: just Check | ||
run: just --version | ||
|
||
- name: Godot Check | ||
run: | | ||
godot --version | ||
- name: Godot Export | ||
run: | | ||
set -x | ||
touch godot/.godot/extension_list.cfg | ||
echo "res://rust.gdextension" >> godot/.godot/extension_list.cfg | ||
godot --headless -q -e --quit | ||
echo "export/android/java_sdk_path = \"$(dirname $(dirname $(which java)))\"" >> ~/.config/godot/editor_settings-4.tres | ||
echo "export/android/android_sdk_path = \"$(pwd)/dependencies/android-sdk/\"" >> ~/.config/godot/editor_settings-4.tres | ||
export GODOT_ANDROID_KEYSTORE_RELEASE_PATH="$PWD/secrets/debug.keystore" | ||
export GODOT_ANDROID_KEYSTORE_RELEASE_USER="androiddebugkey" | ||
export GODOT_ANDROID_KEYSTORE_RELEASE_PASSWORD="android" | ||
just setup-android | ||
cargo build --manifest-path=rust/Cargo.toml | ||
just android-release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Windows Build Test | ||
name: Windows Build | ||
|
||
on: [push] | ||
|
||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[configuration] | ||
entry_symbol = "gdext_rust_init" | ||
compatibility_minimum = 4.2 | ||
reloadable = false | ||
|
||
[libraries] | ||
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.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/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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
[target.aarch64-linux-android] | ||
linker = "../dependencies/android-sdk/ndk/26.2.11394342/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android34-clang" | ||
|
||
[target.x86_64-unknown-linux-gnu] | ||
linker = "clang" | ||
rustflags = ["-C", "link-arg=-fuse-ld=mold"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,50 @@ | ||
#!/bin/bash | ||
|
||
# TO USE THE LATEST VERSIONS: | ||
# Update the following strings: | ||
set -o errexit # Abort on nonzero exitstatus | ||
set -o nounset # Abort on unbound variable | ||
set -o pipefail # Don't hide errors within pipes | ||
set -x # Show all executed commands | ||
|
||
ANDROID_CMDLINE_URL="https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip" | ||
SDKMANAGER_PACKAGES="ndk;26.2.11394342 build-tools;33.0.0 build-tools;33.0.0 platform-tools" | ||
echo "This script will install the Android SDK into a subdirectory of this repo." | ||
echo | ||
|
||
# END OF VARIABLES | ||
# The rest of the script should not have to be touched. | ||
# Determine the operating system | ||
OS=$(uname) | ||
if [[ $OS == "Darwin" ]]; then # MacOS | ||
ANDROID_CMDLINE_URL="https://dl.google.com/android/repository/commandlinetools-mac-11076708_latest.zip" | ||
elif [[ $OS == CYGWIN* || $OS == MINGW* || $OS == MSYS* ]]; then # Windows | ||
ANDROID_CMDLINE_URL="https://dl.google.com/android/repository/commandlinetools-win-11076708_latest.zip" | ||
else # Linux | ||
ANDROID_CMDLINE_URL="https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip" | ||
fi | ||
|
||
set -o errexit # abort on nonzero exitstatus | ||
set -o nounset # abort on unbound variable | ||
set -o pipefail # don't hide errors within pipes | ||
set -x # show all executed commands | ||
# To use the latest versions, update the following strings: | ||
ANDROID_API_VERSION="34.0.0" | ||
ANDROID_NDK_VERSION="26.3.11579264" | ||
# Note: Do not forget to update also in justfile | ||
|
||
echo "This script will install the Android SDK into a subdirectory of this repo." | ||
echo | ||
SDKMANAGER_PACKAGES="ndk;$ANDROID_NDK_VERSION build-tools;$ANDROID_API_VERSION platform-tools" | ||
|
||
# The rest of the script should not have to be touched! | ||
|
||
ANDROID_SDK_ROOT="dependencies/android-sdk" | ||
ANDROID_HOME="$ANDROID_SDK_ROOT" # Deprecated: Still used by gradle, once gradle respects ANDROID_SDK_ROOT, this can be removed | ||
_SDKMANAGER="$ANDROID_SDK_ROOT/cmdline-tools/bin/sdkmanager" | ||
|
||
# ensure SDK folder is empty | ||
if [[ $OS == CYGWIN* || $OS == MINGW* || $OS == MSYS* ]]; then | ||
SDKMANAGER="$ANDROID_SDK_ROOT/cmdline-tools/bin/sdkmanager.bat" | ||
else | ||
SDKMANAGER="$ANDROID_SDK_ROOT/cmdline-tools/bin/sdkmanager" | ||
fi | ||
|
||
# Ensure SDK folder is empty | ||
rm -rf "$ANDROID_SDK_ROOT" | ||
mkdir -p $ANDROID_SDK_ROOT | ||
|
||
# install CLI tools | ||
# Install CLI tools | ||
curl $ANDROID_CMDLINE_URL --output /tmp/android_cmd.zip | ||
unzip -d $ANDROID_SDK_ROOT /tmp/android_cmd.zip | ||
|
||
# install rest of the requirements using sdkmanager | ||
yes "y" | $_SDKMANAGER --install $SDKMANAGER_PACKAGES --sdk_root="$ANDROID_SDK_ROOT" || true | ||
# Install rest of the requirements using sdkmanager | ||
yes "y" | $SDKMANAGER --install $SDKMANAGER_PACKAGES --sdk_root="$ANDROID_SDK_ROOT" || true | ||
|
||
exit 0 |