Skip to content

Commit

Permalink
build: add CPack support (#254)
Browse files Browse the repository at this point in the history
* build: add CPack support

Signed-off-by: Alfi Maulana <alfi.maulana.f@gmail.com>

* build: add `default` package preset

Signed-off-by: Alfi Maulana <alfi.maulana.f@gmail.com>

* ci: modify build workflow to package project

Signed-off-by: Alfi Maulana <alfi.maulana.f@gmail.com>

* chore: remove `install` directory from Git ignore list

Signed-off-by: Alfi Maulana <alfi.maulana.f@gmail.com>

---------

Signed-off-by: Alfi Maulana <alfi.maulana.f@gmail.com>
  • Loading branch information
threeal authored Oct 16, 2024
1 parent 68847b4 commit 988b3cb
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,12 @@ jobs:
- name: Configure Project
run: cmake --preset default

- name: Install Project
run: cmake --install build --prefix install
- name: Package Project
run: cpack --preset default

- name: Upload Project
uses: actions/upload-artifact@v4.4.0
with:
name: Assertion
path: install
path: build/*.tar.gz
if-no-files-found: error
overwrite: true
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@
!.git*

build
install
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,7 @@ if(ASSERTION_ENABLE_INSTALL)
${CMAKE_CURRENT_BINARY_DIR}/cmake/AssertionConfig.cmake
${CMAKE_CURRENT_BINARY_DIR}/cmake/AssertionConfigVersion.cmake
DESTINATION lib/cmake/Assertion)

set(CPACK_SYSTEM_NAME any)
include(CPack)
endif()
11 changes: 9 additions & 2 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"version": 3,
"version": 6,
"cmakeMinimumRequired": {
"major": 3,
"minor": 21
"minor": 25
},
"configurePresets": [
{
Expand All @@ -28,5 +28,12 @@
"noTestsAction": "error"
}
}
],
"packagePresets": [
{
"name": "default",
"configurePreset": "default",
"generators": ["TGZ"]
}
]
}

0 comments on commit 988b3cb

Please sign in to comment.