build: use PACKAGE_VERSION_LABEL to set generated package's name
If unset use CPACK_PACKAGE_VERSION when set only replaces the version in the package's filename
This commit is contained in:
13
.github/workflows/ci.yml
vendored
13
.github/workflows/ci.yml
vendored
@ -209,8 +209,11 @@ jobs:
|
||||
if: ${{runner.os != 'Linux' }}
|
||||
run: python ./scripts/setup_venv.py
|
||||
|
||||
- name: Get version
|
||||
uses: ./.github/actions/get-version
|
||||
|
||||
- name: Configure
|
||||
run: ${{env.CMAKE_CONFIGURE}} ${{ matrix.target.config-args }} ${{ steps.get-deps.outputs.vcpkg-cmake-config }}
|
||||
run: ${{env.CMAKE_CONFIGURE}} ${{ matrix.target.config-args }} ${{ steps.get-deps.outputs.vcpkg-cmake-config }} -DPACKAGE_VERSION_LABEL=${{env.DESKFLOW_PACKAGE_VERSION}}
|
||||
|
||||
- name: Build
|
||||
shell: bash
|
||||
@ -228,7 +231,7 @@ jobs:
|
||||
sudo -u build makepkg -s
|
||||
export OSNAME=$(cat /etc/os-release | grep ^ID= | sed 's/ID=//g')
|
||||
export ARCH=$(uname -m)
|
||||
mv *.pkg.* $(ls *.pkg.* | sed "s/$ARCH/$OSNAME-$ARCH/g")
|
||||
mv *.pkg.tar.zst deskflow-${{env.DESKFLOW_PACKAGE_VERSION}}_${OSNAME}_${ARCH}.pkg.tar.zst
|
||||
cd ..
|
||||
fi
|
||||
|
||||
@ -238,9 +241,6 @@ jobs:
|
||||
with:
|
||||
job: ${{ matrix.target.name }}
|
||||
|
||||
- name: Get version
|
||||
if: ${{ runner.os != 'Linux' }}
|
||||
uses: ./.github/actions/get-version
|
||||
|
||||
- name: Package
|
||||
if: ${{ runner.os != 'Linux' }}
|
||||
@ -308,6 +308,9 @@ jobs:
|
||||
- name: Download artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
|
||||
- name: Fancy Checkout
|
||||
uses: sithlord48/fancy-checkout@v1.0.0
|
||||
|
||||
- name: Get version
|
||||
if: (github.ref == 'refs/heads/master') && !(contains(github.ref, '/tags/v'))
|
||||
uses: ./.github/actions/get-version
|
||||
|
||||
@ -1,13 +0,0 @@
|
||||
# SPDX-FileCopyrightText: 2022 - 2023 Chris Rizzitello <sithlord48@gmail.com>
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
#This File is generated at CONFIGURE time
|
||||
#This file is run at CPACK Time
|
||||
|
||||
#Do not set CPACK used CMAKE_* Vars here
|
||||
# some Generators will fail if you do
|
||||
|
||||
#These installs must not use "continuous"
|
||||
if(CPACK_GENERATOR MATCHES DEB|WIX|RPM)
|
||||
set(CPACK_PACKAGE_VERSION @CMAKE_PROJECT_VERSION@)
|
||||
endif()
|
||||
@ -11,9 +11,6 @@ macro(configure_packaging)
|
||||
|
||||
message(VERBOSE "Configuring Packaging")
|
||||
set(DESKFLOW_PROJECT_RES_DIR ${PROJECT_SOURCE_DIR}/res)
|
||||
configure_file(${CMAKE_SOURCE_DIR}/cmake/CPackOptions.cmake.in
|
||||
${CMAKE_BINARY_DIR}/cmake/CPackOptions.cmake @ONLY)
|
||||
set(CPACK_PROJECT_CONFIG_FILE ${CMAKE_CURRENT_BINARY_DIR}/CPackOptions.cmake)
|
||||
|
||||
if(${BUILD_INSTALLER})
|
||||
set(CPACK_PACKAGE_NAME ${DESKFLOW_APP_ID})
|
||||
@ -22,8 +19,11 @@ macro(configure_packaging)
|
||||
set(CPACK_PACKAGE_VENDOR ${DESKFLOW_AUTHOR_NAME})
|
||||
set(CPACK_RESOURCE_FILE_LICENSE ${PROJECT_SOURCE_DIR}/LICENSE)
|
||||
|
||||
if(NOT CPACK_PACKAGE_VERSION)
|
||||
set(CPACK_PACKAGE_VERSION ${DESKFLOW_VERSION})
|
||||
set(CPACK_PACKAGE_VERSION ${CMAKE_PROJECT_VERSION})
|
||||
|
||||
#Prevent this override from being written in the package
|
||||
if(NOT PACKAGE_VERSION_LABEL)
|
||||
set (PACKAGE_VERSION_LABEL "${CPACK_PACKAGE_VERSION}")
|
||||
endif()
|
||||
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
|
||||
@ -37,8 +37,8 @@ macro(configure_packaging)
|
||||
set(OS_STRING ${CMAKE_SYSTEM_NAME}_${CMAKE_SYSTEM_PROCESSOR})
|
||||
endif()
|
||||
|
||||
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${OS_STRING}")
|
||||
message(STATUS "Package Basename: ${CPACK_PACKAGE_NAME}")
|
||||
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${PACKAGE_VERSION_LABEL}_${OS_STRING}")
|
||||
message(STATUS "Package Basename: ${CPACK_PACKAGE_FILE_NAME}")
|
||||
|
||||
include(CPack)
|
||||
else()
|
||||
|
||||
Reference in New Issue
Block a user