Skip to content
Draft
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
32 changes: 32 additions & 0 deletions .github/workflows/build_amd64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Compile for amd64

on:
workflow_dispatch:
push:
tags:
- '*'

jobs:
build_ubuntu:
runs-on: ubuntu-22.04

steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
sparse-checkout: |
dockerfiles

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build Ubuntu 18.04 Image and Compile App
run: |
docker buildx build -o ./release -f dockerfiles/amd64 .

- name: Upload Package to Release
run: |
gh release upload ${GITHUB_REF#refs/*/} release/deconz_*_amd64.deb
env:
GITHUB_TOKEN: ${{ github.TOKEN }}
shell: bash
32 changes: 32 additions & 0 deletions .github/workflows/build_arm64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Compile for arm64

on:
workflow_dispatch:
push:
tags:
- '*'

jobs:
build_aarch64:
runs-on: ubuntu-22.04

steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
sparse-checkout: |
dockerfiles

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build Ubuntu 18.04 Image, set up Cross-Compile-Toolchain and Compile App
run: |
docker buildx build -o ./release -f dockerfiles/arm64 .

- name: Upload Package to Release
run: |
gh release upload ${GITHUB_REF#refs/*/} release/deconz_*_arm64.deb
env:
GITHUB_TOKEN: ${{ github.TOKEN }}
shell: bash
32 changes: 32 additions & 0 deletions .github/workflows/build_armhf.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Compile for armhf

on:
workflow_dispatch:
push:
tags:
- '*'

jobs:
build_armhf:
runs-on: ubuntu-22.04

steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
sparse-checkout: |
dockerfiles

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build Ubuntu 18.04 Image, set up Cross-Compile-Toolchain and Compile App
run: |
docker buildx build -o ./release -f dockerfiles/armhf .

- name: Upload Package to Release
run: |
gh release upload ${GITHUB_REF#refs/*/} release/deconz_*_armhf.deb
env:
GITHUB_TOKEN: ${{ github.TOKEN }}
shell: bash
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
![Compile for armhf](https://github.com/swoopx/testrepo/actions/workflows/build_armhf.yml/badge.svg)
![Compile for arm64](https://github.com/swoopx/testrepo/actions/workflows/build_arm64.yml/badge.svg)
![Compile for amd64](https://github.com/swoopx/testrepo/actions/workflows/build_amd64.yml/badge.svg)


Introduction
============

Expand Down
42 changes: 42 additions & 0 deletions dockerfiles/amd64
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
FROM --platform=$BUILDPLATFORM ubuntu:18.04 as builder

# Install required packages
RUN apt-get update \
&& apt-get install -y \
lsb-release \
ca-certificates \
build-essential \
qt5-default \
libqt5serialport5-dev \
libqt5websockets5-dev \
qtdeclarative5-dev \
sqlite3 \
libsqlite3-dev \
libssl-dev \
libgpiod-dev \
pkg-config \
dpkg-dev \
git \
make \
wget \
cmake \
ninja-build \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

# We need a more current version supporting some used features
RUN wget https://cmake.org/files/v3.19/cmake-3.19.8-Linux-x86_64.tar.gz \
&& tar -xzf cmake-3.19.8-Linux-x86_64.tar.gz \
&& mv cmake-3.19.8-Linux-x86_64 cmake

# Download and compile deconz. Build debian package
RUN git clone https://github.com/dresden-elektronik/deconz.git \
&& cd deconz \
&& git submodule update --init --recursive \
&& /cmake/bin/cmake -DBUILD_CHANNEL=${BUILD_CHANNEL} -DQT_VERSION_MAJOR=5 -DCMAKE_BUILD_TYPE=Release -B build . \
&& /cmake/bin/cmake --build build --parallel 4 \
&& cd build \
&& /cmake/bin/cpack -G DEB .

FROM scratch
COPY --from=builder /deconz/build/*.deb ./
63 changes: 63 additions & 0 deletions dockerfiles/arm64
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
FROM --platform=$BUILDPLATFORM ubuntu:18.04 as builder

# Install required packages
RUN apt-get update \
&& apt-get install -y \
git \
wget \
build-essential \
gcc-aarch64-linux-gnu \
g++-aarch64-linux-gnu \
pkg-config \
libgpiod-dev \
libssl-dev

# Add cross-compile architecture
RUN dpkg --add-architecture arm64 \
&& echo "deb [arch=arm64] http://ports.ubuntu.com/ bionic main restricted" >> /etc/apt/sources.list.d/arm-cross-compile-sources.list \
&& echo "deb [arch=arm64] http://ports.ubuntu.com/ bionic-updates main restricted" >> /etc/apt/sources.list.d/arm-cross-compile-sources.list \
&& echo "deb [arch=arm64] http://ports.ubuntu.com/ bionic universe" >> /etc/apt/sources.list.d/arm-cross-compile-sources.list \
&& echo "deb [arch=arm64] http://ports.ubuntu.com/ bionic-updates universe" >> /etc/apt/sources.list.d/arm-cross-compile-sources.list \
&& echo "deb [arch=arm64] http://ports.ubuntu.com/ bionic multiverse" >> /etc/apt/sources.list.d/arm-cross-compile-sources.list \
&& echo "deb [arch=arm64] http://ports.ubuntu.com/ bionic-updates multiverse" >> /etc/apt/sources.list.d/arm-cross-compile-sources.list \
&& echo "deb [arch=arm64] http://ports.ubuntu.com/ bionic-backports main restricted universe multiverse" >> /etc/apt/sources.list.d/arm-cross-compile-sources.list

# Prepare toolchain file
RUN echo "set(CMAKE_SYSTEM_NAME Linux)" >> armv8.cmake \
&& echo "set(CMAKE_SYSTEM_PROCESSOR aarch64)" >> armv8.cmake \
&& echo "" >> armv8.cmake \
&& echo "set(CMAKE_C_COMPILER /usr/bin/aarch64-linux-gnu-gcc)" >> armv8.cmake \
&& echo "set(CMAKE_CXX_COMPILER /usr/bin/aarch64-linux-gnu-g++)" >> armv8.cmake \
&& echo "set(CMAKE_LINKER /usr/bin/aarch64-linux-gnu-ld)" >> armv8.cmake \
&& echo "" >> armv8.cmake \
&& echo "set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)" >> armv8.cmake \
&& echo "set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)" >> armv8.cmake \
&& echo "set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)" >> armv8.cmake \
&& echo "set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)" >> armv8.cmake

# Install required packages for target architecture
RUN apt-get update \
|| apt-get install -y \
libqt5serialport5-dev:arm64 \
libqt5websockets5-dev:arm64 \
qt5-default:arm64 \
libssl-dev:arm64 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

# We need a more current version supporting some used features
RUN wget https://cmake.org/files/v3.19/cmake-3.19.8-Linux-x86_64.tar.gz \
&& tar -xzf cmake-3.19.8-Linux-x86_64.tar.gz \
&& mv cmake-3.19.8-Linux-x86_64 cmake

# Download and compile deconz. Build debian package
RUN git clone https://github.com/dresden-elektronik/deconz.git \
&& cd deconz \
&& git submodule update --init --recursive \
&& /cmake/bin/cmake -DBUILD_CHANNEL=${BUILD_CHANNEL} -DQT_VERSION_MAJOR=5 -DCMAKE_TOOLCHAIN_FILE=/armv8.cmake -DCMAKE_BUILD_TYPE=Release -B build . \
&& /cmake/bin/cmake --build build --parallel 4 \
&& cd build \
&& /cmake/bin/cpack -G DEB -D CPACK_DEBIAN_PACKAGE_ARCHITECTURE="arm64" .

FROM scratch
COPY --from=builder /deconz/build/*.deb ./
63 changes: 63 additions & 0 deletions dockerfiles/armhf
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
FROM --platform=$BUILDPLATFORM ubuntu:18.04 as builder

# Install required packages
RUN apt-get update \
&& apt-get install -y \
git \
wget \
build-essential \
gcc-arm-linux-gnueabihf \
g++-arm-linux-gnueabihf \
pkg-config \
libgpiod-dev \
libssl-dev

# Add cross-compile architecture
RUN dpkg --add-architecture armhf \
&& echo "deb [arch=armhf] http://ports.ubuntu.com/ bionic main restricted" >> /etc/apt/sources.list.d/arm-cross-compile-sources.list \
&& echo "deb [arch=armhf] http://ports.ubuntu.com/ bionic-updates main restricted" >> /etc/apt/sources.list.d/arm-cross-compile-sources.list \
&& echo "deb [arch=armhf] http://ports.ubuntu.com/ bionic universe" >> /etc/apt/sources.list.d/arm-cross-compile-sources.list \
&& echo "deb [arch=armhf] http://ports.ubuntu.com/ bionic-updates universe" >> /etc/apt/sources.list.d/arm-cross-compile-sources.list \
&& echo "deb [arch=armhf] http://ports.ubuntu.com/ bionic multiverse" >> /etc/apt/sources.list.d/arm-cross-compile-sources.list \
&& echo "deb [arch=armhf] http://ports.ubuntu.com/ bionic-updates multiverse" >> /etc/apt/sources.list.d/arm-cross-compile-sources.list \
&& echo "deb [arch=armhf] http://ports.ubuntu.com/ bionic-backports main restricted universe multiverse" >> /etc/apt/sources.list.d/arm-cross-compile-sources.list

# Prepare toolchain file
RUN echo "set(CMAKE_SYSTEM_NAME Linux)" >> armv7l.cmake \
&& echo "set(CMAKE_SYSTEM_PROCESSOR armv7l)" >> armv7l.cmake \
&& echo "" >> armv7l.cmake \
&& echo "set(CMAKE_C_COMPILER /usr/bin/arm-linux-gnueabihf-gcc)" >> armv7l.cmake \
&& echo "set(CMAKE_CXX_COMPILER /usr/bin/arm-linux-gnueabihf-g++)" >> armv7l.cmake \
&& echo "set(CMAKE_LINKER /usr/bin/arm-linux-gnueabihf-ld)" >> armv7l.cmake \
&& echo "" >> armv7l.cmake \
&& echo "set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)" >> armv7l.cmake \
&& echo "set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)" >> armv7l.cmake \
&& echo "set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)" >> armv7l.cmake \
&& echo "set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)" >> armv7l.cmake

# Install required packages for target architecture
RUN apt-get update \
|| apt-get install -y \
qt5-default:armhf \
libqt5serialport5-dev:armhf \
libqt5websockets5-dev:armhf \
libssl-dev:armhf \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

# We need a more current version supporting some used features
RUN wget https://cmake.org/files/v3.19/cmake-3.19.8-Linux-x86_64.tar.gz \
&& tar -xzf cmake-3.19.8-Linux-x86_64.tar.gz \
&& mv cmake-3.19.8-Linux-x86_64 cmake

# Download and compile deconz. Build debian package
RUN git clone https://github.com/dresden-elektronik/deconz.git \
&& cd deconz \
&& git submodule update --init --recursive \
&& /cmake/bin/cmake -DBUILD_CHANNEL=${BUILD_CHANNEL} -DQT_VERSION_MAJOR=5 -DCMAKE_TOOLCHAIN_FILE=/armv7l.cmake -DCMAKE_BUILD_TYPE=Release -B build . \
&& /cmake/bin/cmake --build build --parallel 4 \
&& cd build \
&& /cmake/bin/cpack -G DEB -D CPACK_DEBIAN_PACKAGE_ARCHITECTURE="armhf" .

FROM scratch
COPY --from=builder /deconz/build/*.deb ./