Skip to content
Merged
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
110 changes: 110 additions & 0 deletions .github/workflows/build-deb.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
name: Build and Publish Debian Package

on:
push:

jobs:
build:
runs-on: ubuntu-latest
env:
DEB_BUILD_OPTIONS: nocheck # or whatever options you need
strategy:
matrix:
distro: [debian-bookworm, debian-bullseye, ubuntu-24.04, ubuntu-22.04]
include:
- distro: debian-bookworm
image: debian:bookworm
os: debian
version: bookworm
- distro: debian-bullseye
image: debian:bullseye
os: debian
version: bullseye
- distro: ubuntu-24.04
image: ubuntu:24.04
os: ubuntu
version: noble
- distro: ubuntu-22.04
image: ubuntu:22.04
os: ubuntu
version: jammy
container:
image: ${{ matrix.image }}
steps:
- name: Setup dependencies
run: |
apt-get update
apt-get install -y build-essential devscripts debhelper autotools-dev autoconf-archive pkg-config fakeroot sed git tar gzip python3-pip python3-venv curl jq libyaml-cpp-dev

curl -u "robert-burger-xas1:{{apiKey}}" -1sLf \
'https://dl.cloudsmith.io/basic/robertburger/robotkernel/setup.deb.sh' \
| bash
apt-get update
apt-get install -y robotkernel-service-helper

- name: Checkout code
uses: actions/checkout@v4

- name: Mark working directory as safe
run: git config --global --add safe.directory $GITHUB_WORKSPACE

- name: update branch name
run: |
safe_branch=$(echo "${GITHUB_REF_NAME}" | tr '/' '-')
VERSION=$(dpkg-parsechangelog | sed -n 's/^Version: //p')
sed "s|PACKAGE_VERSION|$VERSION|" configure.ac.in > configure.ac
env:
GITHUB_REF_NAME: ${{ github.ref_name }}

- name: Prepare autotools
run: |
# Nur falls nicht schon vorhanden (optional)
autoreconf -fi

- name: Build .deb package
run: |
# baue mit dpkg-buildpackage (ohne signieren)
dpkg-buildpackage -us -uc -d

- name: Collect .deb artifact
run: |
mkdir -p artifacts/${{ matrix.os }}/${{ matrix.version }}
mv ../robotkernel*.deb artifacts/${{ matrix.os }}/${{ matrix.version }}

- name: Set sanitized image name
id: sanitize
run: |
version=$(dpkg-parsechangelog | sed -n 's/^Version: //p')
echo "sanitized_image=$(echo "$version-$IMAGE" | tr '/:' '--')" >> $GITHUB_OUTPUT
env:
IMAGE: ${{ matrix.image }}

- name: Upload .deb package
uses: actions/upload-artifact@v4
with:
name: robotkernel-${{ steps.sanitize.outputs.sanitized_image }}.deb
path: artifacts/${{ matrix.os }}/${{ matrix.version }}/*.deb

- name: Upload to Cloudsmith (${{ matrix.os }}/${{ matrix.version }})
env:
CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }}
shell: bash
run: |
VERSION=$(dpkg-parsechangelog | sed -n 's/^Version: //p')
FILENAME="artifacts/${{ matrix.os }}/${{ matrix.version }}/robotkernel_${VERSION}_amd64.deb"
FILENAME_DEV="artifacts/${{ matrix.os }}/${{ matrix.version }}/robotkernel-dev_${VERSION}_amd64.deb"

python3 -m venv cloudsmith
cd cloudsmith
source bin/activate

python3 -m pip install --upgrade pip
pip3 install cloudsmith-cli

cloudsmith push deb robertburger/robotkernel/${{ matrix.os }}/${{ matrix.version }} ../${FILENAME} \
--republish \
--api-key "$CLOUDSMITH_API_KEY"

cloudsmith push deb robertburger/robotkernel/${{ matrix.os }}/${{ matrix.version }} ../${FILENAME_DEV} \
--republish \
--api-key "$CLOUDSMITH_API_KEY"
25 changes: 0 additions & 25 deletions .github/workflows/c-cpp.yml

This file was deleted.

40 changes: 0 additions & 40 deletions .github/workflows/cmake-single-platform.yml

This file was deleted.

2 changes: 1 addition & 1 deletion conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class MainProject(ConanFile):
tool_requires = ["robotkernel_service_helper/[~6]@robotkernel/snapshot"]

def source(self):
self.run(f"sed 's/AC_INIT(.*/AC_INIT([robotkernel], [{self.version}], [{self.author}])/' -i configure.ac")
self.run(f"sed 's/AC_INIT(.*/AC_INIT([robotkernel], [{self.version}], [{self.author}])/' configure.ac.in > configure.ac")

def requirements(self):
self.requires(f"{self.name}_ln_msgdef/{self.version}@{self.user}/{self.channel}")
Expand Down
4 changes: 3 additions & 1 deletion configure.ac → configure.ac.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ AC_PREREQ([2.63])
# Robotkernel Version and Maintainer are extracted from project.properties file, change
# them there if needed
#
AC_INIT([robotkernel], m4_esyscmd_s([git describe --long --dirty --tags]), [Robert Burger <robert.burger@dlr.de>])
AC_INIT([robotkernel], [PACKAGE_VERSION], [Robert Burger <robert.burger@dlr.de>])

AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS([include/robotkernel/config.h])
Expand All @@ -30,6 +30,8 @@ AC_PROG_LIBTOOL
AC_PROG_INSTALL
m4_ifdef([PKG_PROG_PKG_CONFIG], [PKG_PROG_PKG_CONFIG])
m4_ifdef([PKG_INSTALLDIR], [PKG_INSTALLDIR], [pkgconfigdir='${libdir}/pkgconfig' AC_SUBST([pkgconfigdir])])
AC_PATH_PROG(SERVICE_GENERATE, service_generate)
AS_IF([test "$SERVICE_GENERATE" = ""], [AC_MSG_ERROR(["service_generate not found. Install robotkernel-service-helper!"])], [])

PKG_CHECK_MODULES([LTTNG_UST], [lttng-ust], [enable_lttng=yes], [enable_lttng=no])
PKG_CHECK_MODULES([YAML_CPP], [yaml-cpp], [], [AC_MSG_ERROR([yaml-cpp not found])])
Expand Down
142 changes: 0 additions & 142 deletions debian/autoreconf.after

This file was deleted.

Loading