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
97 changes: 97 additions & 0 deletions .github/workflows/build-deb.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
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 -1sLf 'https://dl.cloudsmith.io/basic/robertburger/robotkernel/setup.deb.sh' | bash
apt-get update
apt-get install -y robotkernel-service-helper robotkernel-dev service-provider-process-data-inspection-dev

- 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: |
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: 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 ../module-posix-timer*.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: module-posix-timer-${{ 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 }}/module-posix-timer_${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"
4 changes: 4 additions & 0 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,7 @@ class MainProject(ConanFile):
description = "module_posix_timer is used to generate deterministic triggers for other modules."
exports_sources = ["*", "!.gitignore"]
requires = ["robotkernel/[~6]@robotkernel/unstable", "service_provider_process_data_inspection/[~6]@robotkernel/unstable"]

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

23 changes: 1 addition & 22 deletions configure.ac → configure.ac.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@
# Process this file with autoconf to produce a configure script.

AC_PREREQ([2.69])
AC_INIT(
[module_posix_timer],
m4_esyscmd_s([cat project.properties | grep VERSION | cut -d'=' -f2 | xargs printf "%s"]),
m4_esyscmd_s([cat project.properties | grep MAINTAINER | cut -d'=' -f2 | xargs printf "%s"]))
AC_INIT([module_posix_timer], [PACKAGE_VERSION], [Robert Burger <robert.burger@dlr.de>])
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects])
AC_CONFIG_HEADERS([config.h])
Expand Down Expand Up @@ -41,24 +38,6 @@ AC_CHECK_FUNCS([strdup])
AC_CHECK_LIB(dl, dlopen)
AC_CHECK_LIB(rt, timer_delete)

# Platform specific setup
# Check for which host we are on and setup a few things
# specifically based on the host
case $target in
*arm* )
AC_DEFINE([ARCH_ARM], [], [Defined if the target CPU is arm])
;;
*amd64* )
AC_DEFINE([ARCH_INTEL], [], [Defined if the target CPU is intel])
;;
*i?86* )
AC_DEFINE([ARCH_INTEL], [], [Defined if the target CPU is intel])
;;
*x86_64* )
AC_DEFINE([ARCH_INTEL], [], [Defined if the target CPU is intel])
;;
esac

AC_CONFIG_FILES([Makefile src/Makefile module_posix_timer.pc])

AC_OUTPUT
Loading