Skip to content
Open
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
35 changes: 35 additions & 0 deletions .github/workflows/check-core-staging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Check core staging

on:
pull_request:
types: [opened, reopened, synchronize, ready_for_review]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
core-staging:
name: Core staging
runs-on: ubuntu-latest
permissions:
contents: read
packages: read
steps:
- uses: actions/checkout@v4

- uses: openDAQ/openDAQ-CI/.github/actions/resolve-channel@v3
id: channel

- name: Read the pinned core ref
shell: bash
run: echo "CORE_REF=$(cat opendaq_ref)" >> "$GITHUB_ENV"

- uses: openDAQ/openDAQ-CI/.github/actions/staging-check@v3
env:
CHANNEL: ${{ steps.channel.outputs.channel }}
with:
packages: >-
[
{ "path": "ghcr.io/openDAQ/$CHANNEL/staging/opendaq", "tag": "$CORE_REF" }
]
16 changes: 15 additions & 1 deletion .github/workflows/ci-downstream.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,22 @@ on:
jobs:
call-opendaq-reusable:
name: MQTT Streaming
uses: openDAQ/openDAQ-CI/.github/workflows/reusable.yml@v1
uses: openDAQ/openDAQ-CI/.github/workflows/reusable.yml@v3
with:
opendaq-ref: ${{ github.event.inputs.opendaq-ref || '' }}
include-jobs: >
[
"windows-2022-x86-msvs-v143-release",
"windows-2022-x86_64-msvs-v143-debug",
"ubuntu-20.04-x86-ninja-gcc-7-release",
"ubuntu-20.04-x86_64-ninja-clang-9-release",
"ubuntu-24.04-x86_64-ninja-gcc-14-debug",
"ubuntu-24.04-x86_64-ninja-gcc-14-release",
"ubuntu-24.04-x86_64-ninja-clang-18-release",
"macos-26-x86_64-ninja-appleclang-17-release",
"macos-26-x86_64-ninja-appleclang-17-debug",
"macos-26-armv8-ninja-appleclang-21-release"
]
packages: >
[
{
Expand All @@ -35,6 +48,7 @@ jobs:
cmake-presets: >
[
{
"match-jobs": ["*"],
"configure-preset": "module",
"test-preset": "module-test"
}
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/cleanup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Clean up stagings

on:
schedule:
- cron: '0 6 * * 1'
workflow_dispatch:
inputs:
dry-run:
description: "List what would be pruned without deleting."
type: boolean
default: false

jobs:
cleanup:
name: Stagings
permissions:
packages: write
uses: openDAQ/openDAQ-CI/.github/workflows/staging-cleanup.yml@v3
with:
dry-run: ${{ inputs.dry-run || false }}
staging-retentions: >-
[
{ "path": "ghcr.io/openDAQ/dev/staging/mqtt-module", "retention": { "days": 30 } }
]
112 changes: 112 additions & 0 deletions .github/workflows/stage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
name: Build MQTT module stagings

on:
push:
branches: [CI-staging]

schedule:
- cron: '0 2 * * 1'
workflow_dispatch:


jobs:
resolve:
name: Resolve the core commit
runs-on: ubuntu-latest
outputs:
core-ref: ${{ steps.core.outputs.ref }}
channel: ${{ steps.channel.outputs.channel }}
steps:
- uses: actions/checkout@v4

- uses: openDAQ/openDAQ-CI/.github/actions/resolve-channel@v3
id: channel

- name: Read the pinned core ref
id: core
shell: bash
run: echo "ref=$(cat opendaq_ref)" >> "$GITHUB_OUTPUT"

stage:
needs: resolve
name: MQTTModulesModern
permissions:
contents: read
packages: write
uses: openDAQ/openDAQ-CI/.github/workflows/stage.yml@v3
with:
timeout: '[{"timeout-minutes": 180}]'
staging-pull: >-
[
{ "artifact": "core-windows-2022-x86_64-msvs-v143-release", "packages": [{ "path": "ghcr.io/openDAQ/${{ needs.resolve.outputs.channel }}/staging/opendaq", "tag": "${{ needs.resolve.outputs.core-ref }}", "annotations": { "com.opendaq.custom.platform": "windows", "com.opendaq.settings.arch": "x86_64" } }] },
{ "artifact": "core-windows-2022-x86-msvs-v143-release", "packages": [{ "path": "ghcr.io/openDAQ/${{ needs.resolve.outputs.channel }}/staging/opendaq", "tag": "${{ needs.resolve.outputs.core-ref }}", "annotations": { "com.opendaq.custom.platform": "windows", "com.opendaq.settings.arch": "x86" } }] },
{ "artifact": "core-manylinux_2_28-x86_64-ninja-gcc-14-release", "packages": [{ "path": "ghcr.io/openDAQ/${{ needs.resolve.outputs.channel }}/staging/opendaq", "tag": "${{ needs.resolve.outputs.core-ref }}", "annotations": { "com.opendaq.custom.platform": "manylinux_2_28", "com.opendaq.settings.arch": "x86_64" } }] },
{ "artifact": "core-manylinux_2_28-armv8-ninja-gcc-14-release", "packages": [{ "path": "ghcr.io/openDAQ/${{ needs.resolve.outputs.channel }}/staging/opendaq", "tag": "${{ needs.resolve.outputs.core-ref }}", "annotations": { "com.opendaq.custom.platform": "manylinux_2_28", "com.opendaq.settings.arch": "armv8" } }] },
{ "artifact": "core-ubuntu-22.04-x86_64-ninja-gcc-release", "packages": [{ "path": "ghcr.io/openDAQ/${{ needs.resolve.outputs.channel }}/staging/opendaq", "tag": "${{ needs.resolve.outputs.core-ref }}", "annotations": { "com.opendaq.custom.platform": "linux", "com.opendaq.settings.arch": "x86_64" } }] },
{ "artifact": "core-ubuntu-22.04-armv8-ninja-gcc-release", "packages": [{ "path": "ghcr.io/openDAQ/${{ needs.resolve.outputs.channel }}/staging/opendaq", "tag": "${{ needs.resolve.outputs.core-ref }}", "annotations": { "com.opendaq.custom.platform": "linux", "com.opendaq.settings.arch": "armv8" } }] },
{ "artifact": "core-macos-26-x86_64-ninja-appleclang-21-release","packages": [{ "path": "ghcr.io/openDAQ/${{ needs.resolve.outputs.channel }}/staging/opendaq", "tag": "${{ needs.resolve.outputs.core-ref }}", "annotations": { "com.opendaq.custom.platform": "macos", "com.opendaq.settings.arch": "x86_64" } }] },
{ "artifact": "core-macos-26-armv8-ninja-appleclang-21-release", "packages": [{ "path": "ghcr.io/openDAQ/${{ needs.resolve.outputs.channel }}/staging/opendaq", "tag": "${{ needs.resolve.outputs.core-ref }}", "annotations": { "com.opendaq.custom.platform": "macos", "com.opendaq.settings.arch": "armv8" } }] }
]
include-jobs: >-
[
"windows-2022-x86_64-msvs-v143-release",
"windows-2022-x86-msvs-v143-release",
"manylinux_2_28-x86_64-ninja-gcc-14-release",
"manylinux_2_28-armv8-ninja-gcc-14-release",
"ubuntu-22.04-x86_64-ninja-gcc-release",
"ubuntu-22.04-armv8-ninja-gcc-release",
"macos-26-x86_64-ninja-appleclang-21-release",
"macos-26-armv8-ninja-appleclang-21-release"
]
packages: >-
[
{ "match-jobs": ["windows-2022-x86_64-msvs-v143-release"], "artifacts": [{ "name": "core-windows-2022-x86_64-msvs-v143-release", "dir": "staging-deps" }] },
{ "match-jobs": ["windows-2022-x86-msvs-v143-release"], "artifacts": [{ "name": "core-windows-2022-x86-msvs-v143-release", "dir": "staging-deps" }] },
{ "match-jobs": ["manylinux_2_28-x86_64-ninja-gcc-14-release"], "artifacts": [{ "name": "core-manylinux_2_28-x86_64-ninja-gcc-14-release", "dir": "staging-deps" }] },
{ "match-jobs": ["manylinux_2_28-armv8-ninja-gcc-14-release"], "artifacts": [{ "name": "core-manylinux_2_28-armv8-ninja-gcc-14-release", "dir": "staging-deps" }] },
{ "match-jobs": ["ubuntu-22.04-x86_64-ninja-gcc-release"], "artifacts": [{ "name": "core-ubuntu-22.04-x86_64-ninja-gcc-release", "dir": "staging-deps" }] },
{ "match-jobs": ["ubuntu-22.04-armv8-ninja-gcc-release"], "artifacts": [{ "name": "core-ubuntu-22.04-armv8-ninja-gcc-release", "dir": "staging-deps" }] },
{ "match-jobs": ["macos-26-x86_64-ninja-appleclang-21-release"],"artifacts": [{ "name": "core-macos-26-x86_64-ninja-appleclang-21-release", "dir": "staging-deps" }] },
{ "match-jobs": ["macos-26-armv8-ninja-appleclang-21-release"], "artifacts": [{ "name": "core-macos-26-armv8-ninja-appleclang-21-release", "dir": "staging-deps" }] },
{ "match-jobs": ["ubuntu-*"], "apt-install": ["libssl-dev"] },
{ "match-jobs": ["manylinux*"], "yum-install": ["openssl-devel"] },
{ "match-jobs": ["windows-*-x86-*"], "run": "vcpkg install openssl:x86-windows; Add-Content -Path $env:GITHUB_PATH -Value C:\\vcpkg\\installed\\x86-windows\\bin -Encoding utf8" }
]
cmake-presets: >-
[
{
"match-jobs": ["*"],
"configure-preset": "stage",
"cache-variables":
{
"CMAKE_PREFIX_PATH": "${sourceDir}/staging-deps;${sourceDir}/staging-deps/opt/opendaq"
}
},
{
"match-jobs": ["macos-*-x86_64-*"],
"cache-variables": {"CMAKE_OSX_DEPLOYMENT_TARGET": "10.15"}
},
{
"match-jobs": ["macos-*-armv8-*"],
"cache-variables": {"CMAKE_OSX_DEPLOYMENT_TARGET": "11.0"}
},
{
"match-jobs": ["windows-*-x86-*"],
"cache-variables": {"OPENSSL_ROOT_DIR": "C:/vcpkg/installed/x86-windows"}
}
]
cpack-presets: >-
[
{
"match-jobs": ["*"],
"stagings": [{"name": "mqtt"}]
}
]
staging-push: >-
[
{
"path": "ghcr.io/${{ github.repository_owner }}/${{ needs.resolve.outputs.channel }}/staging/mqtt-module",
"artifacts": ["staging-*/mqtt"],
"tags": ["latest"]
}
]
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ set(CMAKE_FOLDER "${CMAKE_FOLDER}/${REPO_NAME}")
list(APPEND CMAKE_MESSAGE_CONTEXT ${REPO_NAME})
add_subdirectory(cmake)

# Names the install components of the modules: openDAQ_<module>_Runtime / _Development
set(SDK_NAME "${OPENDAQ_SDK_NAME}")

opendaq_read_file_contents("${CMAKE_CURRENT_LIST_DIR}/module_version" module_version)
opendaq_get_version_major_minor_patch("${module_version}" ${REPO_OPTION_PREFIX}_VERSION)

Expand Down Expand Up @@ -92,6 +95,10 @@ add_subdirectory(external)
add_subdirectory(shared)
add_subdirectory(modules)

if (PROJECT_IS_TOP_LEVEL)
include(cmake/Packing.cmake)
endif()

if(${REPO_OPTION_PREFIX}_ENABLE_EXAMPLE_APP)
message(STATUS "Example applications in ${REPO_NAME} are ENABLED")
add_subdirectory(examples)
Expand Down
11 changes: 11 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,17 @@
"cacheVariables": {
"DAQMODULES_MQTT_ENABLE_TESTS": "ON"
}
},
{
"name": "stage",
"hidden": true,
"cacheVariables": {
"DAQMODULES_MQTT_ENABLE_TESTS": false,
"DAQMODULES_MQTT_ENABLE_EXAMPLE_APP": false,
"DAQMODULES_REF_DEVICE_MODULE": false,
"DAQMODULES_REF_FB_MODULE": false

}
}
],
"testPresets": [
Expand Down
57 changes: 57 additions & 0 deletions cmake/Packing.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
##
## CPack configuration for the MQTT module
##

set(CPACK_PACKAGE_NAME ${PROJECT_NAME})
set(CPACK_PACKAGE_VENDOR "openDAQ d.o.o.")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "openDAQ MQTT module")
set(CPACK_PACKAGE_HOMEPAGE_URL "https://opendaq.io/")
set(CPACK_PACKAGE_CONTACT "info@opendaq.io")
## set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")

set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR})
set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH})

