mirror of
https://gitea.sffempire.ru/Kolyah35/minecraft-pe-0.6.1.git
synced 2026-03-19 22:43:32 +00:00
Hopefully added Android building to the workflow
please work
This commit is contained in:
75
.github/workflows/build.yml
vendored
75
.github/workflows/build.yml
vendored
@@ -100,10 +100,76 @@ jobs:
|
|||||||
${{github.workspace}}/build/MinecraftPE
|
${{github.workspace}}/build/MinecraftPE
|
||||||
${{github.workspace}}/build/MinecraftPE-server
|
${{github.workspace}}/build/MinecraftPE-server
|
||||||
|
|
||||||
|
build-android: # pray to god
|
||||||
|
name: Build Android APK
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
ANDROID_SDK_ROOT: ${{ github.workspace }}/android-sdk
|
||||||
|
ANDROID_NDK_PATH: ${{ env.ANDROID_NDK_PATH }}
|
||||||
|
ANDROID_PLATFORM_API: 36
|
||||||
|
ANDROID_BUILD_TOOLS_VERSION: 36.0.0
|
||||||
|
ADB: /bin/true
|
||||||
|
JAVA_HOME: ${{ env.JAVA_HOME }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Install system prerequisites
|
||||||
|
run: |
|
||||||
|
sudo apt-get update -qq
|
||||||
|
sudo apt-get install -y --no-install-recommends wget unzip curl git python3 libncurses6 libtinfo6
|
||||||
|
if ! ldconfig -p | grep -q "libncurses.so.5"; then
|
||||||
|
sudo ln -sf /lib/x86_64-linux-gnu/libncurses.so.6 /usr/lib/x86_64-linux-gnu/libncurses.so.5 || true
|
||||||
|
fi
|
||||||
|
if ! ldconfig -p | grep -q "libtinfo.so.5"; then
|
||||||
|
sudo ln -sf /lib/x86_64-linux-gnu/libtinfo.so.6 /usr/lib/x86_64-linux-gnu/libtinfo.so.5 || true
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Setup Java 25
|
||||||
|
uses: actions/setup-java@v4
|
||||||
|
with:
|
||||||
|
distribution: temurin
|
||||||
|
java-version: 25
|
||||||
|
|
||||||
|
- name: Setup Android command line tools
|
||||||
|
run: |
|
||||||
|
mkdir -p "$ANDROID_SDK_ROOT/cmdline-tools"
|
||||||
|
curl -o cmdline-tools.zip -L "https://dl.google.com/android/repository/commandlinetools-linux-9477386_latest.zip"
|
||||||
|
unzip -q cmdline-tools.zip -d "$ANDROID_SDK_ROOT/cmdline-tools"
|
||||||
|
mv "$ANDROID_SDK_ROOT/cmdline-tools/cmdline-tools" "$ANDROID_SDK_ROOT/cmdline-tools/latest"
|
||||||
|
yes | "$ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager" --sdk_root="$ANDROID_SDK_ROOT" "platform-tools" "platforms;android-${ANDROID_PLATFORM_API}" "build-tools;${ANDROID_BUILD_TOOLS_VERSION}"
|
||||||
|
|
||||||
|
- name: Install Android NDK r14b
|
||||||
|
run: |
|
||||||
|
curl -L -o ndk.zip "https://dl.google.com/android/repository/android-ndk-r14b-linux-x86_64.zip"
|
||||||
|
unzip -q ndk.zip -d "$GITHUB_WORKSPACE"
|
||||||
|
echo "ANDROID_NDK_PATH=$GITHUB_WORKSPACE/android-ndk-r14b" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Validate environment
|
||||||
|
run: |
|
||||||
|
echo "ANDROID_SDK_ROOT=$ANDROID_SDK_ROOT"
|
||||||
|
echo "ANDROID_NDK_PATH=$ANDROID_NDK_PATH"
|
||||||
|
echo "JAVA_HOME=$JAVA_HOME"
|
||||||
|
$ANDROID_SDK_ROOT/platform-tools/adb version || true
|
||||||
|
java -version
|
||||||
|
javac -version
|
||||||
|
|
||||||
|
- name: Run Android build script
|
||||||
|
run: |
|
||||||
|
chmod +x ./build.sh
|
||||||
|
./build.sh
|
||||||
|
|
||||||
|
- name: Upload APK
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: minecraftpe-apk
|
||||||
|
path: |
|
||||||
|
${{ github.workspace }}/build-apk/minecraftpe-debug.apk
|
||||||
|
|
||||||
publish:
|
publish:
|
||||||
name: Publish
|
name: Publish
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [ build-windows, build-linux ]
|
needs: [ build-windows, build-linux, build-android ]
|
||||||
if: github.ref == 'refs/heads/main'
|
if: github.ref == 'refs/heads/main'
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@@ -136,6 +202,12 @@ jobs:
|
|||||||
files: mcpe-linux/MinecraftPE-server
|
files: mcpe-linux/MinecraftPE-server
|
||||||
dest: minecraftpe-server-${{ steps.ref.outputs.hash }}.zip
|
dest: minecraftpe-server-${{ steps.ref.outputs.hash }}.zip
|
||||||
|
|
||||||
|
- name: Zip Android Artifact
|
||||||
|
uses: vimtor/action-zip@v1.2
|
||||||
|
with:
|
||||||
|
files: mcpe-apk/minecraftpe-debug.apk
|
||||||
|
dest: minecraftpe-${{ steps.ref.outputs.hash }}-android.zip
|
||||||
|
|
||||||
- name: Update Development Release
|
- name: Update Development Release
|
||||||
uses: andelf/nightly-release@main
|
uses: andelf/nightly-release@main
|
||||||
env:
|
env:
|
||||||
@@ -149,3 +221,4 @@ jobs:
|
|||||||
./minecraftpe-${{ steps.ref.outputs.hash }}-windows.zip
|
./minecraftpe-${{ steps.ref.outputs.hash }}-windows.zip
|
||||||
./minecraftpe-${{ steps.ref.outputs.hash }}-linux.zip
|
./minecraftpe-${{ steps.ref.outputs.hash }}-linux.zip
|
||||||
./minecraftpe-server-${{ steps.ref.outputs.hash }}.zip
|
./minecraftpe-server-${{ steps.ref.outputs.hash }}.zip
|
||||||
|
./minecraftpe-${{ steps.ref.outputs.hash }}-android.zip
|
||||||
Reference in New Issue
Block a user