Поддержка android платформы для обновления
Some checks failed
Build rosetta-sdu / build (push) Failing after 8s

This commit is contained in:
RoyceDa
2026-02-26 19:22:56 +02:00
parent 91b7cfa911
commit f6eded56f0
3 changed files with 75 additions and 2 deletions

View File

@@ -0,0 +1,61 @@
name: Build rosetta-sdu
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build:
runs-on: java-builders
steps:
- name: Install Node.js
run: |
if command -v apt-get &> /dev/null; then
sudo apt-get update && sudo apt-get install -y nodejs npm
elif command -v brew &> /dev/null; then
brew install node
fi
- name: Checkout code
uses: actions/checkout@v6
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: maven
- name: Build with Maven
run: mvn clean package
- name: List build directory
run: ls -la build/
- name: Deploy to server via SSH
uses: appleboy/scp-action@v1
with:
host: ${{ secrets.SDU_SSH_HOST }}
username: ${{ secrets.SDU_SSH_USER }}
password: ${{ secrets.SDU_SSH_PASSWORD }}
port: ${{ secrets.SDU_SSH_PORT }}
source: "build/*"
target: ${{ secrets.SDU_DEPLOY_PATH }}
strip_components: 1
rm: false
debug: true
flatten: true
- name: Restart Docker containers
uses: appleboy/ssh-action@v1.2.5
with:
host: ${{ secrets.SDU_SSH_HOST }}
username: ${{ secrets.SDU_SSH_USER }}
password: ${{ secrets.SDU_SSH_PASSWORD }}
port: ${{ secrets.SDU_SSH_PORT }}
script: |
cd ${{ secrets.SDU_DEPLOY_PATH }}
docker-compose down
docker compose up -d --build

View File

@@ -44,7 +44,7 @@ public class Main {
}
// Значение по умолчанию.
return 8080;
return 7777;
}
private static void stopServer(HttpServer server) {

View File

@@ -43,6 +43,18 @@ public class UpdatesResource {
String normalizedApp = normalize(appVersion);
String normalizedKernel = normalize(kernelVersion);
if(normalizedPlatform != null && normalizedPlatform.equals("android")) {
Optional<KernelFileInfo> latestKernel = findLatestKernel(normalizedPlatform, "universal");
if (latestKernel.isPresent()) {
KernelFileInfo info = latestKernel.get();
String lastKernelVersion = info.version();
if(compareVersions(lastKernelVersion, normalizedKernel) > 0) {
return new UpdateResponse(null, normalizedPlatform, normalizedArch, true, null,
"/kernel/" + normalizedPlatform + "/universal/" + info.fileName());
}
}
}
// Приводим платформу и архитектуру к нижнему регистру для сопоставления с
// именами файлов.
if (normalizedPlatform != null) {
@@ -72,7 +84,7 @@ public class UpdatesResource {
boolean kernelUpdateRequired = false;
String kernelUrl = null;
// Проверяем требование к ядру, только если пакет обновления найден.
// Проверяем требование к ядру, только если пакет обновления найден или платформа android
if (packSelection.updateFileName() != null
&& compareVersions(normalizedKernel, packSelection.minKernelRequired()) < 0) {
kernelUpdateRequired = true;