set(CPACK_VERBATIM_VARIABLES ON)
set(CPACK_THREADS 0)

set(CPACK_GENERATOR TGZ)
set(CPACK_COMPONENTS_GROUPING ALL_COMPONENTS_IN_ONE)
set(CPACK_ARCHIVE_COMPONENT_INSTALL ON)

if(NOT CPACK_PACKAGE_DIRECTORY)
set(CPACK_PACKAGE_DIRECTORY "${CMAKE_SOURCE_DIR}/build/_packages")
endif()

if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
endif()

##
## Package filename and staging metadata
##
## Format: mqtt-module-<version>[-<sha>]-<arch>-<os>-<compiler>-<compiler-version>-<build-type>
## Composed by opendaq-cmake-utils, the same way core names its packages.
##

set(CPACK_OPENDAQ_META_PACKAGE_NAME "mqtt-module")

execute_process(COMMAND git -C "${CMAKE_CURRENT_SOURCE_DIR}" rev-parse --short=7 HEAD
OUTPUT_VARIABLE _PACKING_SHORT_SHA
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_QUIET
)
if(_PACKING_SHORT_SHA)
set(CPACK_OPENDAQ_META_PACKAGE_VERSION_SUFFIX "-${_PACKING_SHORT_SHA}")
endif()

opendaq_detect_settings()
opendaq_detect_package()
opendaq_compose_package_triplet()
opendaq_compose_package_file_name()

# Let each cpack run name the package it produces (-D CPACK_OPENDAQ_META_PACKAGE_NAME=...).
set(CPACK_PROJECT_CONFIG_FILE "${CPACK_OPENDAQ_PROJECT_CONFIG}")

include(CPack)
2 changes: 1 addition & 1 deletion opendaq_ref
Original file line number Diff line number Diff line change
@@ -1 +1 @@
47593806ee16fbd5ea6b19f1f32309b583bb9a52
60e3fad4954f7ffee25a0a6c8f168af51704e4c2
Loading