Skip to content

Commit

Permalink
Merge branch 'antoniovazquezblanco-dev/dist' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
BatchDrake committed Jun 7, 2023
2 parents 9181e56 + 6817812 commit e1d6c84
Show file tree
Hide file tree
Showing 5 changed files with 90 additions and 129 deletions.
48 changes: 48 additions & 0 deletions .github/actions/package/action.yml
@@ -0,0 +1,48 @@
name: Package
description: 'Package a CMake project with CPack support'

inputs:
generators:
required: true

runs:
using: "composite"
steps:
- name: Package
shell: bash
run: cpack --config build/CPackConfig.cmake --verbose -G "${{inputs.generators}}"

- name: Upload DEB artifact
if: runner.os == 'Linux'
uses: actions/upload-artifact@v3
with:
name: linux-deb.zip
path: build/dist/*.deb

- name: Upload RPM artifact
if: runner.os == 'Linux'
uses: actions/upload-artifact@v3
with:
name: linux-rpm.zip
path: build/dist/*.rpm

- name: Upload TGZ artifact
if: runner.os == 'Linux'
uses: actions/upload-artifact@v3
with:
name: linux-tgz.zip
path: build/dist/*.tar.gz

- name: Upload TGZ artifact
if: runner.os == 'MacOS'
uses: actions/upload-artifact@v3
with:
name: macos-tgz.zip
path: build/dist/*.tar.gz

- name: Upload ZIP artifact
if: runner.os == 'Windows'
uses: actions/upload-artifact@v3
with:
name: windows-zip.zip
path: build/dist/*.zip
37 changes: 13 additions & 24 deletions .github/workflows/cmake.yml → .github/workflows/build.yml
@@ -1,9 +1,6 @@
name: Build

on:
push:
pull_request:
workflow_dispatch:
on: [push, pull_request, workflow_dispatch]

jobs:
build-linux:
Expand All @@ -21,25 +18,13 @@ jobs:

- name: Build
uses: "./.github/actions/build"

- name: Get short hash
id: vars
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT

- name: Make Debian package
run: src/makedeb.sh 0.3.0 ${{steps.vars.outputs.sha_short}}

- name: Upload deb artifact
uses: actions/upload-artifact@v3
with:
name: libsigutils_0.3.0-${{steps.vars.outputs.sha_short}}_amd64.deb
path: libsigutils_0.3.0-${{steps.vars.outputs.sha_short}}_amd64.deb
cmake_configuration_parameters: -DCMAKE_INSTALL_PREFIX=/usr

- name: Upload dev deb artifact
uses: actions/upload-artifact@v3
- name: Package
uses: "./.github/actions/package"
with:
name: libsigutils-dev_0.3.0-${{steps.vars.outputs.sha_short}}_amd64.deb
path: libsigutils-dev_0.3.0-${{steps.vars.outputs.sha_short}}_amd64.deb
generators: TGZ;DEB

build-macos:
runs-on: macos-latest
Expand All @@ -56,6 +41,11 @@ jobs:
- name: Build
uses: "./.github/actions/build"

- name: Package
uses: "./.github/actions/package"
with:
generators: TGZ

build-windows:
runs-on: windows-latest
defaults:
Expand All @@ -80,8 +70,7 @@ jobs:
with:
shell: msys2 {0}

- name: Upload dll file
uses: actions/upload-artifact@v3
- name: Package
uses: "./.github/actions/package"
with:
name: libsigutils.dll
path: ${{github.workspace}}/build/libsigutils.dll
generators: ZIP
1 change: 1 addition & 0 deletions CMakeLists.txt
Expand Up @@ -35,6 +35,7 @@ set(SIGUTILS_VERSION ${SIGUTILS_VERSION_MAJOR}.${SIGUTILS_VERSION_MINOR}.${SIGUT
project(
sigutils
VERSION ${SIGUTILS_VERSION}
DESCRIPTION "Small signal processing utility library"
HOMEPAGE_URL "http://github.org/BatchDrake/sigutils"
LANGUAGES C)

Expand Down
31 changes: 28 additions & 3 deletions src/CMakeLists.txt
Expand Up @@ -110,6 +110,31 @@ endif()
target_pc_file_generate(sigutils "Digital signal processing utility library")

# File install
install(DIRECTORY include/sigutils DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
install(TARGETS sigutils DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(FILES ${PROJECT_BINARY_DIR}/src/sigutils.pc DESTINATION ${CMAKE_INSTALL_PKGCONFIGDIR})
install(TARGETS sigutils LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT LIB)
install(DIRECTORY include/sigutils DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT DEVEL)
install(FILES ${PROJECT_BINARY_DIR}/src/sigutils.pc DESTINATION ${CMAKE_INSTALL_PKGCONFIGDIR} COMPONENT DEVEL)

# General packaging settings
set(CPACK_PACKAGE_NAME sigutils)
set(CPACK_PACKAGE_DIRECTORY ${PROJECT_BINARY_DIR}/dist)

# DEB packaging settings
set(CPACK_DEB_COMPONENT_INSTALL ON)
if(GITVERSIONDETECT_VERSION_COMMIT_NUM)
set(CPACK_DEBIAN_PACKAGE_VERSION ${GITVERSIONDETECT_VERSION})
endif()
set(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT)
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "arf20 <aruizfernandez05@gmail.com>")
set(CPACK_DEBIAN_LIB_PACKAGE_DEPENDS "libsndfile1 (>= 1.0.31-2build1), libvolk2.5 (>= 2.5.1-1), libfftw3-single3 (>= 3.3.8-2)")
set(CPACK_DEBIAN_DEVEL_PACKAGE_DEPENDS "libsndfile1-dev (>= 1.0.31-2build1), libvolk2-dev (>= 2.5.1-1), libfftw3-dev (>= 3.3.8-2)")
set(CPACK_DEBIAN_LIB_PACKAGE_NAME "libsigutils")
set(CPACK_DEBIAN_DEVEL_PACKAGE_NAME "libsigutils-dev")
set(CPACK_DEBIAN_LIB_PACKAGE_SECTION "libs")
set(CPACK_DEBIAN_DEVEL_PACKAGE_SECTION "libdevel")

# Include CPack
include(CPack)

# CPack component information
cpack_add_component(LIB DISPLAY_NAME "Runtime library")
cpack_add_component(DEVEL DISPLAY_NAME "Development files" DEPENDS LIB)
102 changes: 0 additions & 102 deletions src/makedeb.sh

This file was deleted.

0 comments on commit e1d6c84

Please sign in to comment.