Skip to content

Commit

Permalink
Add new builder (#703)
Browse files Browse the repository at this point in the history
  • Loading branch information
raphaelscholle authored May 17, 2024
1 parent d3a3bb1 commit 2acc130
Show file tree
Hide file tree
Showing 14 changed files with 135 additions and 63 deletions.
57 changes: 46 additions & 11 deletions .github/workflows/build_package_Rock5.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- "2.5-evo"
- "dev-release"
- "release"
- "experiments"
- "rapha-dev"

jobs:
build:
Expand All @@ -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"

2 changes: 1 addition & 1 deletion .github/workflows/build_package_rpi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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: |
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build_package_x86_jammy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build_package_x86_lunar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build_package_x86_noble.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
File renamed without changes.
File renamed without changes.
7 changes: 6 additions & 1 deletion .github/workflows/ubuntu22_build_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.)
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/ubuntu22_build_test_qt6.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.)
Expand Down
10 changes: 10 additions & 0 deletions app/util/qopenhd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

}

Expand Down
1 change: 1 addition & 0 deletions app/util/qopenhd.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 !
Expand Down
33 changes: 14 additions & 19 deletions build_chroot.sh
Original file line number Diff line number Diff line change
@@ -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

2 changes: 2 additions & 0 deletions package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -125,3 +125,5 @@ else
--after-install after-install.sh \
${PLATFORM_PACKAGES} || exit 1
fi
ls -a
cp *.deb /out/
76 changes: 46 additions & 30 deletions qml/ui/configpopup/dev/AppDeveloperStatsPanel.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -150,7 +167,6 @@ Rectangle {
}
}
}

QOpenHDServiceDialoque{
id: qopenhdservicedialoque
}
Expand Down

0 comments on commit 2acc130

Please sign in to comment.