Skip to content

Commit e85f149

Browse files
-added self-contained release configuration;
1 parent 929685b commit e85f149

File tree

13 files changed

+324
-10
lines changed

13 files changed

+324
-10
lines changed

.github/workflows/release.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: release
2+
3+
on:
4+
push:
5+
tags: [ "v*" ]
6+
7+
jobs:
8+
build:
9+
name: Publish release
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Install ninja (Linux)
13+
run: sudo apt install ninja-build
14+
- uses: actions/checkout@v4
15+
- uses: rui314/setup-mold@v1
16+
- uses: hendrikmuhs/ccache-action@v1.2
17+
- name: Configure CMake to download dependencies
18+
run: cmake -B build --preset="clang-release"
19+
- name: Create release package
20+
run: release_pack/release.sh
21+
- name: Build unit tests with release package
22+
working-directory: tests
23+
run: |
24+
cp -r ../release .
25+
cp release/seal_lake.cmake .
26+
cp release/CPM.cmake .
27+
cmake -B build -DCMAKE_BUILD_TYPE=Release -DFIGCONE_TEST_RELEASE=ON
28+
cmake --build build
29+
- name: Run unit tests
30+
working-directory: tests/build
31+
run: ./test_figcone
32+
- name: Build unit tests (C++20) with release package
33+
working-directory: tests_cpp20
34+
run: |
35+
cp -r ../release .
36+
cp release/seal_lake.cmake .
37+
cp release/CPM.cmake .
38+
cmake -B build -DCMAKE_BUILD_TYPE=Release -DFIGCONE_TEST_RELEASE=ON
39+
cmake --build build
40+
- name: Run unit tests (C++20)
41+
working-directory: tests_cpp20/build
42+
run: ./test_figcone_cpp20
43+
- name: Build unit tests (C++20, static reflection) with release package
44+
working-directory: tests_static_refl
45+
run: |
46+
cp -r ../release .
47+
cp release/seal_lake.cmake .
48+
cp release/CPM.cmake .
49+
cmake -B build -DCMAKE_BUILD_TYPE=Release -DFIGCONE_TEST_RELEASE=ON
50+
cmake --build build
51+
- name: Run unit tests (C++20, static reflection)
52+
working-directory: tests_static_refl/build
53+
run: ./test_figcone_static_refl
54+
- name: Archive release artifacts
55+
working-directory: tests
56+
run: |
57+
mv release figcone-${{ github.ref_name }}
58+
zip -r figcone-${{ github.ref_name }}.zip figcone-${{ github.ref_name }}
59+
- name: Upload release
60+
uses: softprops/action-gh-release@v1
61+
with:
62+
files: |
63+
tests/figcone-${{ github.ref_name }}.zip
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: check version consistency
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: [ "master", "dev" ]
7+
paths-ignore:
8+
- '**.md'
9+
pull_request:
10+
branches: [ "master", "dev" ]
11+
paths-ignore:
12+
- '**.md'
13+
14+
jobs:
15+
version-check:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v4
20+
21+
- name: Check version consistency
22+
run: |
23+
PROJECT_VERSION=$(grep -Po 'project\([^)]*VERSION\s+\K[0-9]+\.[0-9]+\.[0-9]+' CMakeLists.txt)
24+
RELEASE_VERSION=$(grep -Po 'project\([^)]*VERSION\s+\K[0-9]+\.[0-9]+\.[0-9]+' release_pack/CMakeLists.txt)
25+
26+
if [ "$PROJECT_VERSION" != "$RELEASE_VERSION" ]; then
27+
echo "Error: Version mismatch between CMakeLists.txt ($PROJECT_VERSION) and release_pack/CMakeLists.txt ($RELEASE_VERSION)"
28+
exit 1
29+
fi
30+
- name: Check GIT_TAG format
31+
run: |
32+
FILES=$(find . -name CMakeLists.txt)
33+
BAD_TAGS=0
34+
35+
echo "Checking GIT_TAG semantic version format..."
36+
37+
for FILE in $FILES; do
38+
TAGS=$(grep -Po 'GIT_TAG\s+["'\'']?\K[^"'\''\s)]+' "$FILE" || true)
39+
for TAG in $TAGS; do
40+
if ! [[ "$TAG" =~ ^v?[0-9]+\.[0-9]+\.[0-9]+([-._][A-Za-z0-9]+)*$ ]]; then
41+
echo "Error: [file=$FILE] GIT_TAG '$TAG' does not start with a valid semantic version (e.g., 1.2.3, v1.2.3)"
42+
BAD_TAGS=1
43+
fi
44+
done
45+
done
46+
47+
if [ "$BAD_TAGS" -ne 0 ]; then
48+
echo "Error: One or more GIT_TAG values don't start with a valid semantic version."
49+
exit 1
50+
else
51+
echo "All GIT_TAG values start with valid semantic versions."
52+
fi

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ SealLake_v040_IsInstallEnabled(INSTALL_FIGCONE_TREE)
66
SealLake_v040_Import(
77
figcone_tree 2.2.0
88
GIT_REPOSITORY https://github.com/kamchatka-volcano/figcone_tree.git
9-
GIT_TAG dev
9+
GIT_TAG v2.2.0
1010
)
1111

1212
option(FIGCONE_USE_NAMEOF "Enable automatic registration of struct field names using the nameof library" ON)

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1151,8 +1151,7 @@ cmake_minimum_required(VERSION 3.14)
11511151
11521152
include(FetchContent)
11531153
FetchContent_Declare(figcone
1154-
GIT_REPOSITORY "https://github.com/kamchatka-volcano/figcone.git"
1155-
GIT_TAG "origin/master"
1154+
URL https://github.com/kamchatka-volcano/figcone/releases/download/v3.3.0/figcone-v3.3.0.zip
11561155
)
11571156
#uncomment if you need to install figcone with your target
11581157
#set(INSTALL_FIGCONE ON)
@@ -1162,6 +1161,9 @@ add_executable(${PROJECT_NAME})
11621161
target_link_libraries(${PROJECT_NAME} PRIVATE figcone::figcone)
11631162
```
11641163

1164+
Prefer using the release ZIP archive with FetchContent, as it is fully self-contained and avoids spending additional
1165+
time downloading the library dependencies during the CMake configuration step.
1166+
11651167
By default `figcone` fetches all supported configuration format libraries. You can control this with CMake option `FIGCONE_USE_ALL`. You can also enable support for a single configuration format or a combination of formats by setting the following options:
11661168
* `FIGCONE_USE_JSON` - fetches and configures the `figcone_json` library;
11671169
* `FIGCONE_USE_YAML` - fetches and configures the `figcone_yaml` library;
@@ -1181,7 +1183,7 @@ cmake --install build
11811183

11821184
After installation, you can use the `find_package()` command to make the installed library available inside your project:
11831185
```
1184-
find_package(figcone 2.0.0 REQUIRED)
1186+
find_package(figcone 3.3.0 REQUIRED)
11851187
target_link_libraries(${PROJECT_NAME} PRIVATE figcone::figcone)
11861188
```
11871189

formats/CMakeLists.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ if(FIGCONE_USE_ALL OR FIGCONE_USE_JSON)
1717
SealLake_v040_Import(
1818
figcone_json 1.2.0
1919
GIT_REPOSITORY https://github.com/kamchatka-volcano/figcone_json.git
20-
GIT_TAG v1.2.0-beta
20+
GIT_TAG v1.2.0
2121
)
2222
SealLake_v040_Copy(
2323
WILDCARDS ${figcone_json_SOURCE_DIR}/include/figcone_json/*
@@ -29,7 +29,7 @@ if(FIGCONE_USE_ALL OR FIGCONE_USE_YAML)
2929
SealLake_v040_Import(
3030
figcone_yaml 1.2.0
3131
GIT_REPOSITORY https://github.com/kamchatka-volcano/figcone_yaml.git
32-
GIT_TAG v1.2.0-beta
32+
GIT_TAG v1.2.0
3333
)
3434
SealLake_v040_Copy(
3535
WILDCARDS ${figcone_yaml_SOURCE_DIR}/include/figcone_yaml/*
@@ -41,7 +41,7 @@ if(FIGCONE_USE_ALL OR FIGCONE_USE_TOML)
4141
SealLake_v040_Import(
4242
figcone_toml 1.2.0
4343
GIT_REPOSITORY https://github.com/kamchatka-volcano/figcone_toml.git
44-
GIT_TAG v1.2.0-beta
44+
GIT_TAG v1.2.0
4545
)
4646
SealLake_v040_Copy(
4747
WILDCARDS ${figcone_toml_SOURCE_DIR}/include/figcone_toml/*
@@ -53,7 +53,7 @@ if(FIGCONE_USE_ALL OR FIGCONE_USE_INI)
5353
SealLake_v040_Import(
5454
figcone_ini 1.2.0
5555
GIT_REPOSITORY https://github.com/kamchatka-volcano/figcone_ini.git
56-
GIT_TAG v1.2.0-beta
56+
GIT_TAG v1.2.0
5757
)
5858
SealLake_v040_Copy(
5959
WILDCARDS ${figcone_ini_SOURCE_DIR}/include/figcone_ini/*
@@ -66,7 +66,7 @@ if(FIGCONE_USE_ALL OR FIGCONE_USE_XML)
6666
SealLake_v040_Import(
6767
figcone_xml 1.3.0
6868
GIT_REPOSITORY https://github.com/kamchatka-volcano/figcone_xml.git
69-
GIT_TAG v1.3.0-beta
69+
GIT_TAG v1.3.0
7070
)
7171
SealLake_v040_Copy(
7272
WILDCARDS ${figcone_xml_SOURCE_DIR}/include/figcone_xml/*
@@ -78,7 +78,7 @@ if(FIGCONE_USE_ALL OR FIGCONE_USE_SHOAL)
7878
SealLake_v040_Import(
7979
figcone_shoal 1.2.0
8080
GIT_REPOSITORY https://github.com/kamchatka-volcano/figcone_shoal.git
81-
GIT_TAG v1.2.0-beta
81+
GIT_TAG v1.2.0
8282
)
8383
SealLake_v040_Copy(
8484
WILDCARDS ${figcone_shoal_SOURCE_DIR}/include/figcone_shoal/*

release_pack/CMakeLists.txt

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
cmake_minimum_required(VERSION 3.18)
2+
project(figcone VERSION 3.3.0)
3+
include(${CMAKE_CURRENT_LIST_DIR}/seal_lake.cmake)
4+
5+
SealLake_v040_IsInstallEnabled(INSTALL_FIGCONE_TREE)
6+
find_package(figcone_tree 2.2.0 QUIET)
7+
if (NOT TARGET figcone::figcone_tree)
8+
add_subdirectory(deps/figcone_tree)
9+
endif ()
10+
11+
SealLake_v040_IsInstallEnabled(INSTALL_FIGCONE_FORMATS)
12+
add_subdirectory(formats)
13+
14+
if (FIGCONE_USE_NAMEOF AND CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
15+
set(CPP_STANDARD_FEATURE cxx_std_20)
16+
else ()
17+
set(CPP_STANDARD_FEATURE cxx_std_17)
18+
endif ()
19+
20+
SealLake_v040_HeaderOnlyLibrary(
21+
COMPILE_FEATURES ${CPP_STANDARD_FEATURE}
22+
LIBRARIES
23+
figcone::figcone_tree
24+
DEPENDENCIES
25+
figcone_tree 2.2.0
26+
)
27+
28+
if (FIGCONE_USE_ALL OR FIGCONE_USE_JSON OR FIGCONE_USE_YAML OR FIGCONE_USE_TOML OR FIGCONE_USE_INI OR FIGCONE_USE_XML OR FIGCONE_USE_SHOAL)
29+
SealLake_v040_AddLibraries(
30+
figcone::figcone_formats
31+
)
32+
SealLake_v040_AddDependencies(
33+
figcone_formats 1.3.0
34+
)
35+
endif ()
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
cmake_minimum_required(VERSION 3.18)
2+
3+
project(figcone_formats_deps)
4+
include(seal_lake.cmake)
5+
6+
SealLake_v040_Bundle(
7+
NAME figcone_tree
8+
URL https://github.com/kamchatka-volcano/figcone_tree/releases/download/v2.2.0/figcone_tree-v2.2.0.zip
9+
SKIP_LOAD
10+
DESTINATION deps/figcone_tree
11+
)
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
cmake_minimum_required(VERSION 3.18)
2+
3+
project(figcone_formats_deps)
4+
include(seal_lake.cmake)
5+
6+
SealLake_v040_Bundle(
7+
NAME figcone_json
8+
URL https://github.com/kamchatka-volcano/figcone_json/releases/download/v1.2.0/figcone_json-v1.2.0.zip
9+
SKIP_LOAD
10+
DESTINATION deps/figcone_json
11+
)
12+
SealLake_v040_Bundle(
13+
NAME figcone_yaml
14+
URL https://github.com/kamchatka-volcano/figcone_yaml/releases/download/v1.2.0/figcone_yaml-v1.2.0.zip
15+
SKIP_LOAD
16+
DESTINATION deps/figcone_yaml
17+
)
18+
SealLake_v040_Bundle(
19+
NAME figcone_toml
20+
URL https://github.com/kamchatka-volcano/figcone_toml/releases/download/v1.2.0/figcone_toml-v1.2.0.zip
21+
SKIP_LOAD
22+
DESTINATION deps/figcone_toml
23+
)
24+
SealLake_v040_Bundle(
25+
NAME figcone_ini
26+
URL https://github.com/kamchatka-volcano/figcone_ini/releases/download/v1.2.0/figcone_ini-v1.2.0.zip
27+
SKIP_LOAD
28+
DESTINATION deps/figcone_ini
29+
)
30+
SealLake_v040_Bundle(
31+
NAME figcone_xml
32+
URL https://github.com/kamchatka-volcano/figcone_xml/releases/download/v1.3.0/figcone_xml-v1.3.0.zip
33+
SKIP_LOAD
34+
DESTINATION deps/figcone_xml
35+
)
36+
SealLake_v040_Bundle(
37+
NAME figcone_shoal
38+
URL https://github.com/kamchatka-volcano/figcone_shoal/releases/download/v1.2.0/figcone_shoal-v1.2.0.zip
39+
SKIP_LOAD
40+
DESTINATION deps/figcone_shoal
41+
)
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
project(figcone_formats VERSION 1.3.0)
2+
3+
option(FIGCONE_USE_ALL "Enable all supported config formats" ON)
4+
option(FIGCONE_USE_JSON "Enable JSON config format" OFF)
5+
option(FIGCONE_USE_YAML "Enable YAML config format" OFF)
6+
option(FIGCONE_USE_TOML "Enable TOML config format" OFF)
7+
option(FIGCONE_USE_INI "Enable INI config format" OFF)
8+
option(FIGCONE_USE_XML "Enable XML config format" OFF)
9+
option(FIGCONE_USE_SHOAL "Enable shoal config format" OFF)
10+
if (FIGCONE_USE_JSON OR FIGCONE_USE_YAML OR FIGCONE_USE_TOML OR FIGCONE_USE_INI OR FIGCONE_USE_XML OR FIGCONE_USE_SHOAL)
11+
set(FIGCONE_USE_ALL OFF)
12+
endif ()
13+
14+
if (FIGCONE_USE_ALL OR FIGCONE_USE_JSON)
15+
add_subdirectory(deps/figcone_json)
16+
endif ()
17+
18+
if (FIGCONE_USE_ALL OR FIGCONE_USE_YAML)
19+
add_subdirectory(deps/figcone_yaml)
20+
endif ()
21+
22+
if (FIGCONE_USE_ALL OR FIGCONE_USE_TOML)
23+
add_subdirectory(deps/figcone_toml)
24+
endif ()
25+
26+
if (FIGCONE_USE_ALL OR FIGCONE_USE_INI)
27+
add_subdirectory(deps/figcone_ini)
28+
endif ()
29+
30+
if (FIGCONE_USE_ALL OR FIGCONE_USE_XML)
31+
add_subdirectory(deps/figcone_xml)
32+
endif ()
33+
34+
if (FIGCONE_USE_ALL OR FIGCONE_USE_SHOAL)
35+
add_subdirectory(deps/figcone_shoal)
36+
endif ()
37+
38+
if (FIGCONE_USE_ALL OR FIGCONE_USE_JSON OR FIGCONE_USE_YAML OR FIGCONE_USE_TOML OR FIGCONE_USE_INI OR FIGCONE_USE_XML OR FIGCONE_USE_SHOAL)
39+
SealLake_v040_StaticLibrary(
40+
NAMESPACE figcone
41+
COMPILE_FEATURES
42+
cxx_std_17
43+
INTERFACE_LIBRARIES
44+
figcone::figcone_tree
45+
DEPENDENCIES
46+
figcone_tree 2.2.0
47+
)
48+
endif ()
49+
50+
if (FIGCONE_USE_ALL OR FIGCONE_USE_JSON)
51+
SealLake_v040_AddLibraries(figcone::figcone_json)
52+
endif ()
53+
if (FIGCONE_USE_ALL OR FIGCONE_USE_INI)
54+
SealLake_v040_AddLibraries(figcone::figcone_ini)
55+
endif ()
56+
if (FIGCONE_USE_ALL OR FIGCONE_USE_SHOAL)
57+
SealLake_v040_AddLibraries(figcone::figcone_shoal)
58+
endif ()
59+
if (FIGCONE_USE_ALL OR FIGCONE_USE_TOML)
60+
SealLake_v040_AddLibraries(figcone::figcone_toml)
61+
endif ()
62+
if (FIGCONE_USE_ALL OR FIGCONE_USE_XML)
63+
SealLake_v040_AddLibraries(figcone::figcone_xml)
64+
endif ()
65+
if (FIGCONE_USE_ALL OR FIGCONE_USE_YAML)
66+
SealLake_v040_AddLibraries(figcone::figcone_yaml)
67+
endif ()

0 commit comments

Comments
 (0)