Skip to content

Commit

Permalink
addad package building
Browse files Browse the repository at this point in the history
  • Loading branch information
gittiver committed Nov 4, 2024
1 parent 8510b55 commit aa89460
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 12 deletions.
30 changes: 19 additions & 11 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,24 @@ jobs:
matrix:
os: [ ubuntu-latest,
windows-latest,
ubuntu-20.04,
macos-latest,
macos-11
ubuntu-20.04,
ubuntu-24.04,
macos-13
]
# ubuntu-18.04 does not work due to compile error on asio
# windows-2019 not included to spare free minutes
# windows-2019 not included to spare free minutes
steps:
- uses: actions/checkout@v4
- name: Prepare dependencies
run: |
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
sudo apt-get update && \
sudo apt-get install -yq \
libasio-dev \
libssl-dev zlib1g-dev \
cmake
cmake \
g++ clang
elif [ "$RUNNER_OS" == "Windows" ]; then
VCPKG_DEFAULT_TRIPLET=x64-windows vcpkg install
elif [ "$RUNNER_OS" == "macOS" ]; then
Expand Down Expand Up @@ -84,6 +86,7 @@ jobs:
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest --output-on-failure -C ${{env.BUILD_TYPE}}
shell: bash

- name: Generate coverage report
if: matrix.os == 'ubuntu-latest'
Expand All @@ -106,11 +109,16 @@ jobs:
name: coveralls.json
path: coveralls.json

- name: Package
working-directory: ${{github.workspace}}/build
run: cmake --build . --target package

#- name: Package
- uses: actions/upload-artifact@v4
if: matrix.os == 'ubuntu-24.04'
with:
name: packages
path: ${{github.workspace}}/build/Crow-*

#- name: Source package
# working-directory: ${{github.workspace}}/build
# run: |
# cmake --build . --target ALL_BUILD && \
# cmake --build . --target doc && \
# cmake --build . --target package && \
# cpack --config CPackSourceConfig.cmake
# run: cpack --config CPackSourceConfig.cmake
11 changes: 10 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,16 @@ if(CROW_INSTALL)
)
endif()

set(CPACK_GENERATOR "ZIP")
if(WIN32 AND NOT CYGWIN)
set(CPACK_GENERATOR NSIS ZIP)
endif(WIN32 AND NOT CYGWIN)
if(APPLE)
set(CPACK_GENERATOR DragNDrop TGZ)
endif(APPLE)
if (UNIX AND NOT APPLE AND NOT WIN32)
set(CPACK_GENERATOR DEB TGZ)
endif (UNIX AND NOT APPLE AND NOT WIN32)

set(CPACK_PACKAGE_NAME "Crow")
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "CrowCpp")
set(CPACK_PACKAGE_VENDOR "CrowCpp")
Expand Down

0 comments on commit aa89460

Please sign in to comment.