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

CPack artifacts file name format compliance #4811

Merged
merged 6 commits into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from 5 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
14 changes: 12 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,18 @@ jobs:
steps:
- name: Checkout TileDB
uses: actions/checkout@v3
- name: Set variables
id: get-values
run: |
release_hash=$( echo ${{ github.sha }} | cut -c-7 - )
ref=${{ github.head_ref || github.ref_name }}
echo "release_version=${ref##*/}-$release_hash" >> $GITHUB_OUTPUT
shell: bash
- name: CMake Configure
run: cmake -S . -B build -DTILEDB_CMAKE_IDE=ON
- name: CPack Package Source
env:
TILEDB_PACKAGE_VERSION: ${{ steps.get-values.outputs.release_version }}
run: cd build && cpack --config CPackSourceConfig.cmake
- name: Upload Release Artifacts
uses: actions/upload-artifact@v3
Expand Down Expand Up @@ -79,8 +88,7 @@ jobs:
run: |
release_hash=$( echo ${{ github.sha }} | cut -c-7 - )
ref=${{ github.head_ref || github.ref_name }}
echo "release_hash=$release_hash" >> $GITHUB_OUTPUT
echo "archive_name=tiledb-${{ matrix.platform }}-${ref##*/}-$release_hash" >> $GITHUB_OUTPUT
echo "release_version=${ref##*/}-$release_hash" >> $GITHUB_OUTPUT
shell: bash
- name: Install manylinux prerequisites
if: matrix.manylinux
Expand All @@ -106,6 +114,8 @@ jobs:
${{ matrix.cmake_args }}
shell: bash
- name: Build TileDB
env:
TILEDB_PACKAGE_VERSION: ${{ steps.get-values.outputs.release_version }}
run: cmake --build build --config Release --target package
- name: Upload release artifacts
uses: actions/upload-artifact@v3
Expand Down
8 changes: 8 additions & 0 deletions cmake/inputs/CustomCPackOptions.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,11 @@ set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY OFF)

# Enable HASH
set(CPACK_PACKAGE_CHECKSUM "SHA256")

set(PACKAGE_VERSION $ENV{TILEDB_PACKAGE_VERSION})
if(NOT PACKAGE_VERSION)
message(FATAL_ERROR "In order to package TileDB specify environment variable TILEDB_PACKAGE_VERSION")
endif()

set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CPACK_SOURCE_PACKAGE_FILE_NAME}-${PACKAGE_VERSION}")
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}-${PACKAGE_VERSION}")
11 changes: 9 additions & 2 deletions cmake/package.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,24 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
else()
set(CPACK_SYSTEM_PROCESSOR ${CMAKE_SYSTEM_PROCESSOR})
endif()
elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows")
set(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME})
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "AMD64")
set(CPACK_SYSTEM_PROCESSOR "x86_64")
else()
set(CPACK_SYSTEM_PROCESSOR ${CMAKE_SYSTEM_PROCESSOR})
endif()
else()
set(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME})
set(CPACK_SYSTEM_PROCESSOR ${CMAKE_SYSTEM_PROCESSOR})
endif()

set(CPACK_SOURCE_IGNORE_FILES ".*\.git;.*build.*/.*")

set(CPACK_SOURCE_PACKAGE_FILE_NAME "${PROJECT_NAME}-source-${TILEDB_VERSION}")
set(CPACK_SOURCE_PACKAGE_FILE_NAME "${PROJECT_NAME}-source")
string(TOLOWER ${CPACK_SOURCE_PACKAGE_FILE_NAME} CPACK_SOURCE_PACKAGE_FILE_NAME)

set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${CPACK_SYSTEM_NAME}-${CPACK_SYSTEM_PROCESSOR}${CPACK_NOAVX2}-${TILEDB_VERSION}")
set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${CPACK_SYSTEM_NAME}-${CPACK_SYSTEM_PROCESSOR}${CPACK_NOAVX2}")
string(TOLOWER ${CPACK_PACKAGE_FILE_NAME} CPACK_PACKAGE_FILE_NAME)

include(CPack)
Loading