Skip to content

Commit be33193

Browse files
author
J. Cappelletto
committed
Merge branch 'release/0.7.1'
Include full DEB installer generator
2 parents 388f05d + c5d7b1c commit be33193

File tree

7 files changed

+96
-78
lines changed

7 files changed

+96
-78
lines changed

.github/workflows/ci.yml

Lines changed: 56 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ concurrency:
1212
group: ${{ github.workflow }}-${{ github.ref }}
1313
cancel-in-progress: true
1414

15+
permissions:
16+
contents: write
1517
jobs:
1618
build-test:
1719
strategy:
@@ -40,7 +42,8 @@ jobs:
4042
libopencv-dev \
4143
doxygen graphviz \
4244
libyaml-cpp-dev \
43-
ccache
45+
ccache \
46+
dpkg-dev fakeroot
4447
4548
- name: Enable ccache (Ubuntu)
4649
if: matrix.os == 'ubuntu-latest'
@@ -99,7 +102,17 @@ jobs:
99102
echo "VCPKG_TARGET_TRIPLET=x64-windows" >> $env:GITHUB_ENV
100103
echo "VCPKG_HOST_TRIPLET=x64-windows" >> $env:GITHUB_ENV
101104
102-
# -------- Configure --------
105+
# Tag inference mechanism
106+
- name: Derive version from tag (or fallback)
107+
shell: bash
108+
run: |
109+
if [[ "${GITHUB_REF}" == refs/tags/v* ]]; then
110+
echo "PKG_VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_ENV
111+
else
112+
echo "PKG_VERSION=${{ env.BUILD_TYPE }}-snapshot" >> $GITHUB_ENV
113+
fi
114+
115+
# -------- Configure --------
103116
- name: Configure (CMake)
104117
shell: pwsh
105118
run: |
@@ -108,6 +121,7 @@ jobs:
108121
"-G", "Ninja",
109122
"-DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }}",
110123
"-DBUILD_TESTS=ON",
124+
"-DPROJECT_VERSION=${{ env.PKG_VERSION }}",
111125
"-DCMAKE_RUNTIME_OUTPUT_DIRECTORY=build/bin",
112126
"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=build/lib",
113127
"-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY=build/lib"
@@ -150,14 +164,6 @@ jobs:
150164
if-no-files-found: ignore
151165
retention-days: 30
152166

