diff --git a/.devcontainer b/.devcontainer new file mode 160000 index 0000000..92bdede --- /dev/null +++ b/.devcontainer @@ -0,0 +1 @@ +Subproject commit 92bdede51d8073f85b4cb83da24a01f267ce0059 diff --git a/.github/workflows/xpbuild.yml b/.github/workflows/xpbuild.yml new file mode 100644 index 0000000..0a88aa8 --- /dev/null +++ b/.github/workflows/xpbuild.yml @@ -0,0 +1,19 @@ +name: Build +on: + push: + branches: [ "dev" ] + pull_request: + branches: [ "dev" ] + workflow_dispatch: +jobs: + linux: + permissions: + contents: read + pull-requests: write + packages: write + uses: externpro/externpro/.github/workflows/build-linux.yml@25.06.3 + with: + artifact-pattern: "${{ github.event.repository.name }}-*.rpm" + cmake-workflow-preset: LinuxRelease + buildpro-images: '["rocky9-gcc13"]' + secrets: inherit diff --git a/.github/workflows/xprelease.yml b/.github/workflows/xprelease.yml new file mode 100644 index 0000000..3fa36f6 --- /dev/null +++ b/.github/workflows/xprelease.yml @@ -0,0 +1,20 @@ +name: Release +on: + workflow_dispatch: + inputs: + workflow_run_url: + description: 'URL of the workflow run containing artifacts to upload (e.g., https://github.com/owner/repo/actions/runs/123456789)' + required: true + type: string +jobs: + # Upload build artifacts as release assets + release-from-build: + uses: externpro/externpro/.github/workflows/release-from-build.yml@25.06.3 + with: + workflow_run_url: ${{ github.event.inputs.workflow_run_url }} + artifact_pattern: "*.rpm" + permissions: + contents: write + id-token: write + attestations: write + secrets: inherit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4ec8e4d --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +# externpro +.env +_bld*/ +docker-compose.override.yml diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..18932ab --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule ".devcontainer"] + path = .devcontainer + url = https://github.com/externpro/externpro diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..0b0ea6e --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,30 @@ +cmake_minimum_required(VERSION 3.31) +set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Build configuration") +set(CMAKE_PROJECT_TOP_LEVEL_INCLUDES .devcontainer/cmake/xproinc.cmake) +project(cmake-pkg VERSION 3.31.6 LANGUAGES CXX) +# https://github.com/Kitware/CMake/releases/tag/v3.31.6 +# https://github.com/Kitware/CMake/releases/download/v3.31.6/cmake-3.31.6-linux-x86_64.tar.gz +# https://github.com/Kitware/CMake/releases/download/v3.31.6/cmake-3.31.6-linux-aarch64.tar.gz +set(sha_aarch64 b4cc788d63112b2749b40627e719eb5d3b8ed8f00c36d77189f4019cfe64bc9e) +set(sha_x86_64 5a1133ff103c71eb5120e2cc3de922733e7d8a26a98ae716397e8676adb367bf) +set(REPO https://github.com/Kitware/CMake) +string(TOLOWER ${CMAKE_SYSTEM_NAME} os) +if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(x86_64|amd64|AMD64)$") + set(arch "x86_64") +elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64|arm64|ARM64)$") + set(arch "aarch64") +endif() +set(url ${REPO}/releases/download/v${PROJECT_VERSION}/cmake-${PROJECT_VERSION}-${os}-${arch}.tar.gz) +set(opt DOWNLOAD_EXTRACT_TIMESTAMP true) +include(FetchContent) +FetchContent_Declare(cmake ${opt} URL ${url} URL_HASH SHA256=${sha_${arch}}) +FetchContent_MakeAvailable(cmake) +install(DIRECTORY ${cmake_SOURCE_DIR}/ DESTINATION . USE_SOURCE_PERMISSIONS) +set(CPACK_GENERATOR RPM) +set(CPACK_RPM_PACKAGE_ARCHITECTURE ${arch}) +# https://github.com/externpro/externpro/issues/53 +set(CPACK_RPM_SPEC_MORE_DEFINE "%define _build_id_links none") +set(CPACK_PACKAGING_INSTALL_PREFIX "/usr/local") +set(CPACK_PACKAGE_VERSION v${PROJECT_VERSION}) +set(CPACK_SYSTEM_NAME ${os}-${arch}) +include(CPack) diff --git a/CMakePresets.json b/CMakePresets.json new file mode 100644 index 0000000..621cce6 --- /dev/null +++ b/CMakePresets.json @@ -0,0 +1,6 @@ +{ + "version": 8, + "include": [ + ".devcontainer/cmake/presets/xpLinuxNinja.json" + ] +} diff --git a/CMakePresetsBase.json b/CMakePresetsBase.json new file mode 100644 index 0000000..085cdc3 --- /dev/null +++ b/CMakePresetsBase.json @@ -0,0 +1,16 @@ +{ + "version": 8, + "configurePresets": [ + { + "name": "config-base", + "hidden": true, + "binaryDir": "${sourceDir}/_bld-${presetName}" + } + ], + "buildPresets": [ + { + "name": "build-base", + "hidden": true + } + ] +} diff --git a/docker-compose.sh b/docker-compose.sh new file mode 120000 index 0000000..85f182f --- /dev/null +++ b/docker-compose.sh @@ -0,0 +1 @@ +.devcontainer/compose.pro.sh \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 120000 index 0000000..46c1f89 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1 @@ +.devcontainer/compose.bld.yml \ No newline at end of file