Skip to content

Commit

Permalink
Add option to standardize Linux installer name
Browse files Browse the repository at this point in the history
  • Loading branch information
awawa-dev committed Aug 5, 2023
1 parent 3941c18 commit 8ea9af4
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 19 deletions.
20 changes: 10 additions & 10 deletions .ci/ci_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ elif [[ "$CI_NAME" == 'linux' ]]; then
cat PKGBUILD
chmod -R a+rw ${CI_BUILD_DIR}/.ccache
else
executeCommand="cd build && ( cmake ${cachecommand} -DPLATFORM=${PLATFORM} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DDEBIAN_NAME_TAG=${DOCKER_TAG} ../ || exit 2 )"
executeCommand="cd build && ( cmake ${cachecommand} -DPLATFORM=${PLATFORM} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DDEBIAN_NAME_TAG=${DOCKER_TAG} -DUSE_STANDARD_INSTALLER_NAME=${USE_STANDARD_INSTALLER_NAME} ../ || exit 2 )"
executeCommand+=" && ( make -j $(nproc) package || exit 3 )"
fi

Expand All @@ -129,10 +129,10 @@ elif [[ "$CI_NAME" == 'linux' ]]; then
-v "${CI_BUILD_DIR}:/source:ro" \
$REGISTRY_URL:$DOCKER_TAG \
/bin/bash -c "${cache_env} && cd / && mkdir -p hyperhdr && cp -r source/. /hyperhdr &&
cd /hyperhdr && mkdir build && ${executeCommand} &&
cp /hyperhdr/build/bin/h* /deploy/ 2>/dev/null || : &&
cp /hyperhdr/build/Hyper* /deploy/ 2>/dev/null || : &&
cp /hyperhdr/Hyper*.zst /deploy/ 2>/dev/null || : &&
cd /hyperhdr && mkdir build && (${executeCommand}) &&
(cp /hyperhdr/build/bin/h* /deploy/ 2>/dev/null || : ) &&
(cp /hyperhdr/build/Hyper* /deploy/ 2>/dev/null || : ) &&
(cp /hyperhdr/Hyper*.zst /deploy/ 2>/dev/null || : ) &&
ccache -s &&
exit 0;
exit 1 " || { echo "---> HyperHDR compilation failed! Abort"; exit 5; }
Expand All @@ -145,7 +145,7 @@ elif [[ "$CI_NAME" == 'linux' ]]; then
echo "Using makepkg"
cat PKGBUILD
else
executeCommand="cd build && ( cmake -DPLATFORM=${PLATFORM} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DDEBIAN_NAME_TAG=${DOCKER_TAG} ../ || exit 2 )"
executeCommand="cd build && ( cmake -DPLATFORM=${PLATFORM} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DDEBIAN_NAME_TAG=${DOCKER_TAG} -DUSE_STANDARD_INSTALLER_NAME=${USE_STANDARD_INSTALLER_NAME} ../ || exit 2 )"
executeCommand+=" && ( make -j $(nproc) package || exit 3 )"
fi

Expand All @@ -155,10 +155,10 @@ elif [[ "$CI_NAME" == 'linux' ]]; then
-v "${CI_BUILD_DIR}:/source:ro" \
$REGISTRY_URL:$DOCKER_TAG \
/bin/bash -c "cd / && mkdir -p hyperhdr && cp -r source/. /hyperhdr &&
cd /hyperhdr && mkdir build && ${executeCommand} &&
cp /hyperhdr/build/bin/h* /deploy/ 2>/dev/null || : &&
cp /hyperhdr/build/Hyper* /deploy/ 2>/dev/null || : &&
cp /hyperhdr/Hyper*.zst /deploy/ 2>/dev/null || : &&
cd /hyperhdr && mkdir build && (${executeCommand}) &&
(cp /hyperhdr/build/bin/h* /deploy/ 2>/dev/null || : ) &&
(cp /hyperhdr/build/Hyper* /deploy/ 2>/dev/null || : ) &&
(cp /hyperhdr/Hyper*.zst /deploy/ 2>/dev/null || : ) &&
exit 0;
exit 1 " || { echo "---> HyperHDR compilation failed! Abort"; exit 5; }
fi
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/image-builder-from-repo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

jobs:
build:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
env:
HYPERHDR_DEB: 'https://github.com/awawa-dev/HyperHDR/releases/download/v${{ github.event.inputs.tags }}/HyperHDR-${{ github.event.inputs.tags }}-Linux-${{ github.event.inputs.architecture }}.deb'