153-
# -------- Package (CPack) --------
154-
# - name: CPack (package binaries)
155-
# if: (github.ref == 'refs/heads/master') || startsWith(github.ref, 'refs/tags/v')
156-
# working-directory: build
157-
# run: |
158-
# cpack -G ZIP
159-
# cpack -G TGZ
160-
161167
# -------- Package (CPack via CMake target) --------
162168
- name: Package (CPack)
163169
if: (github.ref == 'refs/heads/master') || startsWith(github.ref, 'refs/tags/v')
@@ -176,9 +182,10 @@ jobs:
176182
build/bin/**/*.pdb
177183
build/lib/**/*.lib
178184
build/*.zip
179-
retention-days: 30
185+
build/*.tar.gz
186+
retention-days: 14
180187

181-
- name: Upload artifacts (Linux TGZ)
188+
- name: Upload artifacts (Linux packages)
182189
if: (matrix.os == 'ubuntu-latest') && ((github.ref == 'refs/heads/master') || startsWith(github.ref, 'refs/tags/v'))
183190
uses: actions/upload-artifact@v4
184191
with:
@@ -187,4 +194,41 @@ jobs:
187194
build/bin/videostrip_cli
188195
build/lib/**/*.a
189196
build/*.tar.gz
197+
build/*.deb
190198
retention-days: 14
199+
200+
release:
201+
if: startsWith(github.ref, 'refs/tags/v') # only on tag like v0.7.0
202+
needs: [ build-test ] # wait for matrix to finish
203+
runs-on: ubuntu-latest
204+
205+
steps:
206+
- name: Download Windows artifacts
207+
uses: actions/download-artifact@v4
208+
with:
209+
name: videostrip-windows-Release
210+
path: artifacts/windows
211+
212+
- name: Download Linux artifacts
213+
uses: actions/download-artifact@v4
214+
with:
215+
name: videostrip-linux-Release
216+
path: artifacts/linux
217+
218+
- name: List files
219+
run: find artifacts -type f -maxdepth 3 -printf "%p\n"
220+
221+
- name: Publish GitHub Release
222+
uses: softprops/action-gh-release@v2
223+
with:
224+
tag_name: ${{ github.ref_name }}
225+
name: ${{ github.ref_name }}
226+
draft: false
227+
prerelease: false
228+
files: |
229+
artifacts/windows/*.zip
230+
artifacts/windows/*.tar.gz
231+
artifacts/linux/*.tar.gz
232+
artifacts/linux/*.deb
233+
env:
234+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
.vscode/*
22

3+
next_steps.md
4+
35
# Doxygen
46
doc/html/*
57
doc/latex/*

CMakeLists.txt

Lines changed: 34 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
cmake_minimum_required(VERSION 3.18)
2-
project(videostrip VERSION 0.7.0 LANGUAGES CXX)
2+
project(videostrip VERSION 0.7.1 LANGUAGES CXX)
33

44
set(CMAKE_CXX_STANDARD 17)
55
set(CMAKE_CXX_STANDARD_REQUIRED ON)
@@ -137,36 +137,58 @@ install(TARGETS videostrip_core
137137
LIBRARY DESTINATION lib
138138
)
139139

140+
# TODO: Minimal manpage (optional). We do not have one yet, generate with help2man later.
141+
# install(FILES packaging/videostrip.1 DESTINATION share/man/man1)
142+
140143
# Public headers (install only .hpp files from videostrip_core/)
141-
# If your headers live in subdirs (feature/, logging/), this will include them.
144+
# If the headers live in subdirs (feature/, logging/), this will include them.
142145
install(DIRECTORY ${CMAKE_SOURCE_DIR}/videostrip_core/
143146
DESTINATION include/videostrip_core
144-
FILES_MATCHING
145-
PATTERN "*.hpp"
147+
FILES_MATCHING PATTERN "*.hpp"
146148
)
147149

150+
# Install shared assets
151+
install(FILES configs/sample_config.yaml
152+
DESTINATION share/videostrip)
148153
# Licenses / docs
149154
install(FILES ${CMAKE_SOURCE_DIR}/README.md ${CMAKE_SOURCE_DIR}/LICENSE
150-
DESTINATION .
155+
DESTINATION share/doc/videostrip
151156
)
152157

153158
# -------------------------
154159
# CPack configuration
155160
# -------------------------
161+
156162
set(CPACK_PACKAGE_NAME "videostrip")
157-
set(CPACK_PACKAGE_VENDOR "cappelletto")
163+
set(CPACK_PACKAGE_VENDOR "Rivermouth")
164+
set(CPACK_PACKAGE_CONTACT "[email protected]")
165+
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Video transect utilities for 2D/3D mapping (CLI)")
158166
set(CPACK_PACKAGE_VERSION "${PROJECT_VERSION}")
159-
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Smart video frame extraction for 2D/3D reconstruction pipelines")
160167
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE")
161168
set(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/README.md")
162-
163169
# Nice archive base name: videostrip-0.7.0-Linux-x86_64, etc.
164170
string(TOLOWER "${CMAKE_SYSTEM_NAME}" _sysname_lc)
165171
set(CPACK_PACKAGE_FILE_NAME
166172
"${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}"
167173
)
168174

169-
# Generators we use in CI
170-
set(CPACK_GENERATOR "ZIP;TGZ")
171-
172-
include(CPack)
175+
# Source + binary archives
176+
set(CPACK_GENERATOR "TGZ;ZIP;DEB")
177+
178+
# Debian metadata (tune as you learn your shared libs)
179+
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Jose Cappelletto") # required
180+
set(CPACK_DEBIAN_PACKAGE_SECTION "science")
181+
set(CPACK_DEBIAN_ARCHITECTURE ${CMAKE_SYSTEM_PROCESSOR})
182+
183+
# Runtime deps if linking dynamically; keep minimal first, then refine with ldd
184+
# Example:
185+
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libstdc++6, libgcc-s1")
186+
# TODO:
187+
# Add correct libraries from OpenCV
188+
# set(CPACK_DEBIAN_PACKAGE_DEPENDS "libopencv-core4.8, libopencv-imgcodecs4.8")
189+
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
190+
# Avoid the classic error: ensure CPack knows the project
191+
set(CPACK_PACKAGE_FILE_NAME "videostrip-${PROJECT_VERSION}-${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}")
192+
193+
include(CPack)
194+
# End of CPack configuration

tests/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ FetchContent_MakeAvailable(Catch2)
1515
include(Catch) # provides catch_discover_tests()
1616

1717
# ---- Common includes for tests (allow <videostrip_core/...> etc.) ----
18-
# Adjust if you need stricter scoping:
18+
# Adjust if we need stricter scoping:
1919
set(TEST_COMMON_INCLUDES
2020
${CMAKE_SOURCE_DIR}
2121
)
@@ -82,7 +82,7 @@ if (EXISTS ${CONFIG_YAML_SRC})
8282
catch_discover_tests(test_config_yaml
8383
WORKING_DIRECTORY $<TARGET_FILE_DIR:test_config_yaml>
8484
)
85-
# Optional explicit CTest name, if you kept add_test() elsewhere:
85+
# Optional explicit CTest name
8686
add_test(NAME config_yaml COMMAND test_config_yaml)
8787
endif()
8888
else()

tests/test_core_smoke.cpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#include <fstream>
44
#include <opencv2/opencv.hpp>
55

6-
#include <videostrip_core/videostrip_core.hpp> // your public API
6+
#include <videostrip_core/videostrip_core.hpp> // the public API
77
#include <videostrip_core/feature/feature_extractor.hpp> // used indirectly
88
#include <videostrip_core/logging/logger.hpp> // ConsoleLogger
99

@@ -24,13 +24,6 @@ static fs::path make_tmp_dir(const std::string& name) {
2424
return base;
2525
}
2626

27-
28-
// static fs::path make_tmp_dir(const std::string& name) {
29-
// auto base = fs::temp_directory_path() / ("vs_" + name + "_" + std::to_string(::getpid()));
30-
// fs::create_directories(base);
31-
// return base;
32-
// }
33-
3427
TEST_CASE("core: synthetic video to images + CSV + YAML", "[core][smoke]") {
3528
// --- 1) Make synthetic video (20 frames @ 10 fps) ---
3629
const int W=320, H=240, FPS=10, N=20;

videostrip_cli/config_loader.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ void normalize_output_paths(ExtractorConfig& cfg, const std::string& base_dir);
3434
/**
3535
* @brief Merge precedence helper: dst = YAML ; then apply CLI overrides.
3636
* Only overwrites fields when src has non-empty values / set flags.
37-
* (You still need to clamp/validate after merging.)
37+
* (Still need to clamp/validate after merging.)
3838
*/
3939
void merge_yaml_into(ExtractorConfig& dst, const ExtractorConfig& yamlCfg);
4040

