Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/scripts/create_debian.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

version=$1
architecture=$2

source_code=$(basename "$PWD")

# Install build dependencies
sudo apt update
sudo apt install -y build-essential make devscripts debhelper qtbase5-dev qt5-qmake cmake libfftw3-dev gpsd gpsd-clients bc

# Replace placeholders inside the debian template files
sed -i "s/@VERSION@/$version-1/" packaging/debian/changelog
sed -i "s/@DATE@/$(date -R)/" packaging/debian/changelog
sed -i "s/@ARCHITECTURE@/$architecture/" packaging/debian/control

# Copy debian files to root
cp -r packaging/debian .

# Create the orig tarball
pushd ..
tar czf $source_code\_$version.orig.tar.gz $source_code
$source_code/.github/scripts/install_libiio_deb.sh
popd
# Build the package
debuild
32 changes: 32 additions & 0 deletions .github/scripts/install_libiio_deb.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash

# Script to build and install libiio from source
# Based on the specified branch

libiio_branch="libiio-v0"

echo "Installing libiio dependencies..."
sudo apt-get -y update
sudo apt-get -y install git build-essential libxml2-dev bison flex libcdk5-dev cmake libaio-dev libusb-1.0-0-dev libserialport-dev libavahi-client-dev doxygen graphviz python3 python3-pip python3-setuptools

echo "Cloning libiio from branch: $libiio_branch"
git clone -b "$libiio_branch" https://github.com/analogdevicesinc/libiio.git
cd libiio

echo "Building libiio..."
mkdir build && cd build
cmake ../ -DCPP_BINDINGS=ON -DPYTHON_BINDINGS=ON -DENABLE_PACKAGING=ON
make -j$(nproc)

echo "Creating libiio packages..."
make package

echo "Installing libiio packages..."
sudo dpkg -i libiio-*.deb

echo "libiio installation completed!"

# Clean up
cd ../..
rm -rf libiio

51 changes: 51 additions & 0 deletions .github/scripts/verify_install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/bin/bash

# Check GUI components
echo "Checking GUI components..."
if [ -f /usr/bin/rfsom-box-gui ] && \
[ -f /usr/bin/rfsom-box-gui-start.sh ] && \
[ -d /usr/share/rfsom-box-gui ] && \
[ -f /lib/systemd/system/rfsom-box-gui.service ]; then
echo "✓ GUI components installed successfully!"
else
echo "✗ GUI components failed to install!"
[ ! -f /usr/bin/rfsom-box-gui ] && echo " Missing: rfsom-box-gui executable"
[ ! -f /usr/bin/rfsom-box-gui-start.sh ] && echo " Missing: rfsom-box-gui-start.sh"
[ ! -d /usr/share/rfsom-box-gui ] && echo " Missing: share directory"
[ ! -f /lib/systemd/system/rfsom-box-gui.service ] && echo " Missing: systemd service"
exit 1
fi

# Check TUN/TAP components
echo "Checking TUN/TAP components..."
if [ -f /usr/bin/modemd ] && \
[ -f /usr/bin/ip_reg ] && \
[ -f /usr/bin/ip_monitor ] && \
[ -f /usr/bin/restart_modem_gui.sh ] && \
[ -f /usr/bin/ip_reg_default.sh ] && \
[ -f /usr/share/rfsom-box-gui/modem_filter.ftr ]; then
echo "✓ TUN/TAP components installed successfully!"
else
echo "✗ TUN/TAP components failed to install!"
[ ! -f /usr/bin/modemd ] && echo " Missing: modemd"
[ ! -f /usr/bin/ip_reg ] && echo " Missing: ip_reg"
[ ! -f /usr/bin/ip_monitor ] && echo " Missing: ip_monitor"
[ ! -f /usr/bin/restart_modem_gui.sh ] && echo " Missing: restart_modem_gui.sh"
[ ! -f /usr/bin/ip_reg_default.sh ] && echo " Missing: ip_reg_default.sh"
[ ! -f /usr/share/rfsom-box-gui/modem_filter.ftr ] && echo " Missing: modem_filter.ftr"
exit 1
fi

# Check FFT plot component
echo "Checking FFT plot component..."
if [ -f /usr/bin/fft_plot ]; then
echo "✓ FFT plot component installed successfully!"
else
echo "✗ FFT plot component failed to install!"
echo " Missing: fft_plot executable"
exit 1
fi

echo ""
echo "All components installed successfully!"

183 changes: 183 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
name: Build and Deploy rfsom-box-gui

env:
APP_NAME: rfsom-box-gui

