From a40bfba8217d400ab7a15afada6c3eca5ccd3ab0 Mon Sep 17 00:00:00 2001 From: ziliolu Date: Mon, 16 Jun 2025 13:33:32 +0100 Subject: [PATCH 1/2] Add GitHub Actions workflow for Raspberry Pi build and deployment --- .github/workflows/deploy.yml | 86 ++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..38cddbb --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,86 @@ +name: Build and Deploy for Raspberry Pi + +on: + push: + branches: + - main + tags: + - 'v*' + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + submodules: false + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + with: + platforms: linux/arm64 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build Docker image for ARM64 + run: | + docker buildx build \ + -f ./RaspberryPi/deploy/dockerfiles/DockerfileDeployRasp \ + --platform linux/arm64 --load \ + --build-arg projectDir=$PWD/$PROJECT_DIR \ + -t final-app . + - name: Extract built binaries + run: | + mkdir -p artifacts/bin + mkdir -p artifacts/config + mkdir -p artifacts/fonts + docker create --name tmpapp final-app + docker cp tmpapp:/home/$PROJECT_DIR/InstrumentClusterApp ./artifacts/bin/ + docker cp tmpapp:/home/$PROJECT_DIR/MiddleWareApp ./artifacts/bin/ + cp ./$PROJECT_DIR/ZenohConfig/InstrumentClusterConfig.json ./artifacts/config/ + cp ./$PROJECT_DIR/ZenohConfig/MiddleWareConfig.json ./artifacts/config/ + cp -r ./RaspberryPi/deploy/fonts/* ./artifacts/fonts/ + git archive --format=zip HEAD -o ./artifacts/source-code.zip + cd artifacts + zip -r ../release-package.zip * + cd .. + docker rm tmpapp + - name: Get latest tag and increment + id: tag + run: | + git fetch --tags --force + git fetch origin + latest_tag=$(git tag --sort=-v:refname | head -n 1) + if [ -z "$latest_tag" ]; then + latest_tag="v1.0.0" + fi + major=$(echo $latest_tag | cut -d. -f1 | tr -d 'v') + minor=$(echo $latest_tag | cut -d. -f2) + patch=$(echo $latest_tag | cut -d. -f3) + new_tag="v$major.$minor.$((patch + 1))" + echo "new_tag=$new_tag" >> $GITHUB_OUTPUT + - name: Create GitHub Release + uses: softprops/action-gh-release@v1 + with: + tag_name: ${{ steps.tag.outputs.new_tag }} + name: Release ${{ steps.tag.outputs.new_tag }} + body: | + ## Raspberry Pi Release + **Includes:** + - Compiled apps (`InstrumentClusterApp`, `MiddleWareApp`) + - Zenoh config files + - Fonts + - Full source code zip + **Instructions:** + - Copy `InstrumentClusterApp` and `MiddleWareApp` to `$PI_PATH_BIN` + - Copy configs to `$PI_PATH_ETC` + - Copy fonts to `$PI_PATH_FONTS` + files: | + release-package.zip + artifacts/source-code.zip + artifacts/bin/* + env: + GITHUB_TOKEN: ${{ secrets.PAT_LUIS }} \ No newline at end of file From b12fbc508223190becd428879303d2760e1523d4 Mon Sep 17 00:00:00 2001 From: Rui Pires Date: Tue, 15 Jul 2025 10:37:20 +0100 Subject: [PATCH 2/2] Add libeigen3-dev and update CMake build options for ZENOHC --- deploy/dockerfiles/DockerFileRasp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/deploy/dockerfiles/DockerFileRasp b/deploy/dockerfiles/DockerFileRasp index 394054a..e8806ee 100644 --- a/deploy/dockerfiles/DockerFileRasp +++ b/deploy/dockerfiles/DockerFileRasp @@ -79,6 +79,7 @@ RUN { \ libffi-dev \ libsqlite3-dev \ libbsd-dev \ + libeigen3-dev \ perl \ patch \ m4 \ @@ -151,7 +152,9 @@ RUN { \ cd build && \ cmake .. \ -DCMAKE_INSTALL_PREFIX=/usr/local \ - -DBUILD_SHARED_LIBS=FALSE && \ + -DBUILD_SHARED_LIBS=FALSE \ + -DZENOHC_BUILD_WITH_UNSTABLE_API=true \ + -DZENOHC_BUILD_WITH_SHARED_MEMORY=true && \ make -j$(nproc) && \ make install && \ cd ../.. && \