diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 9f71cbd..af19088 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -14,9 +14,23 @@ jobs: submodules: true - run: cmake . - run: cmake --build . - - name: Run - uses: GuillaumeFalourd/command-output-file-action@v1.1 + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - command_line: ./my_allocator_03 ; ./my_allocator - output_file_name: output.txt - display_file_content: YES # this is also the default value if not informed + tag_name: ${{ github.run_number }} + release_name: Release ${{ github.run_number }} + draft: false + prerelease: false + - name: Upload Release Asset + id: upload-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./MyAllocator-0.0.1-Linux.deb + asset_name: MyAllocator-0.0.1-Linux.deb + asset_content_type: application/vnd.debian.binary-package \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 577317c..6524e4f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,3 +29,23 @@ set_target_properties(my_allocator PROPERTIES CXX_STANDARD_REQUIRED ON ) +install( + TARGETS my_allocator_03 + COMPONENT ${PROJECT_NAME} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} # bin +) + +install( + TARGETS my_allocator + COMPONENT ${PROJECT_NAME} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} # bin +) + +SET(CPACK_GENERATOR "DEB") +SET(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR}) +SET(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR}) +SET(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH}) +SET(CPACK_PACKAGE_NAME ${CMAKE_PROJECT_NAME}) +SET(CPACK_PACKAGE_CONTACT "my") +INCLUDE(CPack) + diff --git a/run.sh b/run.sh index bc75599..f3d2a3c 100755 --- a/run.sh +++ b/run.sh @@ -3,5 +3,7 @@ # mkdir -p build #cd build # rm -rf * -cmake .. -DCMAKE_INSTALL_PREFIX=~ +cmake .. -DPATCH_VERSION=3 -DBUILD_GMOCK=OFF -DINSTALL_GTEST=OFF -DCMAKE_INSTALL_PREFIX=~ cmake --build . +cmake --build . --target=install +cmake --build . --target=package