on:
workflow_dispatch:
push:
branches:
- main
- '20[1-9][0-9]_R[1-9]'
- staging/*
tags:
- 'v*'
pull_request:
branches:
- main
- '20[1-9][0-9]_R[1-9]'

jobs:
identify_version:
runs-on: ubuntu-latest
outputs:
app-version: ${{ steps.set_version.outputs.version }}
can-create-release: ${{ steps.set_version.outputs.can_create_release}}
steps:
- name: Checkout code repository
uses: actions/checkout@v4
- name: Set app version
id: set_version
run: |
# Regex to match semantic versioning (from semver.org)
# Regex will match valid version number https://regex101.com/r/jPSdnV/1
regex='^(v|)((0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-((0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*)(\.((0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*)))*))?(\+([0-9a-zA-Z-]+(\.[0-9a-zA-Z-]+)*))?)$'
app_version=""
create_release=false
latest_released_tag=$(curl "https://api.github.com/repos/${{github.repository}}/releases/latest" | jq -r .tag_name)

if [[ "${{github.ref_type}}" == "tag" ]]; then
pushed_tag="${{github.ref_name}}"
if [[ "$pushed_tag" =~ $regex ]]; then
app_version="${BASH_REMATCH[2]}"
if [[ "$latest_released_tag" =~ $regex ]]; then
IFS='.' read -r major minor patch <<< "${BASH_REMATCH[2]}"
next_patch="$major.$minor.$((patch + 1))"
next_minor="$major.$((minor + 1)).0"
next_major="$((major + 1)).0.0"
if [[ "$app_version" == "$next_patch" || "$app_version" == "$next_minor" || "$app_version" == "$next_major" ]]; then
create_release=true
else
echo "Valid tag, but invalid version incrementation, release will NOT be created"
fi
else
echo "Invalid relesed version, skip incrementation validation! Release will be created"
create_release=true
fi
else
echo "Invalid tag format, release will NOT be created"
app_version=0.0.1+${{ github.sha }}
fi
else
if [[ "$latest_released_tag" =~ $regex ]]; then
app_version=${BASH_REMATCH[2]}+${{ github.sha }}
else
echo "Invalid relesed version. Setting default version"
app_version=0.0.1+${{ github.sha }}
fi
fi

echo "Version to use $app_version"
echo "version=$app_version" >> "$GITHUB_OUTPUT"
echo "can_create_release=$create_release" >> "$GITHUB_OUTPUT"
build_and_deploy_for_kuiper:
runs-on: ubuntu-latest
needs: identify_version
env:
CONTAINER_BASE_NAME: kuiper-container-basic
strategy:
fail-fast: false
matrix:
include:
- docker_image: aandrisa/kuiper_basic_64:latest
image_arch: linux/arm64
architecture: arm64
- docker_image: aandrisa/kuiper_basic_32:latest
image_arch: linux/arm/v7
architecture: armhf
steps:
- name: Checkout code repository
uses: actions/checkout@v4
with:
path: ${{env.APP_NAME}}

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Start persistent container
run: |
docker run -d \
--platform ${{matrix.image_arch}} \
--name ${{env.CONTAINER_BASE_NAME}}-${{matrix.architecture}} \
-v "$GITHUB_WORKSPACE/${{env.APP_NAME}}:/workspace/${{env.APP_NAME}}" \
-w /workspace/${{env.APP_NAME}} \
${{matrix.docker_image}} tail -f /dev/null

- name: Create debian package
run: |
docker exec ${{env.CONTAINER_BASE_NAME}}-${{matrix.architecture}} sh -c ".github/scripts/create_debian.sh ${{needs.identify_version.outputs.app-version}} ${{matrix.architecture}}"

- name: Install application
env:
DEB_FILE_NAME: ${{env.APP_NAME}}_${{needs.identify_version.outputs.app-version}}-1_${{matrix.architecture}}
run: |
docker exec ${{env.CONTAINER_BASE_NAME}}-${{matrix.architecture}} sh -c "sudo dpkg -i ../${{env.DEB_FILE_NAME}}.deb"

- name: Verify install locations
run: |
docker exec ${{env.CONTAINER_BASE_NAME}}-${{matrix.architecture}} sh -c ".github/scripts/verify_install.sh"

- name: Copy .deb from container to host
env:
DEB_FILE_NAME: ${{env.APP_NAME}}_${{needs.identify_version.outputs.app-version}}-1_${{matrix.architecture}}
run: |
docker cp ${{env.CONTAINER_BASE_NAME}}-${{matrix.architecture}}:/workspace/${{env.DEB_FILE_NAME}}.deb ./${{env.DEB_FILE_NAME}}.deb

- name: Upload .deb artifacts to github
uses: actions/upload-artifact@v4
with:
name: ${{env.APP_NAME}}-${{matrix.architecture}}
path: ${{env.APP_NAME}}_${{needs.identify_version.outputs.app-version}}-1_${{matrix.architecture}}.deb
if-no-files-found: error
build_and_deploy_for_ubuntu:
runs-on: ubuntu-latest
needs: identify_version
env:
architecture: amd64
defaults:
run:
working-directory: ${{env.APP_NAME}}
steps:
- name: Checkout code repository
uses: actions/checkout@v4
with:
path: ${{env.APP_NAME}}

- name: Create .deb package
run: |
.github/scripts/create_debian.sh ${{needs.identify_version.outputs.app-version}} ${{env.architecture}}

- name: Install application
env:
DEB_FILE_NAME: ${{env.APP_NAME}}_${{needs.identify_version.outputs.app-version}}-1_${{env.architecture}}
run: |
sudo dpkg -i ../${{env.DEB_FILE_NAME}}.deb

- name: Verify install locations
run: |
.github/scripts/verify_install.sh

- name: Upload .deb artifacts to github
uses: actions/upload-artifact@v4
with:
name: ${{env.APP_NAME}}-ubuntu
path: ${{env.APP_NAME}}_${{needs.identify_version.outputs.app-version}}-1_${{env.architecture}}.deb
if-no-files-found: error
create_release_from_tag:
needs:
- build_and_deploy_for_kuiper
- build_and_deploy_for_ubuntu
- identify_version
runs-on: ubuntu-latest
if: ${{needs.identify_version.outputs.can-create-release == 'true'}}
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
merge-multiple: true
- name: Release
uses: ncipollo/release-action@v1
with:
token: ${{secrets.TOKEN_GITHUB}}
name: Release ${{github.ref_name}}
artifacts: ${{env.APP_NAME}}_*.deb
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,6 @@ target_wrapper.*
CMakeLists.txt.user*

astylerc

# Generated files
bin/rfsom-box-gui.service
6 changes: 4 additions & 2 deletions bin/packrf.service → bin/rfsom-box-gui.service.in
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
[Unit]
Description=Start packrf GUI
Description=RFSOM-BOX GUI Application
After=multi-user.target

[Service]
Environment=DISPLAY=:0
Environment=XAUTHORITY=/home/analog/.Xauthority
ExecStart=/usr/local/bin/rfsom-box-gui-start.sh
ExecStart=$$INSTALL_LOCATION/bin/rfsom-box-gui-start.sh
Restart=always
RestartSec=10s
KillMode=process
TimeoutSec=infinity

[Install]
WantedBy=graphical.target

6 changes: 6 additions & 0 deletions packaging/debian/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
rfsom-box-gui (@VERSION@) UNRELEASED; urgency=low

* CI release.

-- Engineerzone <https://ez.analog.com/sw-interface-tools> @DATE@

27 changes: 27 additions & 0 deletions packaging/debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Source: rfsom-box-gui
Section: misc
Priority: optional
Maintainer: Engineerzone <https://ez.analog.com/sw-interface-tools>
Build-Depends: debhelper-compat (= 13),
qtbase5-dev,
qt5-qmake,
cmake,
libfftw3-dev,
libiio0
Standards-Version: 4.5.1
Homepage: https://github.com/analogdevicesinc/rfsom-box-gui
Rules-Requires-Root: no

Package: rfsom-box-gui
Architecture: @ARCHITECTURE@
Multi-Arch: foreign
Depends: ${misc:Depends}, ${shlibs:Depends},
libiio0,
gpsd,
gpsd-clients,
bc
Recommends: systemd
Description: RFSOM-BOX-GUI is a Qt5-based graphical user interface for the RFSOM
Software Defined Radio platform. It provides a menu-driven interface
for RF operations, spectrum analysis, and radio networking.
Includes FFT spectrum analyzer and TUN/TAP modem for IP-over-radio.
25 changes: 25 additions & 0 deletions packaging/debian/copyright
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: rfsom-box-gui
Upstream-Contact: Analog Devices Inc. <https://ez.analog.com/sw-interface-tools>
Source: https://github.com/analogdevicesinc/rfsom-box-gui

Files: *
Copyright: 2017-2024 Analog Devices Inc.
License: GPL-2+
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
.
On Debian systems, the complete text of the GNU General Public
License version 2 can be found in "/usr/share/common-licenses/GPL-2".

Loading
Loading