videostrip_gui/videostrip-gui.cpp

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -39,49 +39,6 @@ using namespace vs;
3939

4040
int main(int argc, char *argv[])
4141
{
42-
vs::vsGui gui;
43-
vs::VideoFile video;
4442

45-
int retval = gui.Init();; // OpenGL context setup
46-
if (retval) {
47-
vs::logc.error("main", "OpenGL + imgui context setup failed");
48-
return retval;
49-
}
50-
51-
// Our state
52-
ImGui::SetNextWindowSize(ImVec2(750,400));
53-
// Main loop
54-
55-
// let's populate with some data for testing purposes
56-
if (video.peekFile("/home/cappelletto/Videos/fran01.mp4") == -1) {
57-
vs::logc.error("main", "Video file peek failed");
58-
return -1;
59-
}
60-
else{
61-
vs::logc.info("main", "Video file peek success");
62-
}
63-
64-
static bool window_flag = true;
65-
while (!gui.ShouldClose() && window_flag)
66-
{
67-
// Poll and handle events (inputs, window resize, etc.)
68-
// You can read the io.WantCaptureMouse, io.WantCaptureKeyboard flags to tell if dear imgui wants to use your inputs.
69-
// - When io.WantCaptureMouse is true, do not dispatch mouse input data to your main application.
70-
// - When io.WantCaptureKeyboard is true, do not dispatch keyboard input data to your main application.
71-
// Generally you may always pass all inputs to dear imgui, and hide them from your application based on those two flags.
72-
glfwPollEvents();
73-
gui.NewFrame();
74-
75-
int r = drawWindowInput(video);
76-
// now we call to the drawWindowInfo function
77-
drawWindowInfo(video); // read-only, could be const &
78-
79-
// Rendering
80-
gui.Render();
81-
}
82-
83-
// Cleanup
84-
gui.Destroy();
85-
vs::logc.info("main", "Exiting");
8643
return 0;
8744
}

0 commit comments

Comments
 (0)