From 2acc130f563868489acf0360f45c4f763ce6ccee Mon Sep 17 00:00:00 2001 From: Raphael <68374617+raphaelscholle@users.noreply.github.com> Date: Fri, 17 May 2024 15:31:40 +0200 Subject: [PATCH] Add new builder (#703) --- .github/workflows/build_package_Rock5.yml | 57 +++++++++++--- .github/workflows/build_package_rpi.yml | 2 +- .github/workflows/build_package_x86_jammy.yml | 1 + .github/workflows/build_package_x86_lunar.yml | 1 + .github/workflows/build_package_x86_noble.yml | 1 + ...dows.yml => build_windows.yml_non-working} | 0 .../{macos.yml => macos.yml_non-working} | 0 .github/workflows/ubuntu22_build_test.yml | 7 +- .github/workflows/ubuntu22_build_test_qt6.yml | 7 +- app/util/qopenhd.cpp | 10 +++ app/util/qopenhd.h | 1 + build_chroot.sh | 33 ++++---- package.sh | 2 + .../dev/AppDeveloperStatsPanel.qml | 76 +++++++++++-------- 14 files changed, 135 insertions(+), 63 deletions(-) rename .github/workflows/{build_windows.yml => build_windows.yml_non-working} (100%) rename .github/workflows/{macos.yml => macos.yml_non-working} (100%) diff --git a/.github/workflows/build_package_Rock5.yml b/.github/workflows/build_package_Rock5.yml index 2a547ac7e..c8f84255a 100644 --- a/.github/workflows/build_package_Rock5.yml +++ b/.github/workflows/build_package_Rock5.yml @@ -6,7 +6,7 @@ on: - "2.5-evo" - "dev-release" - "release" - - "experiments" + - "rapha-dev" jobs: build: @@ -24,23 +24,58 @@ jobs: remove-android: 'true' remove-haskell: 'true' overprovision-lvm: 'true' - - name: Add environment variables + - name: test run: | echo "DT=$(date +'%Y-%m-%d_%H%M')" >> $GITHUB_ENV - echo "BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV - sudo apt install git -y + echo "BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV - name: Checkout repository and submodules uses: actions/checkout@v3 with: submodules: recursive - - - name: Build Package + - name: Building QOpenHD in CHROOT run: | - git clone https://github.com/OpenHD/ChrootCompilationTest /opt/ChrootCompilationTest - git clone -b ${{ github.ref_name }} https://github.com/OpenHD/QOpenHD --recursive /opt/ChrootCompilationTest/additionalFiles - echo $CLOUDSMITH_API_KEY > /opt/ChrootCompilationTest/additionalFiles/cloudsmith_api_key.txt - cd /opt/ChrootCompilationTest/ + git clone https://github.com/OpenHD/OpenHD-ChrootCompiler /opt/OpenHD-ChrootCompiler + mkdir -p /opt/OpenHD-ChrootCompiler/additionalFiles + git clone https://github.com/OpenHD/QOpenHD -b ${{ github.ref_name }} /opt/OpenHD-ChrootCompiler/additionalFiles/ --recursive + echo $CLOUDSMITH_API_KEY > /opt/OpenHD-ChrootCompiler/additionalFiles/cloudsmith_api_key.txt + echo "standard" > /opt/OpenHD-ChrootCompiler/additionalFiles/custom.txt + echo "arm64" > /opt/OpenHD-ChrootCompiler/additionalFiles/arch.txt + echo "debian" > /opt/OpenHD-ChrootCompiler/additionalFiles/distro.txt + echo "bullseye" > /opt/OpenHD-ChrootCompiler/additionalFiles/flavor.txt + echo "${{ github.ref_name }}" > /opt/OpenHD-ChrootCompiler/additionalFiles/repo.txt + + cd /opt/OpenHD-ChrootCompiler/ sudo apt update sudo bash install_dep.sh - sudo bash build.sh rock5-debian $API_KEY + sudo bash build.sh rock5b $API_KEY debian bullseye + + - name: debug + run: + cp -r /opt/OpenHD-ChrootCompiler/out/* . + + - name: Compose release filename + run: echo "artifact_name=QOpenHD-${{ env.DT }}" >> $GITHUB_ENV + + - name: Upload to Github + uses: 'actions/upload-artifact@v4' + with: + name: "QOpenHD-${{ env.DT }}" + path: | + *.deb + + - name: Push + id: push + if: github.ref_name == 'release' || github.ref_name == 'dev-release' + uses: cloudsmith-io/action@master + with: + api-key: ${{ secrets.CLOUDSMITH_API_KEY }} + command: "push" + format: "deb" + owner: "openhd" + repo: ${{ github.ref_name }} + distro: "debian" + release: "bullseye" + republish: "true" # needed ONLY if version is not changing + file: "*.deb" + diff --git a/.github/workflows/build_package_rpi.yml b/.github/workflows/build_package_rpi.yml index 7a11ad3af..7c4cbb323 100644 --- a/.github/workflows/build_package_rpi.yml +++ b/.github/workflows/build_package_rpi.yml @@ -63,6 +63,7 @@ jobs: - name: Push id: push + if: github.ref_name == 'release' || github.ref_name == 'dev-release' uses: cloudsmith-io/action@master with: api-key: ${{ secrets.CLOUDSMITH_API_KEY }} @@ -74,7 +75,6 @@ jobs: release: "bullseye" republish: "true" # needed ONLY if version is not changing file: "QOpenHD/*.deb" - if: ${{ github.ref != 'refs/heads/2.5-evo' }} #- name: Install # run: | diff --git a/.github/workflows/build_package_x86_jammy.yml b/.github/workflows/build_package_x86_jammy.yml index 674501bb0..e14676ad9 100644 --- a/.github/workflows/build_package_x86_jammy.yml +++ b/.github/workflows/build_package_x86_jammy.yml @@ -42,6 +42,7 @@ jobs: - name: Push id: push + if: github.ref_name == 'release' || github.ref_name == 'dev-release' uses: cloudsmith-io/action@master with: api-key: ${{ secrets.CLOUDSMITH_API_KEY }} diff --git a/.github/workflows/build_package_x86_lunar.yml b/.github/workflows/build_package_x86_lunar.yml index 088046f9e..d9059d554 100644 --- a/.github/workflows/build_package_x86_lunar.yml +++ b/.github/workflows/build_package_x86_lunar.yml @@ -70,6 +70,7 @@ jobs: # file: "QOpenHD/*.deb" - name: Push + if: github.ref_name == 'release' || github.ref_name == 'dev-release' run: | ls -a cloudsmith push deb -k ${{ secrets.CLOUDSMITH_API_KEY }} openhd/${{ github.ref_name }}/ubuntu/lunar QOpenHD/*.deb diff --git a/.github/workflows/build_package_x86_noble.yml b/.github/workflows/build_package_x86_noble.yml index f76d8492a..aacaccee1 100644 --- a/.github/workflows/build_package_x86_noble.yml +++ b/.github/workflows/build_package_x86_noble.yml @@ -72,5 +72,6 @@ jobs: - name: Push run: | + if: github.ref_name == 'release' || github.ref_name == 'dev-release' ls -a cloudsmith push deb -k ${{ secrets.CLOUDSMITH_API_KEY }} openhd/${{ github.ref_name }}/ubuntu/noble QOpenHD/*.deb diff --git a/.github/workflows/build_windows.yml b/.github/workflows/build_windows.yml_non-working similarity index 100% rename from .github/workflows/build_windows.yml rename to .github/workflows/build_windows.yml_non-working diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml_non-working similarity index 100% rename from .github/workflows/macos.yml rename to .github/workflows/macos.yml_non-working diff --git a/.github/workflows/ubuntu22_build_test.yml b/.github/workflows/ubuntu22_build_test.yml index 2eafcc0ec..33423345a 100644 --- a/.github/workflows/ubuntu22_build_test.yml +++ b/.github/workflows/ubuntu22_build_test.yml @@ -4,7 +4,12 @@ name: ubuntu22_build_test # NOTE: This test only checks if the code in the repository builds under ubuntu x86 (dependencies installed) # Which is - simply put - the most basic test. If this test fails, there is something wrong with the code. -on: [push] +on: + push: + branches-ignore: + - release + - dev-release + - 2.5-evo env: # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) diff --git a/.github/workflows/ubuntu22_build_test_qt6.yml b/.github/workflows/ubuntu22_build_test_qt6.yml index 28f1fe809..e735e1309 100644 --- a/.github/workflows/ubuntu22_build_test_qt6.yml +++ b/.github/workflows/ubuntu22_build_test_qt6.yml @@ -4,7 +4,12 @@ name: ubuntu22_build_test_qt6 # NOTE: This test only checks if the code in the repository builds under ubuntu x86 (dependencies installed) # Which is - simply put - the most basic test. If this test fails, there is something wrong with the code. -on: [push] +on: + push: + branches-ignore: + - release + - dev-release + - 2.5-evo env: # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) diff --git a/app/util/qopenhd.cpp b/app/util/qopenhd.cpp index 1d4a635bf..9f8628325 100644 --- a/app/util/qopenhd.cpp +++ b/app/util/qopenhd.cpp @@ -234,6 +234,16 @@ QString QOpenHD::show_local_ip() #else return QString("Only works on linux"); #endif +} + +QString QOpenHD::write_local_log() +{ +#ifdef __linux__ + auto res=OHDUtil::run_command_out("journalctl > /boot/openhd/openhd.log"); + return QString("Groundstation Log written !"); +#else + return QString("Only works on linux"); +#endif } diff --git a/app/util/qopenhd.h b/app/util/qopenhd.h index 96fa55c9f..72c0562a8 100644 --- a/app/util/qopenhd.h +++ b/app/util/qopenhd.h @@ -50,6 +50,7 @@ class QOpenHD : public QObject Q_INVOKABLE bool reset_settings(); // only works on linux, dirty helper to get local IP address Q_INVOKABLE QString show_local_ip(); + Q_INVOKABLE QString write_local_log(); // returns true if the platform qopenhd is running on is linux (embedded or x86) // some settings an stuff depend on that, called from .qml // NOTE: android is not linux in this definition ! diff --git a/build_chroot.sh b/build_chroot.sh index d53b649be..45b9abb9c 100644 --- a/build_chroot.sh +++ b/build_chroot.sh @@ -1,24 +1,19 @@ #!/bin/bash -#This file is the install instruction for the CHROOT build -#We're using cloudsmith-cli to upload the file in CHROOT +# This file is the install instruction for the CHROOT build +# We're using cloudsmith-cli to upload the file in CHROOT -echo "____________build like a rockSTAR___________" sudo apt install -y python3-pip git -sudo pip3 install --upgrade cloudsmith-cli -bash install_build_dep.sh rock5 -mkdir -p /usr/local/share/openhd/platform/rock/ -sudo ./package.sh arm64 debian bullseye-rock5 || exit 1 -mkdir -p /opt/out/ -cp -v *.dep /opt/out/ -echo "copied deb file" -echo "push to cloudsmith" -git describe --exact-match HEAD >/dev/null 2>&1 -echo "Pushing the package to OpenHD dev-release repository" -ls -a -API_KEY=$(cat cloudsmith_api_key.txt) -cloudsmith push deb --api-key "$API_KEY" openhd/release/debian/bullseye qopenhd_rk3566*.deb || exit 1 -cloudsmith push deb --api-key "$API_KEY" openhd/release/debian/bullseye qopenhd_rk3588a*.deb || exit 1 -rm -Rf qopenhd_rk3588a*.deb -cloudsmith push deb --api-key "$API_KEY" openhd/release/debian/bullseye qopenhd_rk3588*.deb || exit 1 +DISTRO=$(cat distro.txt) +FLAVOR=$(cat flavor.txt) +REPO=$(cat repo.txt) +CUSTOM=$(cat custom.txt) +ARCH=$(cat arch.txt) + +echo ${DISTRO} +echo ${FLAVOR} +echo ${CUSTOM} +echo ${ARCH} +bash install_build_dep.sh rock5 +sudo ./package.sh ${CUSTOM} ${ARCH} ${DISTRO} ${FLAVOR} || exit 1 diff --git a/package.sh b/package.sh index 33fd41960..b8086d3f7 100755 --- a/package.sh +++ b/package.sh @@ -125,3 +125,5 @@ else --after-install after-install.sh \ ${PLATFORM_PACKAGES} || exit 1 fi + ls -a + cp *.deb /out/ diff --git a/qml/ui/configpopup/dev/AppDeveloperStatsPanel.qml b/qml/ui/configpopup/dev/AppDeveloperStatsPanel.qml index d3dbdc9ab..16ce0765c 100644 --- a/qml/ui/configpopup/dev/AppDeveloperStatsPanel.qml +++ b/qml/ui/configpopup/dev/AppDeveloperStatsPanel.qml @@ -76,63 +76,80 @@ Rectangle { height: 23 text: qsTr("Tele in" + _mavlinkTelemetry.telemetry_pps_in + " pps") } - Switch{ - text: "SHOW DEV OVERLAY" - checked: settings.show_dev_stats_overlay - onCheckedChanged: { - settings.show_dev_stats_overlay=checked + GridLayout { + columns: 4 + Button { + width: 400 + text: "Restart local OHD service" + onClicked: { + _qopenhd.restart_local_oenhd_service() + } } - } - Button { - text: "Restart local OHD service" - onClicked: { - _qopenhd.restart_local_oenhd_service() + Button { + id: local_ip_button + text: "Show local IP" + onClicked: { + var text = _qopenhd.show_local_ip() + local_ip_button.text = text + } } - } - Button { - id: local_ip_button - text: "Show local IP" - onClicked: { - var text = _qopenhd.show_local_ip() - local_ip_button.text = text + Button { + id: write_local_log + text: "Write GND log to SD" + onClicked: { + var text = _qopenhd.write_local_log() + write_local_log.text = text + } } - } - Button { - text: "Set Tele rates" - onClicked: { - _mavlinkTelemetry.re_apply_rates() + Button { + id: write_air_log + text: "Write AIR log to SD" + onClicked: { + var text = "Not implemented yet" + write_air_log.text = text + } + } + Button { + text: "Set Tele rates" + onClicked: { + _mavlinkTelemetry.re_apply_rates() + } } - } - Row { - spacing: 5 - visible: _qopenhd.is_linux() Button { + visible: _qopenhd.is_linux() text: "Start openhd" onClicked: { _qopenhd.sysctl_openhd(0); } } Button { + visible: _qopenhd.is_linux() text: "Stop openhd" onClicked: { _qopenhd.sysctl_openhd(1); } } Button { + visible: _qopenhd.is_linux() text: "Enable openhd" onClicked: { _qopenhd.sysctl_openhd(2); } } Button { + visible: _qopenhd.is_linux() text: "Disable openhd" onClicked: { _qopenhd.sysctl_openhd(3); } } - } - Row { - spacing: 5 + Button { + id:sdbut + text: "Self Distruct" + onClicked: { + sdbut.text="just kidding"; + } + } Button { font.capitalization: Font.MixedCase text: qsTr("Restart QOpenHD") @@ -150,7 +167,6 @@ Rectangle { } } } - QOpenHDServiceDialoque{ id: qopenhdservicedialoque }