Skip to content

Commit

Permalink
Merge pull request #68 from synacker/release/2.1
Browse files Browse the repository at this point in the history
Release/2.1
  • Loading branch information
synacker authored Oct 2, 2024
2 parents 9097ef2 + 0ce5f7d commit 4b20bae
Show file tree
Hide file tree
Showing 11 changed files with 154 additions and 69 deletions.
140 changes: 124 additions & 16 deletions .github/workflows/daggy-github-actions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,19 @@ on:
push:
tags:
- v*
branches:
- release/*
pull_request:

jobs:
linux-gcc12_x64:
runs-on: ubuntu-22.04
permissions:
id-token: write
contents: read
checks: write
attestations: write

steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -68,14 +76,14 @@ jobs:
shell: bash

- name: Cache conan packages
uses: actions/cache@v3
uses: actions/cache@v4
id: conan-data-gcc12
with:
path: ~/.conan2/p
key: conan-data-gcc12

- name: Set up Python 3.11
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: pip
Expand All @@ -102,6 +110,12 @@ jobs:
- name: Tests
working-directory: build/Release
run: ctest -C Release --output-on-failure --output-junit tests/local_tests.xml

- name: Attest
uses: actions/attest-build-provenance@v1
if: github.ref_type == 'tag' || startsWith(github.ref, 'refs/heads/release/')
with:
subject-path: 'build/Release/bin/**, build/Release/lib/**'

- name: linux-gcc12_x64 Tests Report
uses: mikepenz/action-junit-report@v4
Expand All @@ -114,7 +128,7 @@ jobs:
run: cpack

- name: Archive production artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: daggy_linux_x64
path: |
Expand All @@ -123,14 +137,19 @@ jobs:
build/Release/*.zip
win:
runs-on: windows-latest
runs-on: windows-2022
permissions:
id-token: write
contents: read
checks: write
attestations: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Cache conan packages
uses: actions/cache@v3
uses: actions/cache@v4
id: conan-data-msvc
with:
path: |
Expand All @@ -139,7 +158,7 @@ jobs:
key: conan-data-msvc

- name: Set up Python 3.11
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: pip
Expand Down Expand Up @@ -171,6 +190,12 @@ jobs:
working-directory: build
run: ctest -C Release --output-on-failure --output-junit tests/local_tests.xml

- name: Attest
uses: actions/attest-build-provenance@v1
if: github.ref_type == 'tag' || startsWith(github.ref, 'refs/heads/release/')
with:
subject-path: build/bin/*

- name: win-msvc193_x64 Tests Report
uses: mikepenz/action-junit-report@v4
with:
Expand All @@ -182,28 +207,105 @@ jobs:
run: cpack

- name: Archive production artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: daggy_win_x64
path: |
build/*.zip
macos:
runs-on: macos-latest
macos-arm:
runs-on: macos-14
permissions:
id-token: write
contents: read
checks: write
attestations: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Cache conan packages
uses: actions/cache@v4
id: conan-data-clang-arm64
with:
path: ~/.conan2/p
key: conan-data-clang-arm64

- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: pip

- run: pip install -r requirements.txt
- run: conan --version
- run: conan profile detect

- name: Conan config
run: conan config install CI/conan

- name: Conan install
run: conan install . --build=missing -s compiler.cppstd=17 -of .

- name: Conan remove build folders
run: conan cache clean "*" --source --build --temp --download

- name: Conan build
run: conan build . --build=missing -s compiler.cppstd=17 -of .

- name: daggy version
working-directory: build/Release
run: bin/daggy --version

- name: Tests
working-directory: build/Release
run: ctest -C Release --output-on-failure --output-junit tests/local_tests.xml

- name: Attest
uses: actions/attest-build-provenance@v1
if: github.ref_type == 'tag' || startsWith(github.ref, 'refs/heads/release/')
with:
subject-path: 'build/Release/bin/**, build/Release/lib/**'

- name: macos-arm64 Tests Report
uses: mikepenz/action-junit-report@v4
with:
report_paths: build/Release/tests/local_tests.xml
summary: macos-arm64 Tests Report

- name: Packaging
working-directory: build/Release
run: cpack

- name: Archive production artifacts
uses: actions/upload-artifact@v4
with:
name: daggy_macos_arm64
path:
build/Release/*.zip

macos-x64:
runs-on: macos-13
permissions:
id-token: write
contents: read
checks: write
attestations: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Cache conan packages
uses: actions/cache@v3
id: conan-data-clang
uses: actions/cache@v4
id: conan-data-clang-x64
with:
path: ~/.conan2/p
key: conan-data-clang
key: conan-data-clang-x64

- name: Set up Python 3.11
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: pip
Expand Down Expand Up @@ -232,18 +334,24 @@ jobs:
working-directory: build/Release
run: ctest -C Release --output-on-failure --output-junit tests/local_tests.xml

- name: macos-clang13_x64 Tests Report
- name: Attest
uses: actions/attest-build-provenance@v1
if: github.ref_type == 'tag' || startsWith(github.ref, 'refs/heads/release/')
with:
subject-path: 'build/Release/bin/**, build/Release/lib/**'

- name: macos-x64 Tests Report
uses: mikepenz/action-junit-report@v4
with:
report_paths: build/Release/tests/local_tests.xml
summary: macos-clang13_x64 Tests Report
summary: macos-x64 Tests Report

- name: Packaging
working-directory: build/Release
run: cpack

- name: Archive production artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: daggy_macos_x64
path:
Expand Down
3 changes: 1 addition & 2 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ def requirements(self):
self.requires("kainjow-mustache/4.1")
self.requires("yaml-cpp/0.8.0")
self.requires("libssh2/1.11.0")
self.requires("pcapplusplus/23.09")


def layout(self):
Expand Down Expand Up @@ -109,7 +108,7 @@ def generate(self):
tc.cache_variables["SSH2_SUPPORT"] = True
tc.cache_variables["YAML_SUPPORT"] = True
tc.cache_variables["CONSOLE"] = True
tc.cache_variables["PCAPNG_SUPPORT"] = True
tc.cache_variables["PCAPNG_SUPPORT"] = False
tc.cache_variables["PACKAGE_DEPS"] = True
tc.cache_variables["BUILD_TESTING"] = True
tc.cache_variables["CONAN_BUILD"] = True
Expand Down
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ set(CMAKE_BINARY_EXPORTS_DIR ${CMAKE_BINARY_DIR}/exports/)
include_directories(${CMAKE_BINARY_EXPORTS_DIR})

set(PROJECT_VENDOR synacker)
set(PROJECT_COPYRIGTH "Copyright \\251 2023 Mikhail Milovidov. Some Rights Reserved")
set(PROJECT_COPYRIGTH "Copyright \\251 2024 Mikhail Milovidov. Some Rights Reserved")

option(SSH2_SUPPORT "ssh2 data provider support" ON)
option(YAML_SUPPORT "yaml data sources support" ON)
Expand Down
2 changes: 1 addition & 1 deletion src/Daggy/CConsoleDaggy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ CConsoleDaggy::CConsoleDaggy(QObject* parent)
{
qApp->setApplicationName("daggy");
qApp->setOrganizationName(DAGGY_VENDOR);
qApp->setApplicationVersion(DAGGY_VERSION_STANDARD);
qApp->setApplicationVersion(DAGGY_VERSION);
qApp->setOrganizationDomain("https://github.com/synacker/daggy");

connect(this, &CConsoleDaggy::interrupt, this, &CConsoleDaggy::stop, Qt::QueuedConnection);
Expand Down
3 changes: 2 additions & 1 deletion src/Daggy/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
set(TARGET daggy)

option(PCAPNG_SUPPORT "pcap to pcapng convertor" ON)
option(PCAPNG_SUPPORT "pcap to pcapng convertor" OFF)

find_package(Qt6 COMPONENTS Core REQUIRED)

Expand Down Expand Up @@ -50,3 +50,4 @@ target_link_libraries(${TARGET} PRIVATE ${LINK_LIBRARIES})
target_precompile_headers(${TARGET} PRIVATE Precompiled.hpp)

install(TARGETS ${TARGET} RUNTIME)
include(package_deps)
2 changes: 1 addition & 1 deletion src/DaggyCore/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ set(TARGET DaggyCore)

find_package(Qt6 COMPONENTS Core Network REQUIRED)
add_library(${TARGET})

include(rpath_lib)

set_target_properties(${TARGET} PROPERTIES AUTOMOC ON)
Expand Down Expand Up @@ -115,3 +114,4 @@ else()
endif()

install(TARGETS ${TARGET} FILE_SET HEADERS)
include(package_deps)
2 changes: 0 additions & 2 deletions src/DaggyCore/tests/local/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ set(SOURCES
main.cpp
)



qt6_add_executable(${TARGET} ${SOURCES})
include(rpath_bin)
add_test(NAME ${TARGET} COMMAND ${TARGET} WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_BINDIR})
Expand Down
9 changes: 6 additions & 3 deletions src/cmake/compiler.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,12 @@ else()
set(POSITION_INDEPENDENT_CODE OFF)
endif()

make_directory(${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR})
make_directory(${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_BINDIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_BINDIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR})


make_directory(${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
make_directory(${CMAKE_LIBRARY_OUTPUT_DIRECTORY})

set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR})
Expand All @@ -40,4 +44,3 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_MINSIZEREL ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})



52 changes: 14 additions & 38 deletions src/cmake/package_deps.cmake
Original file line number Diff line number Diff line change
@@ -1,41 +1,17 @@
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_BINDIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR})
if(UNIX AND NOT APPLE)
install(DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/daggy/
DESTINATION ${CMAKE_INSTALL_LIBDIR}/daggy/
FILES_MATCHING
PATTERN libQt6Network.so*
PATTERN libQt6Core.so*
PATTERN libssh2.so*
PATTERN libyaml-cpp.so*
PATTERN libcrypto*.so*
if (PACKAGE_DEPS)
install(TARGETS ${TARGET}
RUNTIME_DEPENDENCY_SET ${TARGET}_deps
)
elseif(APPLE)
install(DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/daggy/
DESTINATION ${CMAKE_INSTALL_LIBDIR}/daggy/
FILES_MATCHING
PATTERN libQt6Network*dylib
PATTERN libQt6Core*dylib
PATTERN libssh2*dylib
PATTERN libyaml-cpp*dylib
PATTERN libcrypto*dylib

install(RUNTIME_DEPENDENCY_SET ${TARGET}_deps
PRE_EXCLUDE_REGEXES
[=[api-ms-]=]
[=[ext-ms-]=]
[[kernel32\.dll]]
[[libc\.so\..*]] [[libgcc_s\.so\..*]] [[libm\.so\..*]] [[libstdc\+\+\.so\..*]]
POST_EXCLUDE_REGEXES
[=[.*system32\/.*\.dll]=]
[=[^\/(lib|usr\/lib|usr\/local\/lib\/lib64)]=]
DIRECTORIES ${CONAN_RUNTIME_LIB_DIRS} ${CONAN_LIB_DIRS}
)
else()
set(VC_REDIST ${CMAKE_BINARY_DIR}/vc_redist-x64.exe)
if(NOT EXISTS ${VC_REDIST})
execute_process(COMMAND powershell wget -UseBasicParsing -OutFile ${VC_REDIST} 'https://aka.ms/vs/16/release/vc_redist.x64.exe')
endif()
install(FILES ${VC_REDIST}
DESTINATION vcredist)
install(DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
DESTINATION .
FILES_MATCHING
PATTERN Qt6Network.dll
PATTERN Qt6Core.dll
PATTERN libssh2.dll
PATTERN yaml-cpp.dll
PATTERN libcrypto-1_1-x64.dll)
install(FILES
${CMAKE_CURRENT_LIST_DIR}/daggyenv.bat
DESTINATION ${CMAKE_INSTALL_BINDIR})
endif()
4 changes: 2 additions & 2 deletions src/cmake/rpath_bin.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
if(CONAN_BUILD)
if(APPLE)
set_target_properties(${TARGET} PROPERTIES INSTALL_RPATH "@executable_path/../${CMAKE_INSTALL_LIBDIR};@executable_path/../${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME}")
set_target_properties(${TARGET} PROPERTIES INSTALL_RPATH "@executable_path/../${CMAKE_INSTALL_LIBDIR}")
elseif(UNIX)
set_target_properties(${TARGET} PROPERTIES INSTALL_RPATH "$ORIGIN/../${CMAKE_INSTALL_LIBDIR}:$ORIGIN/../${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME}")
set_target_properties(${TARGET} PROPERTIES INSTALL_RPATH "$ORIGIN/../${CMAKE_INSTALL_LIBDIR}")
endif()
endif()
Loading

0 comments on commit 4b20bae

Please sign in to comment.