From 645e0c1c90011bd5569cbd92ad38464b24a69c5b Mon Sep 17 00:00:00 2001 From: Robert Burger Date: Wed, 9 Jul 2025 13:47:45 +0200 Subject: [PATCH 01/80] Update cmake-multi-platform.yml --- .github/workflows/cmake-multi-platform.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index 6eeaec94..afde6c56 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -23,6 +23,7 @@ jobs: # # To add more build types (Release, Debug, RelWithDebInfo, etc.) customize the build_type list. matrix: + tag: [ 0.0.6, 0.0.5 ] os: [ubuntu-latest, windows-latest] build_type: [Release] c_compiler: [gcc, clang, cl] From 739fc978f55cf7258c12dfc6e7f45bde909a2ae3 Mon Sep 17 00:00:00 2001 From: Robert Burger Date: Wed, 9 Jul 2025 15:10:07 +0200 Subject: [PATCH 02/80] Create build_deb.yaml --- .github/workflows/build_deb.yaml | 43 ++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/build_deb.yaml diff --git a/.github/workflows/build_deb.yaml b/.github/workflows/build_deb.yaml new file mode 100644 index 00000000..11d4f990 --- /dev/null +++ b/.github/workflows/build_deb.yaml @@ -0,0 +1,43 @@ +name: Build DEB Package + +on: + push: + branches: + - feat/tag_build + pull_request: + branches: + - feat/tag_build + +jobs: + build-deb: + runs-on: ubuntu-latest + + steps: + - name: Checkout source + uses: actions/checkout@v4 + + - name: Install build dependencies + run: | + sudo apt-get update + sudo apt-get install -y build-essential devscripts debhelper autotools-dev fakeroot + + - 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 + + - name: Collect .deb artifact + run: | + mkdir -p artifacts + mv ../*.deb artifacts/ + + - name: Upload .deb package + uses: actions/upload-artifact@v4 + with: + name: libosal-deb + path: artifacts/*.deb From feb5cc9426e8a7e54f43865e73472086c3ecd3fa Mon Sep 17 00:00:00 2001 From: Robert Burger Date: Wed, 9 Jul 2025 15:11:13 +0200 Subject: [PATCH 03/80] Update build_deb.yaml --- .github/workflows/build_deb.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_deb.yaml b/.github/workflows/build_deb.yaml index 11d4f990..1009fa43 100644 --- a/.github/workflows/build_deb.yaml +++ b/.github/workflows/build_deb.yaml @@ -3,10 +3,10 @@ name: Build DEB Package on: push: branches: - - feat/tag_build + - feat/tag-build pull_request: branches: - - feat/tag_build + - feat/tag-build jobs: build-deb: From 6c7c77ba28f8d77d49e72c02a2555b4ad64a7117 Mon Sep 17 00:00:00 2001 From: Robert Burger Date: Wed, 9 Jul 2025 15:35:00 +0200 Subject: [PATCH 04/80] Update configure.ac --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 6e2d77a3..17c2b417 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ([2.69]) -AC_INIT([libosal], m4_esyscmd_s([cat project.properties | grep VERSION | cut -d'=' -f2 | xargs printf "%s"]), [Robert Burger ]) +AC_INIT([libosal], [0.1.0], [Robert Burger ]) AC_CANONICAL_TARGET From d69b9b57291d18429d577221ac6e0d6bd9b34ae4 Mon Sep 17 00:00:00 2001 From: Robert Burger Date: Wed, 9 Jul 2025 19:12:14 +0200 Subject: [PATCH 05/80] Update rules --- debian/rules | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/debian/rules b/debian/rules index 740e7b2b..ad0e0994 100755 --- a/debian/rules +++ b/debian/rules @@ -12,11 +12,11 @@ export DH_VERBOSE = 1 # package maintainers to append LDFLAGS #export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed -export GIT_VERSION = $(shell git describe --long --dirty --tags | awk -F- '{ print $$1 }') +#export GIT_VERSION = $(shell git describe --long --dirty --tags | awk -F- '{ print $$1 }') -override_dh_autoreconf: - sed 's/VERSION.*/VERSION = ${GIT_VERSION}/' -i project.properties - dh_autoreconf +#override_dh_autoreconf: +# sed 's/VERSION.*/VERSION = ${GIT_VERSION}/' -i project.properties +# dh_autoreconf %: dh $@ From f4fb15a772c145d3ff8758927454686c41767e5e Mon Sep 17 00:00:00 2001 From: Robert Burger Date: Thu, 10 Jul 2025 08:24:17 +0200 Subject: [PATCH 06/80] fix: return error code if pthread_setschedparam fails --- src/posix/task.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/posix/task.c b/src/posix/task.c index badf3fcf..ddf1d872 100644 --- a/src/posix/task.c +++ b/src/posix/task.c @@ -180,7 +180,6 @@ osal_retval_t osal_task_join(osal_task_t *hdl, osal_task_retval_t *retval) { int local_ret; local_ret = pthread_join(hdl->tid, retval); - (void)local_ret; if (local_ret != 0) { if (local_ret == EDEADLK) { @@ -384,7 +383,17 @@ osal_retval_t osal_task_set_policy(osal_task_t *hdl, osal_task_sched_policy_t po param.sched_priority = sched_get_priority_max(tmp_policy); } - (void)pthread_setschedparam(pthread_self(), tmp_policy, ¶m); + local_ret = pthread_setschedparam(pthread_self(), tmp_policy, ¶m); + + if (local_ret != 0) { + if ((local_ret == ESRCH) || (local_ret == EINVAL)) { + ret = OSAL_ERR_INVALID_PARAM; + } else if (local_ret == EPERM) { + ret = OSAL_ERR_PERMISSION_DENIED; + } else { + ret = OSAL_ERR_OPERATION_FAILED; + } + } } return ret; From 8b3c09cba5b684fe9af1c70b9f20d2cac69f7a2b Mon Sep 17 00:00:00 2001 From: Robert Burger Date: Thu, 10 Jul 2025 08:24:28 +0200 Subject: [PATCH 07/80] chore: add newline --- src/io.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/io.c b/src/io.c index e2d497f3..49d1d2e8 100644 --- a/src/io.c +++ b/src/io.c @@ -28,6 +28,7 @@ * along with libosal; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + #ifdef HAVE_CONFIG_H #include #endif From d0e44714ae0a721ab405fdc226efd0b1d40ad1f3 Mon Sep 17 00:00:00 2001 From: Robert Burger Date: Thu, 10 Jul 2025 08:34:11 +0200 Subject: [PATCH 08/80] add: coverage build --- rmc-build.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rmc-build.yaml b/rmc-build.yaml index 7ef55318..6f41e216 100644 --- a/rmc-build.yaml +++ b/rmc-build.yaml @@ -1,5 +1,7 @@ context: conan configurations: +- any: + coverage: True - imports: - linux_defaults_build_profile - debian11-x86_64 From adad223ec2d552f5c90bb1fee221c593091dbe8b Mon Sep 17 00:00:00 2001 From: Robert Burger Date: Thu, 10 Jul 2025 08:34:11 +0200 Subject: [PATCH 09/80] add: coverage build --- rmc-build.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rmc-build.yaml b/rmc-build.yaml index 7ef55318..6f41e216 100644 --- a/rmc-build.yaml +++ b/rmc-build.yaml @@ -1,5 +1,7 @@ context: conan configurations: +- any: + coverage: True - imports: - linux_defaults_build_profile - debian11-x86_64 From 33a675026871d0b377f2caa50ab9ac6bd90e00c8 Mon Sep 17 00:00:00 2001 From: Robert Burger Date: Thu, 10 Jul 2025 08:38:24 +0200 Subject: [PATCH 10/80] add: build to rmc-build.yaml --- rmc-build.yaml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/rmc-build.yaml b/rmc-build.yaml index 6f41e216..2a8d9081 100644 --- a/rmc-build.yaml +++ b/rmc-build.yaml @@ -1,8 +1,9 @@ -context: conan -configurations: -- any: - coverage: True -- imports: - - linux_defaults_build_profile -- debian11-x86_64 -- build_profile:osl154-x86_64 pikeos4.2-armv7hf-gcc5: +builds: +- context: conan + configurations: + - any: + coverage: True + - imports: + - linux_defaults_build_profile + - debian11-x86_64 + - build_profile:osl154-x86_64 pikeos4.2-armv7hf-gcc5: From 31f961c260c3cd4717e65d00e00ef38034e6acff Mon Sep 17 00:00:00 2001 From: Robert Burger Date: Thu, 10 Jul 2025 08:40:17 +0200 Subject: [PATCH 11/80] fix: indentation level of rmc-build.yaml --- rmc-build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rmc-build.yaml b/rmc-build.yaml index 2a8d9081..8836a522 100644 --- a/rmc-build.yaml +++ b/rmc-build.yaml @@ -2,7 +2,7 @@ builds: - context: conan configurations: - any: - coverage: True + coverage: True - imports: - linux_defaults_build_profile - debian11-x86_64 From b69d0017109890ff71933700652c6ebe739a2300 Mon Sep 17 00:00:00 2001 From: Robert Burger Date: Thu, 10 Jul 2025 08:54:06 +0200 Subject: [PATCH 12/80] change: skippin mutex noprioinheritance check when permission denied! --- tests/posix/test_mutex_priority_inversion.cc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/posix/test_mutex_priority_inversion.cc b/tests/posix/test_mutex_priority_inversion.cc index 3d41293c..4f1e91b1 100644 --- a/tests/posix/test_mutex_priority_inversion.cc +++ b/tests/posix/test_mutex_priority_inversion.cc @@ -255,6 +255,14 @@ TEST(MutexFunction, TestNoPriorityInheritance) { ASSERT_EQ(orv, OSAL_OK) << "osal_task_create() M failed"; + orv = osal_task_set_policy(nullptr, OSAL_SCHED_POLICY_FIFO); + if (orv == OSAL_ERR_PERMISSION_DENIED) { + printf("Warning: osal_task_set_policy permission denied " + "on that build host! Skipping TestNoPriorityInheritance!\n"); + return; + } + ASSERT_EQ(orv, OSAL_OK) << "osal_task_set_policy() L failed"; + orv = osal_task_set_priority(nullptr, 1); if (orv != 0) { printf("Warning: osal_task_set_priority() L failed " @@ -267,9 +275,6 @@ TEST(MutexFunction, TestNoPriorityInheritance) { "- consider running under \"chrt -f 1 ...\"\n"); } - orv = osal_task_set_policy(nullptr, OSAL_SCHED_POLICY_FIFO); - ASSERT_EQ(orv, OSAL_OK) << "osal_task_set_policy() L failed"; - run_L(&shared); osal_task_retval_t trv = 0; From 58870be444e3fafaa5dcbfd8d937311452a58ce1 Mon Sep 17 00:00:00 2001 From: Robert Burger Date: Thu, 10 Jul 2025 09:31:56 +0200 Subject: [PATCH 13/80] Update build_deb.yaml disable: make check for deb package build, may not work on github runner --- .github/workflows/build_deb.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_deb.yaml b/.github/workflows/build_deb.yaml index 1009fa43..36ab56ed 100644 --- a/.github/workflows/build_deb.yaml +++ b/.github/workflows/build_deb.yaml @@ -29,7 +29,7 @@ jobs: - name: Build .deb package run: | # baue mit dpkg-buildpackage (ohne signieren) - dpkg-buildpackage -us -uc + dpkg-buildpackage -us -uc -d - name: Collect .deb artifact run: | From 698c74f5c93b8b55e7d2d05383c1d49d170236e9 Mon Sep 17 00:00:00 2001 From: Robert Burger Date: Thu, 10 Jul 2025 10:03:57 +0200 Subject: [PATCH 14/80] Update build_deb.yaml --- .github/workflows/build_deb.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build_deb.yaml b/.github/workflows/build_deb.yaml index 36ab56ed..e4c26a4c 100644 --- a/.github/workflows/build_deb.yaml +++ b/.github/workflows/build_deb.yaml @@ -11,6 +11,9 @@ on: jobs: build-deb: runs-on: ubuntu-latest + + env: + DEB_BUILD_OPTIONS: nocheck # or whatever options you need steps: - name: Checkout source From 23dd2c00dbd12600164757770bd03cb18fa91a49 Mon Sep 17 00:00:00 2001 From: Robert Burger Date: Mon, 14 Jul 2025 09:57:54 +0200 Subject: [PATCH 15/80] Update build_deb.yaml --- .github/workflows/build_deb.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/build_deb.yaml b/.github/workflows/build_deb.yaml index e4c26a4c..494ddc78 100644 --- a/.github/workflows/build_deb.yaml +++ b/.github/workflows/build_deb.yaml @@ -44,3 +44,9 @@ jobs: with: name: libosal-deb path: artifacts/*.deb + + - name: Install Cloudsmith CLI + run: pip install --upgrade cloudsmith-cli + + - name: Upload .deb to Cloudsmith + run: cloudsmith push deb robert-burger-AdLL/libosal artifacts/libosal.deb --api-key ${{ secrets.CLOUDSMITH_API_KEY }} From f5b4d75551aa457d5884b786ca48f99058f36c16 Mon Sep 17 00:00:00 2001 From: Robert Burger Date: Mon, 14 Jul 2025 10:02:34 +0200 Subject: [PATCH 16/80] Update build_deb.yaml --- .github/workflows/build_deb.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_deb.yaml b/.github/workflows/build_deb.yaml index 494ddc78..a37d67a9 100644 --- a/.github/workflows/build_deb.yaml +++ b/.github/workflows/build_deb.yaml @@ -49,4 +49,4 @@ jobs: run: pip install --upgrade cloudsmith-cli - name: Upload .deb to Cloudsmith - run: cloudsmith push deb robert-burger-AdLL/libosal artifacts/libosal.deb --api-key ${{ secrets.CLOUDSMITH_API_KEY }} + run: cloudsmith push deb robert-burger-AdLL/libosal/ubuntu/2404 artifacts/libosal_0.0.6_amd64.deb --api-key ${{ secrets.CLOUDSMITH_API_KEY }} From c918511907533d7a18fbb97dfcfd4b33b16ab927 Mon Sep 17 00:00:00 2001 From: Robert Burger Date: Mon, 14 Jul 2025 10:06:21 +0200 Subject: [PATCH 17/80] Update build_deb.yaml --- .github/workflows/build_deb.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_deb.yaml b/.github/workflows/build_deb.yaml index a37d67a9..2f832d82 100644 --- a/.github/workflows/build_deb.yaml +++ b/.github/workflows/build_deb.yaml @@ -49,4 +49,4 @@ jobs: run: pip install --upgrade cloudsmith-cli - name: Upload .deb to Cloudsmith - run: cloudsmith push deb robert-burger-AdLL/libosal/ubuntu/2404 artifacts/libosal_0.0.6_amd64.deb --api-key ${{ secrets.CLOUDSMITH_API_KEY }} + run: cloudsmith push deb robert-burger-AdLL/libosal/ubuntu/noble artifacts/libosal_0.0.6_amd64.deb --api-key ${{ secrets.CLOUDSMITH_API_KEY }} From 9dee24d6387075f97c49c52fc97da3b326bd593e Mon Sep 17 00:00:00 2001 From: Robert Burger Date: Mon, 14 Jul 2025 10:17:18 +0200 Subject: [PATCH 18/80] change: deb build with PACKAGE_VERSION from git --- .github/workflows/build_deb.yaml | 9 +- bootstrap.sh | 5 + configure.ac.in | 161 +++++++++++++++++++++++++++++++ 3 files changed, 174 insertions(+), 1 deletion(-) create mode 100755 bootstrap.sh create mode 100644 configure.ac.in diff --git a/.github/workflows/build_deb.yaml b/.github/workflows/build_deb.yaml index 2f832d82..dc415764 100644 --- a/.github/workflows/build_deb.yaml +++ b/.github/workflows/build_deb.yaml @@ -22,8 +22,15 @@ jobs: - name: Install build dependencies run: | sudo apt-get update - sudo apt-get install -y build-essential devscripts debhelper autotools-dev fakeroot + sudo apt-get install -y build-essential devscripts debhelper autotools-dev fakeroot sed + - name: update branch name + run: | + safe_branch=$(echo "${GITHUB_REF_NAME}" | tr '/' '-') + sed "s|BRANCH_VERSION|$safe_branch|" configure.ac.in > configure.ac + env: + GITHUB_REF_NAME: ${{ github.ref_name }} + - name: Prepare autotools run: | # Nur falls nicht schon vorhanden (optional) diff --git a/bootstrap.sh b/bootstrap.sh new file mode 100755 index 00000000..a1546373 --- /dev/null +++ b/bootstrap.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +safe_branch=$(git describe --tags | tr '/:' '--') + +sed "s|PACKAGE_VERSION|$safe_branch|" configure.ac.in > configure.ac diff --git a/configure.ac.in b/configure.ac.in new file mode 100644 index 00000000..6b8cc9f3 --- /dev/null +++ b/configure.ac.in @@ -0,0 +1,161 @@ +# -*- Autoconf -*- +# Process this file with autoconf to produce a configure script. + +AC_PREREQ([2.69]) +AC_INIT([libosal], [PACKAGE_VERSION], [Robert Burger ]) + +AC_CANONICAL_TARGET + +# Automake initialization +AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects]) +#AM_INIT_AUTOMAKE([-Wall -Werror foreign silent-rules subdir-objects]) +#m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) +m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) + + +AC_CONFIG_SRCDIR([src]) +AC_CONFIG_HEADERS([config.h]) +AC_CONFIG_MACRO_DIR([m4]) +AX_PREFIX_CONFIG_H(include/libosal/config.h) # prep mylib/_config.h from it.. + +# Checks for programs. +AC_PROG_CC +# we test the posix API with gtest, which requires C++ +AC_PROG_CXX +AC_PROG_LIBTOOL + +LT_INIT + +case $target_os in + mingw32*) + BUILD_POSIX=true + BUILD_MINGW32=true + AC_DEFINE([BUILD_POSIX], [true], [Use POSIX build on windows mingw32]) + AC_DEFINE([BUILD_MINGW32], [true], [Use MINGW32 build on windows mingw32]) + AX_APPEND_FLAG([-DPTW32_STATIC_LIB], [CFLAGS]) + ;; + linux*) + BUILD_POSIX=true + AC_DEFINE([BUILD_POSIX], [true], [Use POSIX build on linux]) + ;; + vxworks*) + BUILD_VXWORKS=true + AC_DEFINE([BUILD_VXWORKS], [true], [Use VxWorks build]) + ;; + pikeos*) + BUILD_PIKEOS=true + AC_DEFINE([BUILD_PIKEOS], [true], [Use PikeOS build]) + CFLAGS="$CFLAGS -Wno-suggest-attribute=format -Wno-error=suggest-attribute=format" + ;; +esac + +if test x$BUILD_POSIX == xtrue; then + AC_DEFINE([HAVE_ENOTRECOVERABLE], [], [Check if errno ENOTRECOVERABLE is present.]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ + #include + ],[ + int ret = ENOTRECOVERABLE; + ])], [AC_DEFINE([HAVE_ENOTRECOVERABLE], [1])], + [AC_DEFINE([HAVE_ENOTRECOVERABLE], [0])]) + + AC_DEFINE([HAVE_SIGSTOP], [], [Check if signal SIGSTOP is present.]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ + #include + ],[ + int ret = SIGSTOP; + ])], [AC_DEFINE([HAVE_SIGSTOP], [1])], + [AC_DEFINE([HAVE_SIGSTOP], [0])]) + + AC_DEFINE([HAVE_SIGCONT], [], [Check if signal SIGCONT is present.]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ + #include + ],[ + int ret = SIGCONT; + ])], [AC_DEFINE([HAVE_SIGCONT], [1])], + [AC_DEFINE([HAVE_SIGCONT], [0])]) + + PTHREAD_LIBS="" + RT_LIBS="" + + AC_DEFINE([HAVE_PTHREAD_MUTEXATTR_SETROBUST], [], [Check if posix function pthread_mutexattr_setrobust present.]) + AC_CHECK_LIB(pthread, pthread_mutexattr_setrobust, + [AC_DEFINE([HAVE_PTHREAD_MUTEXATTR_SETROBUST], [1]) + PTHREAD_LIBS="-lpthread"], + [AC_DEFINE([HAVE_PTHREAD_MUTEXATTR_SETROBUST], [0])]) + + AC_DEFINE([HAVE_PTHREAD_SETAFFINITY_NP], [], [Check if posix function pthread_setaffinity_np present.]) + AC_CHECK_LIB(pthread, pthread_setaffinity_np, + [AC_DEFINE([HAVE_PTHREAD_SETAFFINITY_NP], [1]) + PTHREAD_LIBS="-lpthread"], + [AC_DEFINE([HAVE_PTHREAD_SETAFFINITY_NP], [0])]) + + AC_CHECK_LIB(pthread, pthread_create, PTHREAD_LIBS="-lpthread") + AC_CHECK_LIB(rt, clock_gettime, RT_LIBS="-lrt") + AC_SUBST(PTHREAD_LIBS) + AC_SUBST(RT_LIBS) +fi + +AC_CHECK_LIB(m, sqrt, MATH_LIBS="-lm") +AC_SUBST(MATH_LIBS) + +AM_CONDITIONAL([BUILD_POSIX], [ test x$BUILD_POSIX = xtrue]) +AM_CONDITIONAL([BUILD_MINGW32], [ test x$BUILD_MINGW32 = xtrue]) +AM_CONDITIONAL([BUILD_VXWORKS], [ test x$BUILD_VXWORKS = xtrue]) +AM_CONDITIONAL([BUILD_PIKEOS], [ test x$BUILD_PIKEOS = xtrue]) +AM_CONDITIONAL([BUILD_WIN32], [ test x$BUILD_WIN32 = xtrue]) + +# Checks for libraries. + +# Checks for header files. +AC_CHECK_HEADERS([stdint.h]) +AC_CHECK_HEADERS([math.h]) +AC_CHECK_HEADERS([sys/mman.h], HAVE_SYS_MMAN_H=true, HAVE_SYS_MMAN_H=false) +AC_CHECK_HEADERS([mqueue.h], HAVE_MQUEUE_H=true, HAVE_MQUEUE_H=false) +dnl check for sys/prctl for setting thread name on Linux +AC_CHECK_HEADERS([sys/prctl.h], [], [], [AC_INCLUDES_DEFAULT]) + +# Checks for header files. +AC_CHECK_HEADERS([p4ext_threads.h]) + +# Check support for -mrdseed +AS_IF([test "$ac_cv_header_p4ext_threads_h" = "yes"], [ + AC_DEFINE([HAVE_P4_MUTEX_INIT_EXT], [], [Check if pikeos support p4_mutext_init_ext.]) + + CFLAGS_save=$CFLAGS + CFLAGS="$CFLAGS -Werror" + XXX_PROGRAM=" +#include +int main(void) { + P4_mutex_t pikeos_mtx; + P4_uint32_t flags = 0u; + P4_prio_t ceil_prio = 0u; + p4_mutex_init_ext(&pikeos_mtx, flags, ceil_prio); + return 0; +} +" + AC_MSG_CHECKING([whether pikeos support for p4_mutex_init_ext]) + AC_COMPILE_IFELSE( + [AC_LANG_SOURCE([$XXX_PROGRAM])], + [ + AC_MSG_RESULT([yes]) + AC_DEFINE([HAVE_P4_MUTEX_INIT_EXT], [1]) + ], + [ + AC_MSG_RESULT([no]) + AC_DEFINE([HAVE_P4_MUTEX_INIT_EXT], [0]) + ] + ) + + CFLAGS=$CFLAGS_save +]) + +AM_CONDITIONAL([HAVE_SYS_MMAN_H], [ test x$HAVE_SYS_MMAN_H = xtrue]) +AM_CONDITIONAL([HAVE_MQUEUE_H], [ test x$HAVE_MQUEUE_H = xtrue]) + +# Checks for typedefs, structures, and compiler characteristics. +AC_TYPE_UINT32_T + +# Checks for library functions. + +AC_CONFIG_FILES([Makefile src/Makefile src/tools/logger/Makefile src/tools/shmtest/Makefile tests/Makefile tests/posix/Makefile libosal.pc]) +AC_OUTPUT From 2d1d5b8e00e3720ef060b9c6890ddf8c9a423434 Mon Sep 17 00:00:00 2001 From: Robert Burger Date: Mon, 14 Jul 2025 10:22:53 +0200 Subject: [PATCH 19/80] del: old configure ac --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 17c2b417..872ffca6 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ([2.69]) -AC_INIT([libosal], [0.1.0], [Robert Burger ]) +AC_INIT([libosal], [0.0.6-rev0-59-gc918511], [Robert Burger ]) AC_CANONICAL_TARGET From 85c1f91d9a0697c11f85ea8377ba8626df0d297f Mon Sep 17 00:00:00 2001 From: Robert Burger Date: Mon, 14 Jul 2025 11:07:21 +0200 Subject: [PATCH 20/80] add: update of debian changelog --- .github/workflows/build_deb.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_deb.yaml b/.github/workflows/build_deb.yaml index dc415764..2a19bd1b 100644 --- a/.github/workflows/build_deb.yaml +++ b/.github/workflows/build_deb.yaml @@ -31,6 +31,10 @@ jobs: env: GITHUB_REF_NAME: ${{ github.ref_name }} + - name: update debian changelog + run: sh ./git2debchangelog.sh > debian/changelog + shell: bash + - name: Prepare autotools run: | # Nur falls nicht schon vorhanden (optional) @@ -56,4 +60,4 @@ jobs: run: pip install --upgrade cloudsmith-cli - name: Upload .deb to Cloudsmith - run: cloudsmith push deb robert-burger-AdLL/libosal/ubuntu/noble artifacts/libosal_0.0.6_amd64.deb --api-key ${{ secrets.CLOUDSMITH_API_KEY }} + run: cloudsmith push deb --republish robert-burger-AdLL/libosal/ubuntu/noble artifacts/libosal_0.0.6_amd64.deb --api-key ${{ secrets.CLOUDSMITH_API_KEY }} From ace1d2770727e2b37f307abcecb2a1a036ab599c Mon Sep 17 00:00:00 2001 From: Robert Burger Date: Mon, 14 Jul 2025 11:25:30 +0200 Subject: [PATCH 21/80] change: calling with bash --- .github/workflows/build_deb.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build_deb.yaml b/.github/workflows/build_deb.yaml index 2a19bd1b..c279bfe5 100644 --- a/.github/workflows/build_deb.yaml +++ b/.github/workflows/build_deb.yaml @@ -32,8 +32,7 @@ jobs: GITHUB_REF_NAME: ${{ github.ref_name }} - name: update debian changelog - run: sh ./git2debchangelog.sh > debian/changelog - shell: bash + run: bash ./git2debchangelog.sh > debian/changelog - name: Prepare autotools run: | From 4da76b910d7656a02c3eb8c4278c9d5f15b0e45e Mon Sep 17 00:00:00 2001 From: Robert Burger Date: Mon, 14 Jul 2025 11:33:01 +0200 Subject: [PATCH 22/80] change: fetch all branches --- .github/workflows/build_deb.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build_deb.yaml b/.github/workflows/build_deb.yaml index c279bfe5..e67d4983 100644 --- a/.github/workflows/build_deb.yaml +++ b/.github/workflows/build_deb.yaml @@ -18,12 +18,17 @@ jobs: steps: - name: Checkout source uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Install build dependencies run: | sudo apt-get update sudo apt-get install -y build-essential devscripts debhelper autotools-dev fakeroot sed + - name: Fetch all branches + run: git fetch --all + - name: update branch name run: | safe_branch=$(echo "${GITHUB_REF_NAME}" | tr '/' '-') From 07667e793690df6212eb21e5ca584dcd3bc28e20 Mon Sep 17 00:00:00 2001 From: Robert Burger Date: Mon, 14 Jul 2025 11:35:42 +0200 Subject: [PATCH 23/80] change: also fetch tags --- .github/workflows/build_deb.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_deb.yaml b/.github/workflows/build_deb.yaml index e67d4983..6ec0b00a 100644 --- a/.github/workflows/build_deb.yaml +++ b/.github/workflows/build_deb.yaml @@ -27,7 +27,7 @@ jobs: sudo apt-get install -y build-essential devscripts debhelper autotools-dev fakeroot sed - name: Fetch all branches - run: git fetch --all + run: git fetch --all --tags - name: update branch name run: | From 7af6b71d7f9f8b02bd7460884561b15a8b0e3bbb Mon Sep 17 00:00:00 2001 From: Robert Burger Date: Mon, 14 Jul 2025 12:32:11 +0200 Subject: [PATCH 24/80] change: also fetch tags --- .github/workflows/build_deb.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_deb.yaml b/.github/workflows/build_deb.yaml index 6ec0b00a..e30e22f4 100644 --- a/.github/workflows/build_deb.yaml +++ b/.github/workflows/build_deb.yaml @@ -27,7 +27,7 @@ jobs: sudo apt-get install -y build-essential devscripts debhelper autotools-dev fakeroot sed - name: Fetch all branches - run: git fetch --all --tags + run: git fetch --tags - name: update branch name run: | From 73be889ffde9c8dcae0b2e9f0a15c9c9b518af3f Mon Sep 17 00:00:00 2001 From: Robert Burger Date: Mon, 14 Jul 2025 15:11:51 +0200 Subject: [PATCH 25/80] change: also fetch tags --- .github/workflows/build_deb.yaml | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_deb.yaml b/.github/workflows/build_deb.yaml index e30e22f4..36c0de4c 100644 --- a/.github/workflows/build_deb.yaml +++ b/.github/workflows/build_deb.yaml @@ -14,7 +14,20 @@ jobs: 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 + - distro: debian-bullseye + image: debian:bullseye + - distro: ubuntu-24.04 + image: ubuntu:24.04 + - distro: ubuntu-22.04 + image: ubuntu:22.04 + container: + image: ${{ matrix.image }} steps: - name: Checkout source uses: actions/checkout@v4 @@ -53,11 +66,17 @@ jobs: run: | mkdir -p artifacts mv ../*.deb artifacts/ + + - name: Set sanitized image name + id: sanitize + run: echo "sanitized_image=$(echo "$IMAGE" | tr '/:' '--')" >> $GITHUB_OUTPUT + env: + IMAGE: ${{ matrix.image }} - name: Upload .deb package uses: actions/upload-artifact@v4 with: - name: libosal-deb + name: libosal-deb-${{ steps.sanitize.outputs.sanitized_image }} path: artifacts/*.deb - name: Install Cloudsmith CLI From 0e43f632dbf681d97b0efcaf539235209c242e08 Mon Sep 17 00:00:00 2001 From: Robert Burger Date: Mon, 14 Jul 2025 15:15:00 +0200 Subject: [PATCH 26/80] change: sudo not needed in container runner --- .github/workflows/build_deb.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_deb.yaml b/.github/workflows/build_deb.yaml index 36c0de4c..bd7e778c 100644 --- a/.github/workflows/build_deb.yaml +++ b/.github/workflows/build_deb.yaml @@ -36,8 +36,8 @@ jobs: - name: Install build dependencies run: | - sudo apt-get update - sudo apt-get install -y build-essential devscripts debhelper autotools-dev fakeroot sed + apt-get update + apt-get install -y build-essential devscripts debhelper autotools-dev fakeroot sed - name: Fetch all branches run: git fetch --tags From 426a3396d69eaa88009253cfc8c2de7024f30eee Mon Sep 17 00:00:00 2001 From: Robert Burger Date: Mon, 14 Jul 2025 15:18:27 +0200 Subject: [PATCH 27/80] change: reorder steps --- .github/workflows/build_deb.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build_deb.yaml b/.github/workflows/build_deb.yaml index bd7e778c..2bcd7224 100644 --- a/.github/workflows/build_deb.yaml +++ b/.github/workflows/build_deb.yaml @@ -29,16 +29,16 @@ jobs: container: image: ${{ matrix.image }} steps: + - name: Install build dependencies + run: | + apt-get update + apt-get install -y build-essential devscripts debhelper autotools-dev fakeroot sed git + - name: Checkout source uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Install build dependencies - run: | - apt-get update - apt-get install -y build-essential devscripts debhelper autotools-dev fakeroot sed - - name: Fetch all branches run: git fetch --tags From fe0e9845a92f3774c5a839ab5f636c7097621b5f Mon Sep 17 00:00:00 2001 From: Robert Burger Date: Mon, 14 Jul 2025 15:21:56 +0200 Subject: [PATCH 28/80] change: add safe.directory for git clone --- .github/workflows/build_deb.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build_deb.yaml b/.github/workflows/build_deb.yaml index 2bcd7224..6251cfcb 100644 --- a/.github/workflows/build_deb.yaml +++ b/.github/workflows/build_deb.yaml @@ -39,6 +39,9 @@ jobs: with: fetch-depth: 0 + - name: Mark working directory as safe + run: git config --global --add safe.directory $GITHUB_WORKSPACE + - name: Fetch all branches run: git fetch --tags From 00e6fd915faa7e822777a1580e232798ca9e0a36 Mon Sep 17 00:00:00 2001 From: Robert Burger Date: Mon, 14 Jul 2025 15:22:53 +0200 Subject: [PATCH 29/80] chore: syntax fix --- .github/workflows/build_deb.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_deb.yaml b/.github/workflows/build_deb.yaml index 6251cfcb..13768262 100644 --- a/.github/workflows/build_deb.yaml +++ b/.github/workflows/build_deb.yaml @@ -40,7 +40,7 @@ jobs: fetch-depth: 0 - name: Mark working directory as safe - run: git config --global --add safe.directory $GITHUB_WORKSPACE + run: git config --global --add safe.directory $GITHUB_WORKSPACE - name: Fetch all branches run: git fetch --tags From 9ae242712e773774e20ac7961e1b03daccfd1bae Mon Sep 17 00:00:00 2001 From: Robert Burger Date: Tue, 15 Jul 2025 06:09:44 +0200 Subject: [PATCH 30/80] update: debian changelog --- debian/changelog | 47 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index d9668646..f16fcfc5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,50 @@ +libosal (0.1.0~pre1-1) unstable; urgency=low + + * Merge branch 'master' of github.com:robert-burger/libosal + * Merge pull request #6 from marcfir/master + * Merge commit '0.0.6-rev0-2-g98fb40b' + * fix: out-of-src-tree build + * fix: posix sem_timedwait -> converting timeout to CLOCK_REALTIME based timeout if needed + * use target_compile_definitions + * fix: add HAVE_CONFIG_H to cmake + * Merge pull request #13 from common/feat/stm32-merge + * Merge branch 'feat/stm32' into feat/stm32-merge + * changed ifndef and define from posix to stm32 + * add: stm32 libosal files + * add: initial stm32 mutex + * fix: binary semaphore has uninitialized internal mutex attributes in posix case + * deleted crit sec in osal_puts + * deleted crit sec in sem_trywait + * changed buf size in osal_printf and added sizeof(buf) + * added CRIT_SECs around HAL_UART_TX + * use huart1 instead of huart3 + * Merge pull request #1 from burger-r/stm32-changes + * Update timer.c, fix stm32hxx.h + * fix: changes for stm32 target + * added volatile int + * added volatile int + * added memset 0 + * added HAL_UART_Transmit and ATOMIC_BLOCK + * removed outcommented lines; added timer logic + * removed outcommented lines; added semaphore logic(inc/dec) + * restructure + * added counter to sem + * added TIM2 and 4 for time calculation in osal_timer_gettime + * initialized timespec ts={0,0} + * added stm32_ret + * added me to authors; added date + * deleted function pthreads for stm32 functions + * added missing stm32 files; made #ifdef for config and for LIBOSAL_BUILD_STM32 + * changed ifndef and define from posix to stm32 + * changed ifndef and define from posix to stm32 + * add: stm32 libosal files + * add: initial stm32 mutex + + -- Robert Burger Thu, 3 Jul 2025 06:51:06 +0200 + libosal (0.0.6) unstable; urgency=low + * prep: 0.0.6 release * fix: extendend tracing to also return min_val and max_val relative * fix: extendend tracing to also return min_val and max_val * add: extenden tracing to also return min_val and max_val @@ -21,7 +66,7 @@ libosal (0.0.6) unstable; urgency=low * doc: clean markdown * feat(CMake): Configure fpic - -- Robert Burger Wed, 19 Mar 2025 14:51:32 +0100 + -- Robert Burger Mon, 24 Mar 2025 08:28:42 +0100 libosal (0.0.5) unstable; urgency=low From 3937fb6d65578d31fee6ec46fdf7e36c77eb48b2 Mon Sep 17 00:00:00 2001 From: Robert Burger Date: Tue, 15 Jul 2025 06:13:16 +0200 Subject: [PATCH 31/80] update: debian package generation --- .../workflows/{build_deb.yaml => build-deb.yaml} | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) rename .github/workflows/{build_deb.yaml => build-deb.yaml} (88%) diff --git a/.github/workflows/build_deb.yaml b/.github/workflows/build-deb.yaml similarity index 88% rename from .github/workflows/build_deb.yaml rename to .github/workflows/build-deb.yaml index 13768262..732e2f4a 100644 --- a/.github/workflows/build_deb.yaml +++ b/.github/workflows/build-deb.yaml @@ -20,12 +20,20 @@ jobs: 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: @@ -52,9 +60,6 @@ jobs: env: GITHUB_REF_NAME: ${{ github.ref_name }} - - name: update debian changelog - run: bash ./git2debchangelog.sh > debian/changelog - - name: Prepare autotools run: | # Nur falls nicht schon vorhanden (optional) @@ -86,4 +91,4 @@ jobs: run: pip install --upgrade cloudsmith-cli - name: Upload .deb to Cloudsmith - run: cloudsmith push deb --republish robert-burger-AdLL/libosal/ubuntu/noble artifacts/libosal_0.0.6_amd64.deb --api-key ${{ secrets.CLOUDSMITH_API_KEY }} + run: cloudsmith push deb --republish robert-burger-AdLL/libosal/${{ matrix.os }}/${{ matrix.version }} artifacts/*.deb --api-key ${{ secrets.CLOUDSMITH_API_KEY }} From f95e67b57b8b97a0e778281bcba0e5e526fffb6b Mon Sep 17 00:00:00 2001 From: Robert Burger Date: Tue, 15 Jul 2025 06:19:56 +0200 Subject: [PATCH 32/80] change: add install of python3-pip --- .github/workflows/build-deb.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-deb.yaml b/.github/workflows/build-deb.yaml index 732e2f4a..f0eced76 100644 --- a/.github/workflows/build-deb.yaml +++ b/.github/workflows/build-deb.yaml @@ -40,7 +40,7 @@ jobs: - name: Install build dependencies run: | apt-get update - apt-get install -y build-essential devscripts debhelper autotools-dev fakeroot sed git + apt-get install -y build-essential devscripts debhelper autotools-dev fakeroot sed git python3-pip - name: Checkout source uses: actions/checkout@v4 From 62c4c6efe52203af18724b425ca52cd3cc6a4c53 Mon Sep 17 00:00:00 2001 From: Robert Burger Date: Tue, 15 Jul 2025 06:41:48 +0200 Subject: [PATCH 33/80] change: not publishing debug sym objects --- .github/workflows/build-deb.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-deb.yaml b/.github/workflows/build-deb.yaml index f0eced76..04aa1a9f 100644 --- a/.github/workflows/build-deb.yaml +++ b/.github/workflows/build-deb.yaml @@ -91,4 +91,5 @@ jobs: run: pip install --upgrade cloudsmith-cli - name: Upload .deb to Cloudsmith - run: cloudsmith push deb --republish robert-burger-AdLL/libosal/${{ matrix.os }}/${{ matrix.version }} artifacts/*.deb --api-key ${{ secrets.CLOUDSMITH_API_KEY }} + run: | + find artifacts --not --regex ".*/dgbsym/.*" -exec cloudsmith push deb --republish robert-burger-AdLL/libosal/${{ matrix.os }}/${{ matrix.version }} {} --api-key ${{ secrets.CLOUDSMITH_API_KEY }} From 18a40ebb1c3d3f68ba87894ba7e2be5d77bfeedb Mon Sep 17 00:00:00 2001 From: Robert Burger Date: Tue, 15 Jul 2025 06:45:54 +0200 Subject: [PATCH 34/80] change: pip install in container --- .github/workflows/build-deb.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-deb.yaml b/.github/workflows/build-deb.yaml index 04aa1a9f..efae7e34 100644 --- a/.github/workflows/build-deb.yaml +++ b/.github/workflows/build-deb.yaml @@ -88,7 +88,7 @@ jobs: path: artifacts/*.deb - name: Install Cloudsmith CLI - run: pip install --upgrade cloudsmith-cli + run: pip install --break-system-packages --upgrade cloudsmith-cli - name: Upload .deb to Cloudsmith run: | From f4663310538405ad81b452cc4caf58cc3d82e4f0 Mon Sep 17 00:00:00 2001 From: Robert Burger Date: Tue, 15 Jul 2025 06:59:58 +0200 Subject: [PATCH 35/80] change: using cloudsmith action --- .github/workflows/build-deb.yaml | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-deb.yaml b/.github/workflows/build-deb.yaml index efae7e34..2cd7c56b 100644 --- a/.github/workflows/build-deb.yaml +++ b/.github/workflows/build-deb.yaml @@ -86,10 +86,24 @@ jobs: with: name: libosal-deb-${{ steps.sanitize.outputs.sanitized_image }} path: artifacts/*.deb + + - name: Push + id: push + uses: cloudsmith-io/action@master + with: + api-key: ${{ secrets.CLOUDSMITH_API_KEY }} + command: "push" + format: "deb" + owner: "cloudsmith" + repo: "actions" + distro: "{{ martrix.os }}" + release: "{{ matrix.version }}" + republish: "true" # needed ONLY if version is not changing + file: "artifacts/libosal-*.deb" - - name: Install Cloudsmith CLI - run: pip install --break-system-packages --upgrade cloudsmith-cli - - - name: Upload .deb to Cloudsmith - run: | - find artifacts --not --regex ".*/dgbsym/.*" -exec cloudsmith push deb --republish robert-burger-AdLL/libosal/${{ matrix.os }}/${{ matrix.version }} {} --api-key ${{ secrets.CLOUDSMITH_API_KEY }} + # - name: Install Cloudsmith CLI + # run: pip install --break-system-packages --upgrade cloudsmith-cli + # + # - name: Upload .deb to Cloudsmith + # run: | + # find artifacts --not --regex ".*/dgbsym/.*" -exec cloudsmith push deb --republish robert-burger-AdLL/libosal/${{ matrix.os }}/${{ matrix.version }} {} --api-key ${{ secrets.CLOUDSMITH_API_KEY }} From 509f9ef6de91a902b4abd89005faa1d29d2a45bc Mon Sep 17 00:00:00 2001 From: Robert Burger Date: Tue, 15 Jul 2025 07:08:03 +0200 Subject: [PATCH 36/80] change: using pip to install cloudsmith --- .github/workflows/build-deb.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-deb.yaml b/.github/workflows/build-deb.yaml index 2cd7c56b..d7af3099 100644 --- a/.github/workflows/build-deb.yaml +++ b/.github/workflows/build-deb.yaml @@ -100,6 +100,7 @@ jobs: release: "{{ matrix.version }}" republish: "true" # needed ONLY if version is not changing file: "artifacts/libosal-*.deb" + executable: "false" # Add this to use pip instead # - name: Install Cloudsmith CLI # run: pip install --break-system-packages --upgrade cloudsmith-cli From 31c0b03f6842d51031504406d130fb5f04cf5263 Mon Sep 17 00:00:00 2001 From: Robert Burger Date: Tue, 15 Jul 2025 07:10:25 +0200 Subject: [PATCH 37/80] change: using pip to install cloudsmith --- .github/workflows/build-deb.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-deb.yaml b/.github/workflows/build-deb.yaml index d7af3099..e93103b3 100644 --- a/.github/workflows/build-deb.yaml +++ b/.github/workflows/build-deb.yaml @@ -100,7 +100,7 @@ jobs: release: "{{ matrix.version }}" republish: "true" # needed ONLY if version is not changing file: "artifacts/libosal-*.deb" - executable: "false" # Add this to use pip instead + use-executable: "false" # Add this to use pip instead # - name: Install Cloudsmith CLI # run: pip install --break-system-packages --upgrade cloudsmith-cli From 41b3e83f13e0fa290a6d23830f5d8a2a8593233f Mon Sep 17 00:00:00 2001 From: Robert Burger Date: Tue, 15 Jul 2025 12:33:41 +0200 Subject: [PATCH 38/80] add: version to deb package --- .github/workflows/build-deb.yaml | 48 +++++++++++++++++++++----------- 1 file changed, 31 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build-deb.yaml b/.github/workflows/build-deb.yaml index e93103b3..c136761d 100644 --- a/.github/workflows/build-deb.yaml +++ b/.github/workflows/build-deb.yaml @@ -40,7 +40,7 @@ jobs: - name: Install build dependencies run: | apt-get update - apt-get install -y build-essential devscripts debhelper autotools-dev fakeroot sed git python3-pip + apt-get install -y build-essential devscripts debhelper autotools-dev fakeroot sed git python3-pip curl - name: Checkout source uses: actions/checkout@v4 @@ -77,30 +77,44 @@ jobs: - name: Set sanitized image name id: sanitize - run: echo "sanitized_image=$(echo "$IMAGE" | tr '/:' '--')" >> $GITHUB_OUTPUT + run: | + version=$(dpkg-parsechangelog | sed -n 's/^Version: //p') + echo "sanitized_image=$(echo "$version" | tr '/:' '--')" >> $GITHUB_OUTPUT env: IMAGE: ${{ matrix.image }} - name: Upload .deb package uses: actions/upload-artifact@v4 with: - name: libosal-deb-${{ steps.sanitize.outputs.sanitized_image }} + name: libosal-${{ steps.sanitize.outputs.sanitized_image }} path: artifacts/*.deb - - name: Push - id: push - uses: cloudsmith-io/action@master - with: - api-key: ${{ secrets.CLOUDSMITH_API_KEY }} - command: "push" - format: "deb" - owner: "cloudsmith" - repo: "actions" - distro: "{{ martrix.os }}" - release: "{{ matrix.version }}" - republish: "true" # needed ONLY if version is not changing - file: "artifacts/libosal-*.deb" - use-executable: "false" # Add this to use pip instead + - name: Upload to Cloudsmith + env: + CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }} + run: | + curl -1 -L -X POST "https://api.cloudsmith.io/v1/packages/robert-burger-AdLL/libosal/upload/" \ + -H "Authorization: Bearer $CLOUDSMITH_API_KEY" \ + -F "package=@out/your-package_1.0.0_amd64.deb" \ + -F "name=your-package" \ + -F "version=1.0.0" \ + -F "distribution={{ matrix.os }}" \ + -F "release={{ matrix.version }}" + + #- name: Push + # id: push + # uses: cloudsmith-io/action@master + # with: + # api-key: ${{ secrets.CLOUDSMITH_API_KEY }} + # command: "push" + # format: "deb" + # owner: "cloudsmith" + # repo: "actions" + # distro: "{{ martrix.os }}" + # release: "{{ matrix.version }}" + # republish: "true" # needed ONLY if version is not changing + # file: "artifacts/libosal-*.deb" + # use-executable: "false" # Add this to use pip instead # - name: Install Cloudsmith CLI # run: pip install --break-system-packages --upgrade cloudsmith-cli From 475afb8ded92a070bbfcb11cf0921a74fddfce0d Mon Sep 17 00:00:00 2001 From: Robert Burger Date: Tue, 15 Jul 2025 12:38:32 +0200 Subject: [PATCH 39/80] fix: cloudsmith upload --- .github/workflows/build-deb.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-deb.yaml b/.github/workflows/build-deb.yaml index c136761d..ae5d1cbd 100644 --- a/.github/workflows/build-deb.yaml +++ b/.github/workflows/build-deb.yaml @@ -86,7 +86,7 @@ jobs: - name: Upload .deb package uses: actions/upload-artifact@v4 with: - name: libosal-${{ steps.sanitize.outputs.sanitized_image }} + name: libosal-${{ steps.sanitize.outputs.sanitized_image }}.deb path: artifacts/*.deb - name: Upload to Cloudsmith @@ -95,9 +95,9 @@ jobs: run: | curl -1 -L -X POST "https://api.cloudsmith.io/v1/packages/robert-burger-AdLL/libosal/upload/" \ -H "Authorization: Bearer $CLOUDSMITH_API_KEY" \ - -F "package=@out/your-package_1.0.0_amd64.deb" \ + -F "package=artifacts/libosal-${{ steps.sanitize.outputs.sanitized_image }}.deb" \ -F "name=your-package" \ - -F "version=1.0.0" \ + -F "version=${{ steps.sanitize.outputs.sanitized_image }}" \ -F "distribution={{ matrix.os }}" \ -F "release={{ matrix.version }}" From 13e72add4eb309f7ceac5a34b281c1fe9ec5969d Mon Sep 17 00:00:00 2001 From: Robert Burger Date: Tue, 15 Jul 2025 13:01:41 +0200 Subject: [PATCH 40/80] change: cloudsmith url --- .github/workflows/build-deb.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-deb.yaml b/.github/workflows/build-deb.yaml index ae5d1cbd..dbee1300 100644 --- a/.github/workflows/build-deb.yaml +++ b/.github/workflows/build-deb.yaml @@ -73,7 +73,7 @@ jobs: - name: Collect .deb artifact run: | mkdir -p artifacts - mv ../*.deb artifacts/ + mv ../libosal_*.deb artifacts/ - name: Set sanitized image name id: sanitize @@ -96,7 +96,7 @@ jobs: curl -1 -L -X POST "https://api.cloudsmith.io/v1/packages/robert-burger-AdLL/libosal/upload/" \ -H "Authorization: Bearer $CLOUDSMITH_API_KEY" \ -F "package=artifacts/libosal-${{ steps.sanitize.outputs.sanitized_image }}.deb" \ - -F "name=your-package" \ + -F "name=libosal-${{ steps.sanitize.outputs.sanitized_image }}" \ -F "version=${{ steps.sanitize.outputs.sanitized_image }}" \ -F "distribution={{ matrix.os }}" \ -F "release={{ matrix.version }}" From 63a2009de443b1abe506772a0e55f7312c94fcef Mon Sep 17 00:00:00 2001 From: Robert Burger Date: Tue, 15 Jul 2025 13:06:37 +0200 Subject: [PATCH 41/80] change: upload to os/version subdirs --- .github/workflows/build-deb.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-deb.yaml b/.github/workflows/build-deb.yaml index dbee1300..c21e3e4e 100644 --- a/.github/workflows/build-deb.yaml +++ b/.github/workflows/build-deb.yaml @@ -72,8 +72,8 @@ jobs: - name: Collect .deb artifact run: | - mkdir -p artifacts - mv ../libosal_*.deb artifacts/ + mkdir -p artifacts/${{ matrix.os }}/${{ matrix.version }} + mv ../libosal_*.deb artifacts/${{ matrix.os }}/${{ matrix.version }} - name: Set sanitized image name id: sanitize @@ -87,15 +87,15 @@ jobs: uses: actions/upload-artifact@v4 with: name: libosal-${{ steps.sanitize.outputs.sanitized_image }}.deb - path: artifacts/*.deb + path: artifacts/${{ matrix.os }}/${{ matrix.version }}/*.deb - name: Upload to Cloudsmith env: CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }} run: | - curl -1 -L -X POST "https://api.cloudsmith.io/v1/packages/robert-burger-AdLL/libosal/upload/" \ + curl -1 -L -X POST "https://upload.cloudsmith.io/api/v1/packages/robert-burger-AdLL/libosal/upload/" \ -H "Authorization: Bearer $CLOUDSMITH_API_KEY" \ - -F "package=artifacts/libosal-${{ steps.sanitize.outputs.sanitized_image }}.deb" \ + -F "package=artifacts/${{ matrix.os }}/${{ matrix.version }}/libosal-${{ steps.sanitize.outputs.sanitized_image }}.deb" \ -F "name=libosal-${{ steps.sanitize.outputs.sanitized_image }}" \ -F "version=${{ steps.sanitize.outputs.sanitized_image }}" \ -F "distribution={{ matrix.os }}" \ From adb3a66a63756a7d970969e363fa5d7eb56e83d0 Mon Sep 17 00:00:00 2001 From: Robert Burger Date: Tue, 15 Jul 2025 13:12:31 +0200 Subject: [PATCH 42/80] add: IMAGE to sanitized name --- .github/workflows/build-deb.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-deb.yaml b/.github/workflows/build-deb.yaml index c21e3e4e..7a59f97e 100644 --- a/.github/workflows/build-deb.yaml +++ b/.github/workflows/build-deb.yaml @@ -79,7 +79,7 @@ jobs: id: sanitize run: | version=$(dpkg-parsechangelog | sed -n 's/^Version: //p') - echo "sanitized_image=$(echo "$version" | tr '/:' '--')" >> $GITHUB_OUTPUT + echo "sanitized_image=$(echo "$version-$IMAGE" | tr '/:' '--')" >> $GITHUB_OUTPUT env: IMAGE: ${{ matrix.image }} From cf59d5fb12f309bfed67fc0d38cee07708912390 Mon Sep 17 00:00:00 2001 From: Robert Burger Date: Tue, 15 Jul 2025 13:16:28 +0200 Subject: [PATCH 43/80] fix: cloudsmith upload url --- .github/workflows/build-deb.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-deb.yaml b/.github/workflows/build-deb.yaml index 7a59f97e..a1a4ae10 100644 --- a/.github/workflows/build-deb.yaml +++ b/.github/workflows/build-deb.yaml @@ -93,7 +93,7 @@ jobs: env: CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }} run: | - curl -1 -L -X POST "https://upload.cloudsmith.io/api/v1/packages/robert-burger-AdLL/libosal/upload/" \ + curl -1 -L -X POST "https://upload.cloudsmith.io/api/v1/packages/robert-burger-AdLL/libosal/" \ -H "Authorization: Bearer $CLOUDSMITH_API_KEY" \ -F "package=artifacts/${{ matrix.os }}/${{ matrix.version }}/libosal-${{ steps.sanitize.outputs.sanitized_image }}.deb" \ -F "name=libosal-${{ steps.sanitize.outputs.sanitized_image }}" \ From 5a5e4d2812a5d2f1b8716cce5c9d6178ba83a8e7 Mon Sep 17 00:00:00 2001 From: Robert Burger Date: Tue, 15 Jul 2025 13:41:54 +0200 Subject: [PATCH 44/80] change: trying two-step cloudsmith upload --- .github/workflows/build-deb.yaml | 48 ++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/.github/workflows/build-deb.yaml b/.github/workflows/build-deb.yaml index a1a4ae10..44ef8272 100644 --- a/.github/workflows/build-deb.yaml +++ b/.github/workflows/build-deb.yaml @@ -101,6 +101,54 @@ jobs: -F "distribution={{ matrix.os }}" \ -F "release={{ matrix.version }}" + - name: Upload binary to Cloudsmith (Step 1: PUT) + id: step1 + env: + API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }} + run: | + OWNER="robert-burger-AdLL" + REPO="libosal" + FILENAME="artifacts/${{ matrix.os }}/${{ matrix.version }}/libosal-${{ steps.sanitize.outputs.sanitized_image }}.deb" + TARGET_FILENAME="libosal-${{ steps.sanitize.outputs.sanitized_image }}.deb" + + echo "Uploading via PUT..." + RESPONSE=$(curl -s -H "Authorization: token $API_KEY" \ + --upload-file "$FILENAME" \ + "https://upload.cloudsmith.io/${OWNER}/${REPO}/${TARGET_FILENAME}") + + echo "step1_response=$RESPONSE" >> $GITHUB_OUTPUT + + - name: Register package in Cloudsmith (Step 2: POST) + env: + API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }} + run: | + OWNER="robert-burger-AdLL" + REPO="libosal" + + IDENTIFIER=$(echo "$STEP1_RESPONSE" | jq -r '.identifier') + + if [ -z "$IDENTIFIER" ] || [ "$IDENTIFIER" == "null" ]; then + echo "❌ Failed to get identifier from step 1:" + echo "$STEP1_RESPONSE" + exit 1 + fi + + echo "Registering package with identifier: $IDENTIFIER" + curl -v --fail -H "Authorization: token $API_KEY" \ + -H "Content-Type: application/json" \ + -X POST "https://api.cloudsmith.io/v1/packages/${OWNER}/${REPO}/upload/raw/" \ + -d @- < Date: Tue, 15 Jul 2025 13:43:24 +0200 Subject: [PATCH 45/80] fix: yaml syntax --- .github/workflows/build-deb.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-deb.yaml b/.github/workflows/build-deb.yaml index 44ef8272..0735e3c6 100644 --- a/.github/workflows/build-deb.yaml +++ b/.github/workflows/build-deb.yaml @@ -101,7 +101,7 @@ jobs: -F "distribution={{ matrix.os }}" \ -F "release={{ matrix.version }}" - - name: Upload binary to Cloudsmith (Step 1: PUT) + - name: Upload binary to Cloudsmith (Step 1 PUT) id: step1 env: API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }} @@ -118,7 +118,7 @@ jobs: echo "step1_response=$RESPONSE" >> $GITHUB_OUTPUT - - name: Register package in Cloudsmith (Step 2: POST) + - name: Register package in Cloudsmith (Step 2 POST) env: API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }} run: | From f57808c28a5ad14b296e54c328d0e149ba4657e7 Mon Sep 17 00:00:00 2001 From: Robert Burger Date: Tue, 15 Jul 2025 13:44:23 +0200 Subject: [PATCH 46/80] fix: yaml syntax --- .github/workflows/build-deb.yaml | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build-deb.yaml b/.github/workflows/build-deb.yaml index 0735e3c6..9c4075bd 100644 --- a/.github/workflows/build-deb.yaml +++ b/.github/workflows/build-deb.yaml @@ -138,17 +138,18 @@ jobs: -H "Content-Type: application/json" \ -X POST "https://api.cloudsmith.io/v1/packages/${OWNER}/${REPO}/upload/raw/" \ -d @- < Date: Tue, 15 Jul 2025 13:47:28 +0200 Subject: [PATCH 47/80] fix: file name --- .github/workflows/build-deb.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-deb.yaml b/.github/workflows/build-deb.yaml index 9c4075bd..51e64c05 100644 --- a/.github/workflows/build-deb.yaml +++ b/.github/workflows/build-deb.yaml @@ -89,6 +89,11 @@ jobs: name: libosal-${{ steps.sanitize.outputs.sanitized_image }}.deb path: artifacts/${{ matrix.os }}/${{ matrix.version }}/*.deb + - name: Ensure package is present + run: | + echo "Files in workspace:" + ls -la + - name: Upload to Cloudsmith env: CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }} @@ -108,7 +113,7 @@ jobs: run: | OWNER="robert-burger-AdLL" REPO="libosal" - FILENAME="artifacts/${{ matrix.os }}/${{ matrix.version }}/libosal-${{ steps.sanitize.outputs.sanitized_image }}.deb" + FILENAME="artifacts/libosal-${{ steps.sanitize.outputs.sanitized_image }}.deb" TARGET_FILENAME="libosal-${{ steps.sanitize.outputs.sanitized_image }}.deb" echo "Uploading via PUT..." From be5ed322c3817ffb107e7644dd568481dbdda63c Mon Sep 17 00:00:00 2001 From: Robert Burger Date: Tue, 15 Jul 2025 13:49:33 +0200 Subject: [PATCH 48/80] fix: file name --- .github/workflows/build-deb.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-deb.yaml b/.github/workflows/build-deb.yaml index 51e64c05..523a76f5 100644 --- a/.github/workflows/build-deb.yaml +++ b/.github/workflows/build-deb.yaml @@ -92,7 +92,7 @@ jobs: - name: Ensure package is present run: | echo "Files in workspace:" - ls -la + find * - name: Upload to Cloudsmith env: From 29d6e4f7113d7da348219bb0fecb91a6d1bfc5b3 Mon Sep 17 00:00:00 2001 From: Robert Burger Date: Tue, 15 Jul 2025 13:55:50 +0200 Subject: [PATCH 49/80] fix: file name --- .github/workflows/build-deb.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-deb.yaml b/.github/workflows/build-deb.yaml index 523a76f5..07030f25 100644 --- a/.github/workflows/build-deb.yaml +++ b/.github/workflows/build-deb.yaml @@ -111,10 +111,11 @@ jobs: env: API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }} run: | + VERSION=$(dpkg-parsechangelog | sed -n 's/^Version: //p') OWNER="robert-burger-AdLL" REPO="libosal" - FILENAME="artifacts/libosal-${{ steps.sanitize.outputs.sanitized_image }}.deb" - TARGET_FILENAME="libosal-${{ steps.sanitize.outputs.sanitized_image }}.deb" + FILENAME="artifacts/${{ matrix.os }}/${{ matrix.version }}/libosal_$version_amd64.deb" + TARGET_FILENAME="libosal-${{ steps.sanitize.outputs.sanitized_image }}_amd64.deb" echo "Uploading via PUT..." RESPONSE=$(curl -s -H "Authorization: token $API_KEY" \ From 8a5e0842da44231df20f46c36356172a6fe58ec8 Mon Sep 17 00:00:00 2001 From: Robert Burger Date: Tue, 15 Jul 2025 13:57:48 +0200 Subject: [PATCH 50/80] fix: file name --- .github/workflows/build-deb.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-deb.yaml b/.github/workflows/build-deb.yaml index 07030f25..3a33c2cd 100644 --- a/.github/workflows/build-deb.yaml +++ b/.github/workflows/build-deb.yaml @@ -114,7 +114,7 @@ jobs: VERSION=$(dpkg-parsechangelog | sed -n 's/^Version: //p') OWNER="robert-burger-AdLL" REPO="libosal" - FILENAME="artifacts/${{ matrix.os }}/${{ matrix.version }}/libosal_$version_amd64.deb" + FILENAME="artifacts/${{ matrix.os }}/${{ matrix.version }}/libosal_${VERSION}_amd64.deb" TARGET_FILENAME="libosal-${{ steps.sanitize.outputs.sanitized_image }}_amd64.deb" echo "Uploading via PUT..." From 60db8d58ef7d0dd1ec196607b08b9cc9b1200944 Mon Sep 17 00:00:00 2001 From: Robert Burger Date: Tue, 15 Jul 2025 14:00:57 +0200 Subject: [PATCH 51/80] add: install of jq --- .github/workflows/build-deb.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-deb.yaml b/.github/workflows/build-deb.yaml index 3a33c2cd..1ce5cf55 100644 --- a/.github/workflows/build-deb.yaml +++ b/.github/workflows/build-deb.yaml @@ -40,7 +40,7 @@ jobs: - name: Install build dependencies run: | apt-get update - apt-get install -y build-essential devscripts debhelper autotools-dev fakeroot sed git python3-pip curl + apt-get install -y build-essential devscripts debhelper autotools-dev fakeroot sed git python3-pip curl jq - name: Checkout source uses: actions/checkout@v4 From f3236f4461933d3d76ad620edd87655b77808e1f Mon Sep 17 00:00:00 2001 From: Robert Burger Date: Tue, 15 Jul 2025 14:05:42 +0200 Subject: [PATCH 52/80] fix: file name --- .github/workflows/build-deb.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-deb.yaml b/.github/workflows/build-deb.yaml index 1ce5cf55..e8b5e850 100644 --- a/.github/workflows/build-deb.yaml +++ b/.github/workflows/build-deb.yaml @@ -114,13 +114,13 @@ jobs: VERSION=$(dpkg-parsechangelog | sed -n 's/^Version: //p') OWNER="robert-burger-AdLL" REPO="libosal" - FILENAME="artifacts/${{ matrix.os }}/${{ matrix.version }}/libosal_${VERSION}_amd64.deb" + FILENAME="artifacts/${{ matrix.os }}/${{ matrix.version }}/libosal_$VERSION_amd64.deb" TARGET_FILENAME="libosal-${{ steps.sanitize.outputs.sanitized_image }}_amd64.deb" echo "Uploading via PUT..." RESPONSE=$(curl -s -H "Authorization: token $API_KEY" \ --upload-file "$FILENAME" \ - "https://upload.cloudsmith.io/${OWNER}/${REPO}/${TARGET_FILENAME}") + "https://upload.cloudsmith.io/$OWNER/$REPO/$TARGET_FILENAME") echo "step1_response=$RESPONSE" >> $GITHUB_OUTPUT From b9db935223be9f91c3b7b1ec4aef6b7c955b60f7 Mon Sep 17 00:00:00 2001 From: Robert Burger Date: Tue, 15 Jul 2025 14:10:23 +0200 Subject: [PATCH 53/80] fix: file name --- .github/workflows/build-deb.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-deb.yaml b/.github/workflows/build-deb.yaml index e8b5e850..efc6b63e 100644 --- a/.github/workflows/build-deb.yaml +++ b/.github/workflows/build-deb.yaml @@ -114,13 +114,15 @@ jobs: VERSION=$(dpkg-parsechangelog | sed -n 's/^Version: //p') OWNER="robert-burger-AdLL" REPO="libosal" - FILENAME="artifacts/${{ matrix.os }}/${{ matrix.version }}/libosal_$VERSION_amd64.deb" + FILENAME="artifacts/${{ matrix.os }}/${{ matrix.version }}/libosal_${VERSION}_amd64.deb" TARGET_FILENAME="libosal-${{ steps.sanitize.outputs.sanitized_image }}_amd64.deb" echo "Uploading via PUT..." + echo "filename: ${FILENAME}" + echo "https://upload.cloudsmith.io/${OWNER}/${REPO}/${TARGET_FILENAME}" RESPONSE=$(curl -s -H "Authorization: token $API_KEY" \ --upload-file "$FILENAME" \ - "https://upload.cloudsmith.io/$OWNER/$REPO/$TARGET_FILENAME") + "https://upload.cloudsmith.io/${OWNER}/${REPO}/${TARGET_FILENAME}") echo "step1_response=$RESPONSE" >> $GITHUB_OUTPUT From bb1c3ea14097d30bb3eab384ab3c87b75544050e Mon Sep 17 00:00:00 2001 From: Robert Burger Date: Tue, 15 Jul 2025 14:14:47 +0200 Subject: [PATCH 54/80] fix: step1 response --- .github/workflows/build-deb.yaml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-deb.yaml b/.github/workflows/build-deb.yaml index efc6b63e..e9fae96f 100644 --- a/.github/workflows/build-deb.yaml +++ b/.github/workflows/build-deb.yaml @@ -124,7 +124,7 @@ jobs: --upload-file "$FILENAME" \ "https://upload.cloudsmith.io/${OWNER}/${REPO}/${TARGET_FILENAME}") - echo "step1_response=$RESPONSE" >> $GITHUB_OUTPUT + echo "response=$RESPONSE" >> $GITHUB_OUTPUT - name: Register package in Cloudsmith (Step 2 POST) env: @@ -132,12 +132,15 @@ jobs: run: | OWNER="robert-burger-AdLL" REPO="libosal" - - IDENTIFIER=$(echo "$STEP1_RESPONSE" | jq -r '.identifier') - + + RESPONSE="${{ steps.step1.outputs.response }}" + echo "Response from step1: $RESPONSE" + + IDENTIFIER=$(echo "$RESPONSE" | jq -r '.identifier') + if [ -z "$IDENTIFIER" ] || [ "$IDENTIFIER" == "null" ]; then echo "❌ Failed to get identifier from step 1:" - echo "$STEP1_RESPONSE" + echo "$RESPONSE" exit 1 fi From 08d871139dac175f73436b24d013e87f6e73dc92 Mon Sep 17 00:00:00 2001 From: Robert Burger Date: Tue, 15 Jul 2025 14:17:49 +0200 Subject: [PATCH 55/80] fix: step1 response --- .github/workflows/build-deb.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-deb.yaml b/.github/workflows/build-deb.yaml index e9fae96f..4cf87e31 100644 --- a/.github/workflows/build-deb.yaml +++ b/.github/workflows/build-deb.yaml @@ -136,7 +136,7 @@ jobs: RESPONSE="${{ steps.step1.outputs.response }}" echo "Response from step1: $RESPONSE" - IDENTIFIER=$(echo "$RESPONSE" | jq -r '.identifier') + IDENTIFIER=$(echo "$RESPONSE" | grep -o 'identifier:[^,]*' | sed 's/identifier://') if [ -z "$IDENTIFIER" ] || [ "$IDENTIFIER" == "null" ]; then echo "❌ Failed to get identifier from step 1:" From e826c1d7abcdc75c124813b138ec62809c9c20f4 Mon Sep 17 00:00:00 2001 From: Robert Burger Date: Tue, 15 Jul 2025 14:24:35 +0200 Subject: [PATCH 56/80] fix: step2 release --- .github/workflows/build-deb.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-deb.yaml b/.github/workflows/build-deb.yaml index 4cf87e31..95721170 100644 --- a/.github/workflows/build-deb.yaml +++ b/.github/workflows/build-deb.yaml @@ -156,7 +156,7 @@ jobs: "summary": "testebuild", "description": "Uploaded via GitHub Actions with OS metadata", "os": "${{ matrix.os }}", - "os_release": "${{ matrix.version }}", + "release": "${{ matrix.version }}", "arch": "amd64" } EOF From 0b14cf0260fe6ecfe98f92877ae2a3fdcddbfde8 Mon Sep 17 00:00:00 2001 From: Robert Burger Date: Tue, 15 Jul 2025 15:21:41 +0200 Subject: [PATCH 57/80] fix: step2 release --- .github/workflows/build-deb.yaml | 118 ++++++++++++++++++++++--------- 1 file changed, 85 insertions(+), 33 deletions(-) diff --git a/.github/workflows/build-deb.yaml b/.github/workflows/build-deb.yaml index 95721170..068b8b40 100644 --- a/.github/workflows/build-deb.yaml +++ b/.github/workflows/build-deb.yaml @@ -125,41 +125,93 @@ jobs: "https://upload.cloudsmith.io/${OWNER}/${REPO}/${TARGET_FILENAME}") echo "response=$RESPONSE" >> $GITHUB_OUTPUT - - - name: Register package in Cloudsmith (Step 2 POST) - env: - API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }} - run: | - OWNER="robert-burger-AdLL" - REPO="libosal" - RESPONSE="${{ steps.step1.outputs.response }}" - echo "Response from step1: $RESPONSE" + - name: Register package in Cloudsmith (Step 2 POST w/ debug) + shell: bash + env: + API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }} + run: | + OWNER="robert-burger-AdLL" + REPO="libosal" + + RESPONSE="${{ steps.step1.outputs.response }}" + echo "Step 1 raw response: $RESPONSE" + + IDENTIFIER=$(echo "$RESPONSE" | grep -o 'identifier:[^,]*' | sed 's/identifier://') + echo "Parsed IDENTIFIER: '$IDENTIFIER'" + + if [[ -z "$IDENTIFIER" || "$IDENTIFIER" == "null" ]]; then + echo "❌ Invalid identifier — aborting" + exit 1 + fi + + JSON_PAYLOAD=$(cat < Date: Tue, 15 Jul 2025 15:22:40 +0200 Subject: [PATCH 58/80] fix: step2 release --- .github/workflows/build-deb.yaml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/.github/workflows/build-deb.yaml b/.github/workflows/build-deb.yaml index 068b8b40..3ba8b9d2 100644 --- a/.github/workflows/build-deb.yaml +++ b/.github/workflows/build-deb.yaml @@ -93,18 +93,6 @@ jobs: run: | echo "Files in workspace:" find * - - - name: Upload to Cloudsmith - env: - CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }} - run: | - curl -1 -L -X POST "https://upload.cloudsmith.io/api/v1/packages/robert-burger-AdLL/libosal/" \ - -H "Authorization: Bearer $CLOUDSMITH_API_KEY" \ - -F "package=artifacts/${{ matrix.os }}/${{ matrix.version }}/libosal-${{ steps.sanitize.outputs.sanitized_image }}.deb" \ - -F "name=libosal-${{ steps.sanitize.outputs.sanitized_image }}" \ - -F "version=${{ steps.sanitize.outputs.sanitized_image }}" \ - -F "distribution={{ matrix.os }}" \ - -F "release={{ matrix.version }}" - name: Upload binary to Cloudsmith (Step 1 PUT) id: step1 From 5d003c14468367362ae366416e7c9eb1126dae79 Mon Sep 17 00:00:00 2001 From: Robert Burger Date: Tue, 15 Jul 2025 15:24:12 +0200 Subject: [PATCH 59/80] fix: step2 release --- .github/workflows/build-deb.yaml | 100 +++++++++++++++---------------- 1 file changed, 50 insertions(+), 50 deletions(-) diff --git a/.github/workflows/build-deb.yaml b/.github/workflows/build-deb.yaml index 3ba8b9d2..966dd641 100644 --- a/.github/workflows/build-deb.yaml +++ b/.github/workflows/build-deb.yaml @@ -114,56 +114,56 @@ jobs: echo "response=$RESPONSE" >> $GITHUB_OUTPUT - - name: Register package in Cloudsmith (Step 2 POST w/ debug) - shell: bash - env: - API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }} - run: | - OWNER="robert-burger-AdLL" - REPO="libosal" - - RESPONSE="${{ steps.step1.outputs.response }}" - echo "Step 1 raw response: $RESPONSE" - - IDENTIFIER=$(echo "$RESPONSE" | grep -o 'identifier:[^,]*' | sed 's/identifier://') - echo "Parsed IDENTIFIER: '$IDENTIFIER'" - - if [[ -z "$IDENTIFIER" || "$IDENTIFIER" == "null" ]]; then - echo "❌ Invalid identifier — aborting" - exit 1 - fi - - JSON_PAYLOAD=$(cat < Date: Tue, 15 Jul 2025 15:24:46 +0200 Subject: [PATCH 60/80] fix: step2 release --- .github/workflows/build-deb.yaml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build-deb.yaml b/.github/workflows/build-deb.yaml index 966dd641..410f8640 100644 --- a/.github/workflows/build-deb.yaml +++ b/.github/workflows/build-deb.yaml @@ -134,18 +134,18 @@ jobs: fi JSON_PAYLOAD=$(cat < Date: Tue, 15 Jul 2025 15:27:30 +0200 Subject: [PATCH 61/80] fix: step2 release --- .github/workflows/build-deb.yaml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build-deb.yaml b/.github/workflows/build-deb.yaml index 410f8640..437f8388 100644 --- a/.github/workflows/build-deb.yaml +++ b/.github/workflows/build-deb.yaml @@ -134,17 +134,17 @@ jobs: fi JSON_PAYLOAD=$(cat < Date: Tue, 15 Jul 2025 15:31:24 +0200 Subject: [PATCH 62/80] fix: step2 release --- .github/workflows/build-deb.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-deb.yaml b/.github/workflows/build-deb.yaml index 437f8388..6d296acd 100644 --- a/.github/workflows/build-deb.yaml +++ b/.github/workflows/build-deb.yaml @@ -152,7 +152,7 @@ jobs: HTTP_CODE=$(curl -s -w "%{http_code}" \ -H "Authorization: token $API_KEY" \ -H "Content-Type: application/json" \ - -X POST "https://api.cloudsmith.io/v1/packages/${OWNER}/${REPO}/upload/raw/" \ + -X POST "https://api.cloudsmith.io/v1/packages/${OWNER}/${REPO}/upload/raw/?replace=1" \ -d "$JSON_PAYLOAD" \ -o response_body.txt) From 3f5809ccd4c12e38116eca1e9836d5bed81b395c Mon Sep 17 00:00:00 2001 From: Robert Burger Date: Wed, 16 Jul 2025 06:50:31 +0200 Subject: [PATCH 63/80] fix: cloudsmith upload version --- .github/workflows/build-deb.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-deb.yaml b/.github/workflows/build-deb.yaml index 6d296acd..d8177b0e 100644 --- a/.github/workflows/build-deb.yaml +++ b/.github/workflows/build-deb.yaml @@ -119,6 +119,7 @@ jobs: env: API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }} run: | + VERSION=$(dpkg-parsechangelog | sed -n 's/^Version: //p') OWNER="robert-burger-AdLL" REPO="libosal" @@ -137,11 +138,11 @@ jobs: { "package_file": "$IDENTIFIER", "name": "libosal", - "version": "1.0.0~pre1.1", + "version": "${FILENAME}", "summary": "testebuild", "description": "Uploaded via GitHub Actions with OS metadata", - "os": "debian", - "os_release": "bullseye", + "os": "${{ matrix.os }}", + "os_release": "${{ matrix.version }}", "arch": "amd64" } EOF From d0373ac9a5d0b40940b671bbe54718df77c20b91 Mon Sep 17 00:00:00 2001 From: Robert Burger Date: Wed, 16 Jul 2025 06:54:21 +0200 Subject: [PATCH 64/80] fix: cloudsmith upload version --- .github/workflows/build-deb.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-deb.yaml b/.github/workflows/build-deb.yaml index d8177b0e..a1578f3c 100644 --- a/.github/workflows/build-deb.yaml +++ b/.github/workflows/build-deb.yaml @@ -138,7 +138,7 @@ jobs: { "package_file": "$IDENTIFIER", "name": "libosal", - "version": "${FILENAME}", + "version": "${VERSION}", "summary": "testebuild", "description": "Uploaded via GitHub Actions with OS metadata", "os": "${{ matrix.os }}", From 90907e2a334bb42cdd0218e15e05fb82a23a28df Mon Sep 17 00:00:00 2001 From: Robert Burger Date: Wed, 16 Jul 2025 07:04:41 +0200 Subject: [PATCH 65/80] change: add summary to upload --- .github/workflows/build-deb.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-deb.yaml b/.github/workflows/build-deb.yaml index a1578f3c..a5e50ebc 100644 --- a/.github/workflows/build-deb.yaml +++ b/.github/workflows/build-deb.yaml @@ -139,7 +139,7 @@ jobs: "package_file": "$IDENTIFIER", "name": "libosal", "version": "${VERSION}", - "summary": "testebuild", + "summary": "libosal is an operating system abstraction layer Library. It's purpose is to write os-independent code for easy portability between different systems and architectures.", "description": "Uploaded via GitHub Actions with OS metadata", "os": "${{ matrix.os }}", "os_release": "${{ matrix.version }}", From 204ef2c8e8b03deebeeeaee617a8d0ccfd228eee Mon Sep 17 00:00:00 2001 From: Robert Burger Date: Wed, 16 Jul 2025 07:52:59 +0200 Subject: [PATCH 66/80] change: switched to cloudsmith-cli --- .github/workflows/build-deb.yaml | 134 +++---------------------------- 1 file changed, 10 insertions(+), 124 deletions(-) diff --git a/.github/workflows/build-deb.yaml b/.github/workflows/build-deb.yaml index a5e50ebc..909c4600 100644 --- a/.github/workflows/build-deb.yaml +++ b/.github/workflows/build-deb.yaml @@ -94,132 +94,18 @@ jobs: echo "Files in workspace:" find * - - name: Upload binary to Cloudsmith (Step 1 PUT) - id: step1 - env: - API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }} + - name: Set up Python and install cloudsmith-cli run: | - VERSION=$(dpkg-parsechangelog | sed -n 's/^Version: //p') - OWNER="robert-burger-AdLL" - REPO="libosal" - FILENAME="artifacts/${{ matrix.os }}/${{ matrix.version }}/libosal_${VERSION}_amd64.deb" - TARGET_FILENAME="libosal-${{ steps.sanitize.outputs.sanitized_image }}_amd64.deb" - - echo "Uploading via PUT..." - echo "filename: ${FILENAME}" - echo "https://upload.cloudsmith.io/${OWNER}/${REPO}/${TARGET_FILENAME}" - RESPONSE=$(curl -s -H "Authorization: token $API_KEY" \ - --upload-file "$FILENAME" \ - "https://upload.cloudsmith.io/${OWNER}/${REPO}/${TARGET_FILENAME}") - - echo "response=$RESPONSE" >> $GITHUB_OUTPUT + python -m pip install --upgrade pip + pip install cloudsmith-cli - - name: Register package in Cloudsmith (Step 2 POST w/ debug) - shell: bash + + - name: Upload to Cloudsmith (${{ matrix.os }}/${{ matrix.version }}) env: - API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }} + CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }} run: | - VERSION=$(dpkg-parsechangelog | sed -n 's/^Version: //p') - OWNER="robert-burger-AdLL" - REPO="libosal" - - RESPONSE="${{ steps.step1.outputs.response }}" - echo "Step 1 raw response: $RESPONSE" - - IDENTIFIER=$(echo "$RESPONSE" | grep -o 'identifier:[^,]*' | sed 's/identifier://') - echo "Parsed IDENTIFIER: '$IDENTIFIER'" - - if [[ -z "$IDENTIFIER" || "$IDENTIFIER" == "null" ]]; then - echo "❌ Invalid identifier — aborting" - exit 1 - fi - - JSON_PAYLOAD=$(cat < Date: Wed, 16 Jul 2025 07:56:01 +0200 Subject: [PATCH 67/80] change: using python3 explicitely --- .github/workflows/build-deb.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-deb.yaml b/.github/workflows/build-deb.yaml index 909c4600..4d83bb2b 100644 --- a/.github/workflows/build-deb.yaml +++ b/.github/workflows/build-deb.yaml @@ -96,9 +96,8 @@ jobs: - name: Set up Python and install cloudsmith-cli run: | - python -m pip install --upgrade pip - pip install cloudsmith-cli - + python3 -m pip install --upgrade pip + pip3 install cloudsmith-cli - name: Upload to Cloudsmith (${{ matrix.os }}/${{ matrix.version }}) env: From f67bc938daf1aa74b89a05fcff8ab1717a8bb45c Mon Sep 17 00:00:00 2001 From: Robert Burger Date: Wed, 16 Jul 2025 07:58:50 +0200 Subject: [PATCH 68/80] change: fix version --- .github/workflows/build-deb.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-deb.yaml b/.github/workflows/build-deb.yaml index 4d83bb2b..cf00f6bd 100644 --- a/.github/workflows/build-deb.yaml +++ b/.github/workflows/build-deb.yaml @@ -103,6 +103,7 @@ jobs: env: CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }} run: | + VERSION=$(dpkg-parsechangelog | sed -n 's/^Version: //p') FILENAME="artifacts/${{ matrix.os }}/${{ matrix.version }}/libosal_${VERSION}_amd64.deb" cloudsmith push deb robert-burger-AdLL/libosal/${{ matrix.os }}/${{ matrix.version }} ${FILENAME} \ --republish \ From 3692387d07d28978603588e2dc2f425692b4a7ab Mon Sep 17 00:00:00 2001 From: Robert Burger Date: Wed, 16 Jul 2025 08:02:01 +0200 Subject: [PATCH 69/80] change: using python venv --- .github/workflows/build-deb.yaml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-deb.yaml b/.github/workflows/build-deb.yaml index cf00f6bd..f8b976ea 100644 --- a/.github/workflows/build-deb.yaml +++ b/.github/workflows/build-deb.yaml @@ -94,15 +94,17 @@ jobs: echo "Files in workspace:" find * - - name: Set up Python and install cloudsmith-cli - run: | - python3 -m pip install --upgrade pip - pip3 install cloudsmith-cli - - name: Upload to Cloudsmith (${{ matrix.os }}/${{ matrix.version }}) env: CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }} run: | + python3 -m venv cloudsmith + cd cloudsmith + source bin/activate + + python3 -m pip install --upgrade pip + pip3 install cloudsmith-cli + VERSION=$(dpkg-parsechangelog | sed -n 's/^Version: //p') FILENAME="artifacts/${{ matrix.os }}/${{ matrix.version }}/libosal_${VERSION}_amd64.deb" cloudsmith push deb robert-burger-AdLL/libosal/${{ matrix.os }}/${{ matrix.version }} ${FILENAME} \ From aa94b53670fc76a92518617d4569052514c2704c Mon Sep 17 00:00:00 2001 From: Robert Burger Date: Wed, 16 Jul 2025 08:04:14 +0200 Subject: [PATCH 70/80] change: install python3-venv --- .github/workflows/build-deb.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-deb.yaml b/.github/workflows/build-deb.yaml index f8b976ea..defac13a 100644 --- a/.github/workflows/build-deb.yaml +++ b/.github/workflows/build-deb.yaml @@ -40,7 +40,7 @@ jobs: - name: Install build dependencies run: | apt-get update - apt-get install -y build-essential devscripts debhelper autotools-dev fakeroot sed git python3-pip curl jq + apt-get install -y build-essential devscripts debhelper autotools-dev fakeroot sed git python3-pip python3-venv curl jq - name: Checkout source uses: actions/checkout@v4 From 961729c0e133632d991d7e941eaeb7a2f7c2e3b0 Mon Sep 17 00:00:00 2001 From: Robert Burger Date: Wed, 16 Jul 2025 08:06:14 +0200 Subject: [PATCH 71/80] change: install source --- .github/workflows/build-deb.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-deb.yaml b/.github/workflows/build-deb.yaml index defac13a..b3677b10 100644 --- a/.github/workflows/build-deb.yaml +++ b/.github/workflows/build-deb.yaml @@ -40,7 +40,7 @@ jobs: - name: Install build dependencies run: | apt-get update - apt-get install -y build-essential devscripts debhelper autotools-dev fakeroot sed git python3-pip python3-venv curl jq + apt-get install -y build-essential devscripts debhelper autotools-dev fakeroot sed git python3-pip python3-venv source curl jq - name: Checkout source uses: actions/checkout@v4 @@ -97,6 +97,7 @@ jobs: - name: Upload to Cloudsmith (${{ matrix.os }}/${{ matrix.version }}) env: CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }} + shell: bash run: | python3 -m venv cloudsmith cd cloudsmith From d473978e40f0ffa2973abb6e4dcc761fb366d52b Mon Sep 17 00:00:00 2001 From: Robert Burger Date: Wed, 16 Jul 2025 08:07:46 +0200 Subject: [PATCH 72/80] change: source is a bash program --- .github/workflows/build-deb.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-deb.yaml b/.github/workflows/build-deb.yaml index b3677b10..e9fafad8 100644 --- a/.github/workflows/build-deb.yaml +++ b/.github/workflows/build-deb.yaml @@ -40,7 +40,7 @@ jobs: - name: Install build dependencies run: | apt-get update - apt-get install -y build-essential devscripts debhelper autotools-dev fakeroot sed git python3-pip python3-venv source curl jq + apt-get install -y build-essential devscripts debhelper autotools-dev fakeroot sed git python3-pip python3-venv curl jq - name: Checkout source uses: actions/checkout@v4 From a76011ae397d7cc63316fba979b1721516497a89 Mon Sep 17 00:00:00 2001 From: Robert Burger Date: Wed, 16 Jul 2025 08:10:04 +0200 Subject: [PATCH 73/80] change: fix command order --- .github/workflows/build-deb.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-deb.yaml b/.github/workflows/build-deb.yaml index e9fafad8..72aac11e 100644 --- a/.github/workflows/build-deb.yaml +++ b/.github/workflows/build-deb.yaml @@ -99,6 +99,9 @@ jobs: CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }} shell: bash run: | + VERSION=$(dpkg-parsechangelog | sed -n 's/^Version: //p') + FILENAME="artifacts/${{ matrix.os }}/${{ matrix.version }}/libosal_${VERSION}_amd64.deb" + python3 -m venv cloudsmith cd cloudsmith source bin/activate @@ -106,8 +109,6 @@ jobs: python3 -m pip install --upgrade pip pip3 install cloudsmith-cli - VERSION=$(dpkg-parsechangelog | sed -n 's/^Version: //p') - FILENAME="artifacts/${{ matrix.os }}/${{ matrix.version }}/libosal_${VERSION}_amd64.deb" cloudsmith push deb robert-burger-AdLL/libosal/${{ matrix.os }}/${{ matrix.version }} ${FILENAME} \ --republish \ --api-key "$CLOUDSMITH_API_KEY" From ed86d7842f80ee60a1377ca2bc8bdfad0a6412ee Mon Sep 17 00:00:00 2001 From: Robert Burger Date: Wed, 16 Jul 2025 08:12:26 +0200 Subject: [PATCH 74/80] fix: filename path --- .github/workflows/build-deb.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-deb.yaml b/.github/workflows/build-deb.yaml index 72aac11e..0267e952 100644 --- a/.github/workflows/build-deb.yaml +++ b/.github/workflows/build-deb.yaml @@ -109,7 +109,7 @@ jobs: python3 -m pip install --upgrade pip pip3 install cloudsmith-cli - cloudsmith push deb robert-burger-AdLL/libosal/${{ matrix.os }}/${{ matrix.version }} ${FILENAME} \ + cloudsmith push deb robert-burger-AdLL/libosal/${{ matrix.os }}/${{ matrix.version }} ../${FILENAME} \ --republish \ --api-key "$CLOUDSMITH_API_KEY" From e74c693bdede2212f6da112c9c089afca249354d Mon Sep 17 00:00:00 2001 From: Robert Burger Date: Thu, 10 Jul 2025 08:24:17 +0200 Subject: [PATCH 75/80] fix: return error code if pthread_setschedparam fails --- src/posix/task.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/posix/task.c b/src/posix/task.c index badf3fcf..ddf1d872 100644 --- a/src/posix/task.c +++ b/src/posix/task.c @@ -180,7 +180,6 @@ osal_retval_t osal_task_join(osal_task_t *hdl, osal_task_retval_t *retval) { int local_ret; local_ret = pthread_join(hdl->tid, retval); - (void)local_ret; if (local_ret != 0) { if (local_ret == EDEADLK) { @@ -384,7 +383,17 @@ osal_retval_t osal_task_set_policy(osal_task_t *hdl, osal_task_sched_policy_t po param.sched_priority = sched_get_priority_max(tmp_policy); } - (void)pthread_setschedparam(pthread_self(), tmp_policy, ¶m); + local_ret = pthread_setschedparam(pthread_self(), tmp_policy, ¶m); + + if (local_ret != 0) { + if ((local_ret == ESRCH) || (local_ret == EINVAL)) { + ret = OSAL_ERR_INVALID_PARAM; + } else if (local_ret == EPERM) { + ret = OSAL_ERR_PERMISSION_DENIED; + } else { + ret = OSAL_ERR_OPERATION_FAILED; + } + } } return ret; From bfe2f0d94f7604325e382800c6b98695d8bf0e6c Mon Sep 17 00:00:00 2001 From: Robert Burger Date: Thu, 10 Jul 2025 08:24:28 +0200 Subject: [PATCH 76/80] chore: add newline --- src/io.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/io.c b/src/io.c index e2d497f3..49d1d2e8 100644 --- a/src/io.c +++ b/src/io.c @@ -28,6 +28,7 @@ * along with libosal; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + #ifdef HAVE_CONFIG_H #include #endif From ce8a677384c38f2ab9c87cd1688f92a6b3529a16 Mon Sep 17 00:00:00 2001 From: Robert Burger Date: Wed, 16 Jul 2025 08:35:50 +0200 Subject: [PATCH 77/80] del: not needed github actions --- .github/workflows/build-tag.yaml | 22 ------ .github/workflows/cmake-multi-platform.yml | 86 ---------------------- 2 files changed, 108 deletions(-) delete mode 100644 .github/workflows/build-tag.yaml delete mode 100644 .github/workflows/cmake-multi-platform.yml diff --git a/.github/workflows/build-tag.yaml b/.github/workflows/build-tag.yaml deleted file mode 100644 index 4476f726..00000000 --- a/.github/workflows/build-tag.yaml +++ /dev/null @@ -1,22 +0,0 @@ -name: Build on Tag - -on: - push: - branches: - - 'ci/*' - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Set up build - run: echo "Building tag ${{ github.ref }}" - - # Beispiel: Build-Befehl ausführen - - name: Compile - run: | - make # oder dein Build-Befehl diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml deleted file mode 100644 index afde6c56..00000000 --- a/.github/workflows/cmake-multi-platform.yml +++ /dev/null @@ -1,86 +0,0 @@ -# This starter workflow is for a CMake project running on multiple platforms. There is a different starter workflow if you just want a single platform. -# See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-single-platform.yml -name: CMake on multiple platforms - -on: - push: - branches: [ "master" ] - pull_request: - branches: [ "*" ] - -jobs: - build: - runs-on: ${{ matrix.os }} - - strategy: - # Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable. - fail-fast: false - - # Set up a matrix to run the following 3 configurations: - # 1. - # 2. - # 3. - # - # To add more build types (Release, Debug, RelWithDebInfo, etc.) customize the build_type list. - matrix: - tag: [ 0.0.6, 0.0.5 ] - os: [ubuntu-latest, windows-latest] - build_type: [Release] - c_compiler: [gcc, clang, cl] - include: - - os: windows-latest - c_compiler: cl - cpp_compiler: cl - build_for_platform: WIN32 - - os: ubuntu-latest - c_compiler: gcc - cpp_compiler: g++ - build_for_platform: POSIX - - os: ubuntu-latest - c_compiler: clang - cpp_compiler: clang++ - build_for_platform: POSIX - exclude: - - os: windows-latest - c_compiler: gcc - - os: windows-latest - c_compiler: clang - - os: ubuntu-latest - c_compiler: cl - - steps: - - uses: actions/checkout@v3 - - - name: Set reusable strings - # Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file. - id: strings - shell: bash - run: | - echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" - - - name: Configure CMake - # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. - # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type - run: > - cmake -B ${{ steps.strings.outputs.build-output-dir }} - -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} - -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} - -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} - -DBUILD_FOR_PLATFORM="${{ matrix.build_for_platform }}" - -S ${{ github.workspace }} - - - name: Build - # Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). - run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} - - - name: Test - working-directory: ${{ steps.strings.outputs.build-output-dir }} - # Execute tests defined by the CMake configuration. Note that --build-config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). - # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail - run: ctest --build-config ${{ matrix.build_type }} - - - - uses: actions/upload-artifact@v4 - with: - path: build/*.tar.gz - name: libosal_${{ matrix.os }}_${{ matrix.configs }}.tar.gz From 650ab349300b16cee17e0d0b64eba570d1ed80be Mon Sep 17 00:00:00 2001 From: Robert Burger Date: Wed, 16 Jul 2025 08:59:21 +0200 Subject: [PATCH 78/80] update: debian info for homepage and vcs --- debian/control | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/debian/control b/debian/control index 3a8c09ef..85cee2c8 100644 --- a/debian/control +++ b/debian/control @@ -4,9 +4,9 @@ Maintainer: Robert Burger Build-Depends: debhelper-compat (= 13), autotools-dev Standards-Version: 4.5.1 Section: libs -Homepage: https://rmc-github.robotic.dlr.de/pages/common/libosal/master/index.html -Vcs-Browser: https://rmc-github.robotic.dlr.de/common/libosal -Vcs-Git: https://rmc-github.robotic.dlr.de/common/libosal.git +Homepage: https://www.burger-system.de/osal/osal +Vcs-Browser: https://github.com/robert-burger/libosal.git +Vcs-Git: https://github.com/robert-burger/libosal.git Rules-Requires-Root: no Package: libosal-dev From 062ace7a05d8d1a0736a5c2174861023022e3844 Mon Sep 17 00:00:00 2001 From: Robert Burger Date: Wed, 16 Jul 2025 09:50:56 +0200 Subject: [PATCH 79/80] add: devel package upload --- .github/workflows/build-deb.yaml | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-deb.yaml b/.github/workflows/build-deb.yaml index 0267e952..77342250 100644 --- a/.github/workflows/build-deb.yaml +++ b/.github/workflows/build-deb.yaml @@ -40,7 +40,7 @@ jobs: - name: Install build dependencies run: | apt-get update - apt-get install -y build-essential devscripts debhelper autotools-dev fakeroot sed git python3-pip python3-venv curl jq + apt-get install -y build-essential devscripts debhelper autotools-dev autoconf-archive fakeroot sed git python3-pip python3-venv curl jq - name: Checkout source uses: actions/checkout@v4 @@ -113,3 +113,26 @@ jobs: --republish \ --api-key "$CLOUDSMITH_API_KEY" + - name: Collect devel .deb artifact + run: | + mkdir -p artifacts/${{ matrix.os }}/${{ matrix.version }} + mv ../libosal-dev*.deb artifacts/${{ matrix.os }}/${{ matrix.version }} + + - name: Upload devel 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 }}/libosal-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 robert-burger-AdLL/libosal/${{ matrix.os }}/${{ matrix.version }} ../${FILENAME} \ + --republish \ + --api-key "$CLOUDSMITH_API_KEY" From 9fab6d7d0e0f72494040f5d6b4576184906f70b9 Mon Sep 17 00:00:00 2001 From: Robert Burger Date: Wed, 16 Jul 2025 10:12:12 +0200 Subject: [PATCH 80/80] change: cloudsmith repo to common --- .github/workflows/build-deb.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-deb.yaml b/.github/workflows/build-deb.yaml index 77342250..4072fc86 100644 --- a/.github/workflows/build-deb.yaml +++ b/.github/workflows/build-deb.yaml @@ -109,7 +109,7 @@ jobs: python3 -m pip install --upgrade pip pip3 install cloudsmith-cli - cloudsmith push deb robert-burger-AdLL/libosal/${{ matrix.os }}/${{ matrix.version }} ../${FILENAME} \ + cloudsmith push deb robert-burger-AdLL/common/${{ matrix.os }}/${{ matrix.version }} ../${FILENAME} \ --republish \ --api-key "$CLOUDSMITH_API_KEY" @@ -133,6 +133,6 @@ jobs: python3 -m pip install --upgrade pip pip3 install cloudsmith-cli - cloudsmith push deb robert-burger-AdLL/libosal/${{ matrix.os }}/${{ matrix.version }} ../${FILENAME} \ + cloudsmith push deb robert-burger-AdLL/common/${{ matrix.os }}/${{ matrix.version }} ../${FILENAME} \ --republish \ --api-key "$CLOUDSMITH_API_KEY"