mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2024-12-14 11:58:02 +00:00
fix: release pipeline (#2439)
We had a place in tools/packaging/generate_debian_package.sh that relied on the existence of build-opt, moreover, if it did not exist the script deadlocked. 1. Added more loggings 2. Removed the loop 3. Removed unnecessary dependency in the script on the build-dir name. Signed-off-by: Roman Gershman <roman@dragonflydb.io>
This commit is contained in:
parent
5586798e90
commit
af23778655
4 changed files with 25 additions and 19 deletions
1
.github/workflows/release.yml
vendored
1
.github/workflows/release.yml
vendored
|
@ -120,6 +120,7 @@ jobs:
|
|||
dnf install -y rpm-build libstdc++-static
|
||||
fi
|
||||
- name: Build artifacts
|
||||
timeout-minutes: 25
|
||||
run: |
|
||||
# Work around https://github.com/actions/checkout/issues/766
|
||||
git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
||||
|
|
7
Makefile
7
Makefile
|
@ -5,6 +5,7 @@ HELIO_USE_STATIC_LIBS = ON
|
|||
HELIO_OPENSSL_USE_STATIC_LIBS = ON
|
||||
HELIO_ENABLE_GIT_VERSION = ON
|
||||
HELIO_WITH_UNWIND = OFF
|
||||
RELEASE_DIR=build-release
|
||||
|
||||
# Some distributions (old fedora) have incorrect dependencies for crypto
|
||||
# so we add -lz for them.
|
||||
|
@ -29,14 +30,14 @@ HELIO_FLAGS = -DHELIO_RELEASE_FLAGS="-g" \
|
|||
.PHONY: default
|
||||
|
||||
configure:
|
||||
cmake -L -B build-release -DCMAKE_BUILD_TYPE=Release -GNinja $(HELIO_FLAGS)
|
||||
cmake -L -B $(RELEASE_DIR) -DCMAKE_BUILD_TYPE=Release -GNinja $(HELIO_FLAGS)
|
||||
|
||||
build:
|
||||
cd build-release; \
|
||||
cd $(RELEASE_DIR); \
|
||||
ninja dragonfly && ldd dragonfly
|
||||
|
||||
package:
|
||||
cd build-release; \
|
||||
cd $(RELEASE_DIR); \
|
||||
objcopy \
|
||||
--remove-section=".debug_*" \
|
||||
--remove-section="!.debug_line" \
|
||||
|
|
|
@ -19,13 +19,24 @@
|
|||
|
||||
set -eu
|
||||
|
||||
|
||||
if [ $# -ge 1 ]; then
|
||||
VERSION_FILE=$1
|
||||
if ! [ -f ${VERSION_FILE} ]; then
|
||||
echo "binary file ${VERSION_FILE} does not exist"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
else
|
||||
echo "no binary file provided"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
SCRIPT_ABS_PATH=$(realpath $0)
|
||||
SCRIPT_PATH=$(dirname ${SCRIPT_ABS_PATH})
|
||||
PACKAGES_PATH=${SCRIPT_PATH}/debian
|
||||
CHANGELOG_SCRIPT=generate_changelog.sh
|
||||
BUILD_DIR=build-opt
|
||||
ROOT_ABS_PATH=$(cd ${SCRIPT_PATH}; while [ ! -d ${BUILD_DIR} ]; do cd ..; done ; pwd)
|
||||
REPO_PATH=${ROOT_ABS_PATH}
|
||||
ROOT_ABS_PATH=$(realpath $SCRIPT_PATH/../..)
|
||||
TEMP_WORK_DIR=$(mktemp -d)
|
||||
BASE_DIR=${TEMP_WORK_DIR}/packages
|
||||
BASE_PATH=${BASE_DIR}/dragonfly
|
||||
|
@ -37,16 +48,6 @@ function cleanup {
|
|||
exit 1
|
||||
}
|
||||
|
||||
if [ $# -ge 1 ]; then
|
||||
VERSION_FILE=$1
|
||||
else
|
||||
if ! [ -f ${ROOT_ABS_PATH}/${BUILD_DIR}/dragonfly ]; then
|
||||
cleanup "no dragonfly binary found at ${ROOT_ABS_PATH}/${BUILD_DIR}"
|
||||
else
|
||||
VERSION_FILE=${ROOT_ABS_PATH}/${BUILD_DIR}/dragonfly
|
||||
fi
|
||||
fi
|
||||
|
||||
mkdir -p ${BASE_PATH} || cleanup "failed to create working directory for building the package"
|
||||
|
||||
cp -r ${PACKAGES_PATH} ${BASE_PATH} || cleanup "failed to copy required files for the package build from ${PACKAGES_PATH}"
|
||||
|
@ -57,7 +58,7 @@ mkdir -p ${BINARY_TARGET_DIR} || cleanup "failed to create install directory for
|
|||
|
||||
cp ${VERSION_FILE} ${BINARY_TARGET_DIR}/dragonfly || cleanup "failed to copy binary to target dir"
|
||||
|
||||
${BASE_PATH}/${CHANGELOG_SCRIPT} ${REPO_PATH} || cleanup "failed to generate changelog for package"
|
||||
${BASE_PATH}/${CHANGELOG_SCRIPT} ${ROOT_ABS_PATH} || cleanup "failed to generate changelog for package"
|
||||
|
||||
MY_DIR=${PWD}
|
||||
cd ${BASE_PATH}
|
||||
|
@ -77,4 +78,3 @@ cd ${MY_DIR}
|
|||
RESULT_FILE=$(ls *.deb 2>/dev/null)
|
||||
echo "successfully built the install package at ${MY_DIR}/${RESULT_FILE}"
|
||||
rm -rf ${TEMP_WORK_DIR}
|
||||
exit 0
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
APP_PATH=build-release/dragonfly
|
||||
RELEASE_DIR=build-release
|
||||
APP_PATH=$RELEASE_DIR/dragonfly
|
||||
|
||||
set -e
|
||||
|
||||
|
@ -22,6 +23,7 @@ if ! [ -f ${APP_PATH} ]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
echo "Running ${APP_PATH} --version"
|
||||
${APP_PATH} --version
|
||||
|
||||
if readelf -a ${APP_PATH} | grep GLIBC_PRIVATE >/dev/null 2>&1 ; then
|
||||
|
@ -31,3 +33,5 @@ if readelf -a ${APP_PATH} | grep GLIBC_PRIVATE >/dev/null 2>&1 ; then
|
|||
fi
|
||||
|
||||
make package
|
||||
echo "Release package created: "
|
||||
ls -lh $RELEASE_DIR/
|
||||
|
|
Loading…
Reference in a new issue