build-native #67
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
name: build-native | |
on: | |
workflow_dispatch: | |
inputs: {} | |
# schedule: | |
# - cron: '0 0 * * *' | |
env: | |
BUILD_TYPE: Release | |
jobs: | |
build-android: | |
name: android | |
runs-on: ubuntu-20.04 | |
env: | |
NDK_VER: 23.1.7779620 | |
PLATFORM_VER: android-34 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
repository: 'libsdl-org/SDL' | |
ref: 'SDL2' | |
- uses: actions/checkout@v4 | |
with: | |
path: 'NAudio-Sdl2-Library' | |
- name: Setup JDK | |
uses: actions/setup-java@v4 | |
with: | |
distribution: microsoft | |
java-version: | | |
11 | |
17 | |
- name: Install Android SDK Manager | |
uses: android-actions/setup-android@v3 | |
with: | |
packages: '' | |
- name: Install Android SDK | |
run: | | |
sdkmanager --install "platform-tools" "platforms;$PLATFORM_VER" | |
sdkmanager --install "ndk;$NDK_VER" --channel=3 | |
- name: Build (Android) | |
run: | | |
export PATH=$ANDROID_HOME/ndk/$NDK_VER:$PATH | |
export OUTPUT=$PWD/native/android | |
rm -rf $OUTPUT && mkdir -p $OUTPUT | |
# Build SDL2 | |
sed -i 's/abi=.*/abi="armeabi-v7a arm64-v8a x86 x86_64"/g' build-scripts/androidbuildlibs.sh | |
build-scripts/androidbuildlibs.sh NDK_LIBS_OUT="$OUTPUT" | |
- name: Prepare release directory (android) | |
run: mkdir -p NAudio-Sdl2-Library/NAudio.Sdl2.Library/native/android | |
- name: Prepare release (android) | |
run: | | |
mkdir -p NAudio-Sdl2-Library/NAudio.Sdl2.Library/native/android/arm64-v8a; | |
mkdir -p NAudio-Sdl2-Library/NAudio.Sdl2.Library/native/android/armeabi-v7a; | |
mkdir -p NAudio-Sdl2-Library/NAudio.Sdl2.Library/native/android/x86; | |
mkdir -p NAudio-Sdl2-Library/NAudio.Sdl2.Library/native/android/x86_64; | |
cp NAudio-Sdl2-Library/native/android/arm64-v8a/libSDL2.so NAudio-Sdl2-Library/NAudio.Sdl2.Library/native/android/arm64-v8a/libSDL2.so; | |
cp NAudio-Sdl2-Library/native/android/armeabi-v7a/libSDL2.so NAudio-Sdl2-Library/NAudio.Sdl2.Library/native/android/armeabi-v7a/libSDL2.so; | |
cp NAudio-Sdl2-Library/native/android/x86/libSDL2.so NAudio-Sdl2-Library/NAudio.Sdl2.Library/native/android/x86/libSDL2.so; | |
cp NAudio-Sdl2-Library/native/android/x86_64/libSDL2.so NAudio-Sdl2-Library/NAudio.Sdl2.Library/native/android/x86_64/libSDL2.so; | |
- name: Build SDL2 Android Java | |
run: | | |
export JAVA_HOME=$JAVA_HOME_11_X64 | |
export PATH=$JAVA_HOME_11_X64/bin:$PATH | |
export OUTPUT=$PWD/Jars/ | |
rm -rf $OUTPUT && mkdir -p $OUTPUT | |
# Build SDL2 Android Java part | |
cd android-project/app/src/main/java | |
javac -cp $ANDROID_HOME/platforms/$PLATFORM_VER/android.jar -encoding utf8 org/libsdl/app/*.java | |
jar cvf $OUTPUT/SDL2AndroidBridge.jar org/libsdl/app/*.class | |
- name: Prepare release directory (android java) | |
run: mkdir -p NAudio-Sdl2-Library/NAudio.Sdl2.Library.Android | |
- name: Prepare release (android java) | |
run: | | |
mkdir -p NAudio-Sdl2-Library/NAudio.Sdl2.Library.Android/Jars; | |
cp NAudio-Sdl2-Library/Jars/SDL2AndroidBridge.jar NAudio-Sdl2-Library/NAudio.Sdl2.Library.Android/Jars/SDL2AndroidBridge.jar; | |
- name: Create pull request | |
uses: peter-evans/create-pull-request@v6 | |
with: | |
commit-message: Update android SDL binaries | |
title: Update android SDL binaries | |
body: This PR has been auto-genereated to update the android SDL binaries | |
branch: update-android-binaries | |
path: 'NAudio-Sdl2-Library' | |
env: | |
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true' |