Expand Down
13 changes: 11 additions & 2 deletions .github/workflows/image-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,24 @@ on:
tags:
description: 'HyperHDR release tag (for example 17.0.0.0)'
architecture:
description: 'ARM architecture: armv6l/armv7l/aarch64'
description: 'ARM architecture: armv6l/aarch64'
debian:
default: ""
description: 'optional Debian version'

jobs:
build:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
env:
HYPERHDR_DEB: 'https://github.com/awawa-dev/HyperHDR/releases/download/v${{ github.event.inputs.tags }}/HyperHDR-${{ github.event.inputs.tags }}-Linux-${{ github.event.inputs.architecture }}.deb'

steps:

- name: Overrride Debian download link
if: github.event.inputs.debian != ''
run: |
echo "HYPERHDR_DEB='https://github.com/awawa-dev/HyperHDR/releases/download/v${{ github.event.inputs.tags }}/hyperhdr_{{ github.event.inputs.tags }}~${{ github.event.inputs.debian }}_${{ github.event.inputs.architecture }}.deb'" >> $GITHUB_ENV
- name: Install Dependencies
run: |
sudo apt update
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/push-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ jobs:
key: ${{ matrix.linuxVersion }}-${{ matrix.dockerImage }}-ccache-${{ steps.ccache_cache_timestamp.outputs.timestamp }}
restore-keys: ${{ matrix.linuxVersion }}-${{ matrix.dockerImage }}-ccache-

- name: Check testing version
if: github.linuxVersion == 'bookworm'
run: |
echo "USE_STANDARD_INSTALLER_NAME=ON" >> $GITHUB_ENV
- name: Build packages
env:
DOCKER_IMAGE: ${{ matrix.dockerImage }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/upload-to-github-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ jobs:
PLATFORM: ${{ matrix.platform }}
USE_CCACHE: ${{ env.USE_CACHE }}
RESET_CACHE: ${{ env.RESET_CACHE }}
USE_STANDARD_INSTALLER_NAME: 'ON'
shell: bash
run: |
sed -i 's/#SET(HYPERHDR_REPO_BUILD ON)/SET(HYPERHDR_REPO_BUILD ON)/' ./cmake/packages.cmake
./.ci/ci_build.sh
# deploy the package
Expand Down
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,13 @@ colorMe("USE_SYSTEM_FLATBUFFERS_LIBS = " ${USE_SYSTEM_FLATBUFFERS_LIBS})
option(USE_SYSTEM_MBEDTLS_LIBS "Use system mbedtls libs" ${DEFAULT_USE_SYSTEM_MBEDTLS_LIBS})
colorMe("USE_SYSTEM_MBEDTLS_LIBS = " ${USE_SYSTEM_MBEDTLS_LIBS})

if(UNIX AND NOT APPLE)
option(USE_STANDARD_INSTALLER_NAME "Use the standardized Linux installer name" OFF)
colorMe("USE_STANDARD_INSTALLER_NAME = " ${USE_STANDARD_INSTALLER_NAME})
else()
SET ( USE_STANDARD_INSTALLER_NAME OFF )
endif()

message( STATUS "\n")

# next part
Expand Down
6 changes: 1 addition & 5 deletions cmake/packages.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# cmake file for generating distribution packages
#SET(HYPERHDR_REPO_BUILD ON)

MACRO (CHECK_GLIBC_VERSION)
EXECUTE_PROCESS (
COMMAND ldd --version
Expand Down Expand Up @@ -69,8 +66,7 @@ SET ( CPACK_PACKAGE_VERSION_MAJOR "${HYPERHDR_VERSION_MAJOR}")
SET ( CPACK_PACKAGE_VERSION_MINOR "${HYPERHDR_VERSION_MINOR}")
SET ( CPACK_PACKAGE_VERSION_PATCH "${HYPERHDR_VERSION_PATCH}")

# Github Action enables it for packages
if(HYPERHDR_REPO_BUILD)
if(USE_STANDARD_INSTALLER_NAME AND UNIX AND NOT APPLE)
string(REPLACE "." ";" HYPERHDR_VERSION_LIST ${HYPERHDR_VERSION})
list(LENGTH HYPERHDR_VERSION_LIST HYPERHDR_VERSION_LIST_LEN)
if (HYPERHDR_VERSION_LIST_LEN EQUAL 4)
Expand Down

0 comments on commit 8ea9af4

Please sign in to comment.