Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Debian and RPM Packages on release #4687

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/build_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Build Source Release

# Trigger whenever a release is created
on:
release:
types:
- created

jobs:
build:
name: build
runs-on: ubuntu-22.04
steps:
- name: clone the repository
uses: actions/checkout@v4

- name: Create the Debian and RPM package
run: |
cmake -B build -DCMAKE_INSTALL_PREFIX=/usr
cmake --build build
cd build
cpack -G DEB
cpack -G RPM

- name: Upload debian and rpm package to release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.event.release.tag_name }}
files: |
./build/*.deb
./build/*.rpm

3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,6 @@ if(BUILD_GMOCK)
else()
add_subdirectory( googletest )
endif()

# Include CPack
include(CPackConfig.txt)
38 changes: 38 additions & 0 deletions CPackConfig.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
set(CPACK_PACKAGE_NAME "libgtest-dev")
set(CPACK_PACKAGE_CONTACT "Ubuntu Developers <[email protected]>")
set(CPACK_PACKAGE_DESCRIPTION "Description: Google's framework for writing C++ tests
Google's framework for writing C++ tests on a variety of platforms. Based on
the xUnit architecture. Supports automatic test discovery, a rich set of
assertions, user-defined assertions, death tests, fatal and non-fatal failures,
value- and type-parameterized tests, various options for running the tests, and
XML test report generation.")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Google's framework for writing C++ tests")
set(CPACK_PACKAGE_HOMEPAGE_URL "https://github.com/google/googletest")
set(CPACK_STRIP_FILES false)
set(CPACK_PACKAGE_ARCHITECTURE "amd64")
if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "aarch64")
set(CPACK_PACKAGE_ARCHITECTURE "arm64")
endif()

set(CPACK_PACKAGE_VERSION "${GOOGLETEST_VERSION}")
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}_${CPACK_PACKAGE_ARCHITECTURE}")

# Copy over documentation (Debian, probably same for rpm and mac?)
# install(DIRECTORY "${CMAKE_SOURCE_DIR}/LICENSES" DESTINATION "/usr/share/doc/libcapstone-dev")
# install(FILES "${CMAKE_SOURCE_DIR}/ChangeLog" DESTINATION "/usr/share/doc/libcapstone-dev")
# install(FILES "${CMAKE_SOURCE_DIR}/README.md" DESTINATION "/usr/share/doc/libcapstone-dev")

# Set Debian-specific package variables
set(CPACK_DEBIAN_PACKAGE_SOURCE "googletest")
set(CPACK_DEBIAN_PACKAGE_ORIGINAL_MAINTAINER "Steve M. Robbins <[email protected]>")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>= 2.2.5)")
set(CPACK_DEBIAN_PACKAGE_SECTION "universe/libdevel")
set(CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
set(CPACK_DEBIAN_PACKAGE_MULTIARCH "same")

# RPM package settings
set(CPACK_RPM_PACKAGE_GROUP "Development/Libraries")
set(CPACK_RPM_PACKAGE_REQUIRES "libc6 >= 2.2.5")

# Include CPack
include(CPack)