1
0
Fork 0
mirror of https://github.com/dragonflydb/dragonfly.git synced 2024-12-14 11:58:02 +00:00

chore: reduce Makefile for release procedures only (#2397)

Also, change its build directory to build-release.
Simplify a bit its configuration steps as well. No change in functionality is expected.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
This commit is contained in:
Roman Gershman 2024-01-11 06:35:57 +02:00 committed by GitHub
parent 4874da8b5b
commit e84bc7586a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 32 deletions

View file

@ -8,6 +8,9 @@ on:
permissions:
contents: write
env:
RELEASE_DIR: build-release
jobs:
create-release:
runs-on: ubuntu-latest
@ -34,8 +37,8 @@ jobs:
uses: actions/cache@v3
with:
path: |
${{github.workspace}}/build-opt/
!${{github.workspace}}/build-opt/CMakeCache.txt
${{github.workspace}}/${{ env.RELEASE_DIR }}/
!${{github.workspace}}/${{ env.RELEASE_DIR }}/CMakeCache.txt
key: ${{ runner.os }}-release-deps-${{ github.sha }}
#restore-keys: |
# ${{ runner.os }}-release-deps-
@ -70,19 +73,19 @@ jobs:
cd /src
git describe --always --tags ${{ github.sha }}
if [ -d build-opt ]; then
chown -R root build-opt
ls -l ./build-opt
for i in `ls -d ./build-opt/_deps/*-src`; do
if [ -d ${{ env.RELEASE_DIR }} ]; then
chown -R root ${{ env.RELEASE_DIR }}
ls -l ./${{ env.RELEASE_DIR }}
for i in `ls -d ./${{ env.RELEASE_DIR }}/_deps/*-src`; do
git config --global --add safe.directory $(realpath $i)
done
fi
./tools/release.sh
./tools/packaging/generate_debian_package.sh build-opt/dragonfly-aarch64
mv dragonfly_*.deb build-opt/
./tools/packaging/generate_debian_package.sh ${{ env.RELEASE_DIR }}/dragonfly-aarch64
mv dragonfly_*.deb ${{ env.RELEASE_DIR }}/
- name: Show the artifact
# Items placed in /src/build-opt in the container will be in
# ${PWD}/build-opt on the host.
# Items placed in /src/${{ env.RELEASE_DIR }} in the container will be in
# ${PWD}/${{ env.RELEASE_DIR }} on the host.
run: |
echo finished
ls -al
@ -91,8 +94,8 @@ jobs:
with:
name: dragonfly-aarch64
path: |
build-opt/dragonfly-*tar.gz
build-opt/dragonfly_*.deb
${{ env.RELEASE_DIR }}/dragonfly-*tar.gz
${{ env.RELEASE_DIR }}/dragonfly_*.deb
build-native:
runs-on: ubuntu-latest
@ -124,10 +127,10 @@ jobs:
./tools/release.sh
# once the build is over, we want to generate a Debian package
if [ -f /etc/debian_version ]; then
./tools/packaging/generate_debian_package.sh build-opt/dragonfly-x86_64
./tools/packaging/generate_debian_package.sh ${{ env.RELEASE_DIR }}/dragonfly-x86_64
else
echo "Creating package for ${{github.ref_name}}"
./tools/packaging/rpm/build_rpm.sh build-opt/dragonfly-x86_64.tar.gz ${{github.ref_name}}
./tools/packaging/rpm/build_rpm.sh ${{ env.RELEASE_DIR }}/dragonfly-x86_64.tar.gz ${{github.ref_name}}
fi
- name: Run regression tests
@ -138,13 +141,13 @@ jobs:
dfly-executable: dragonfly-x86_64
gspace-secret: ${{ secrets.GSPACES_BOT_DF_BUILD }}
run-only-on-ubuntu-latest: true
build-folder-name: build-opt
build-folder-name: ${{ env.RELEASE_DIR }}
- name: Save artifacts
run: |
# place all artifacts at the same location
mkdir -p results-artifacts
if [ -f /etc/debian_version ]; then
mv build-opt/dragonfly-*tar.gz results-artifacts
mv ${{ env.RELEASE_DIR }}/dragonfly-*tar.gz results-artifacts
mv dragonfly_*.deb results-artifacts
else
ls -l *.rpm

View file

@ -1,8 +1,5 @@
BUILD_ARCH := $(shell uname -m)
RELEASE_NAME := "dragonfly-${BUILD_ARCH}"
HELIO_RELEASE := $(if $(HELIO_RELEASE),y,)
HELIO_RELEASE_FLAGS = -DHELIO_RELEASE_FLAGS="-g"
HELIO_USE_STATIC_LIBS = ON
HELIO_OPENSSL_USE_STATIC_LIBS = ON
@ -20,11 +17,9 @@ endif
# For release builds we link statically libstdc++ and libgcc. Currently,
# all the release builds are performed by gcc.
ifeq ($(HELIO_RELEASE),y)
LINKER_FLAGS += -static-libstdc++ -static-libgcc
endif
LINKER_FLAGS += -static-libstdc++ -static-libgcc
HELIO_FLAGS = $(if $(HELIO_RELEASE),-release $(HELIO_RELEASE_FLAGS),) \
HELIO_FLAGS = -DHELIO_RELEASE_FLAGS="-g" \
-DCMAKE_EXE_LINKER_FLAGS="$(LINKER_FLAGS)" \
-DBoost_USE_STATIC_LIBS=$(HELIO_USE_STATIC_LIBS) \
-DOPENSSL_USE_STATIC_LIBS=$(HELIO_OPENSSL_USE_STATIC_LIBS) \
@ -34,18 +29,14 @@ HELIO_FLAGS = $(if $(HELIO_RELEASE),-release $(HELIO_RELEASE_FLAGS),) \
.PHONY: default
configure:
./helio/blaze.sh $(HELIO_FLAGS)
cmake -L -B build-release -DCMAKE_BUILD_TYPE=Release -GNinja $(HELIO_FLAGS)
build:
cd build-opt; \
ninja dragonfly && ldd dragonfly
build-debug:
cd build-dbg; \
cd build-release; \
ninja dragonfly && ldd dragonfly
package:
cd build-opt; \
cd build-release; \
objcopy \
--remove-section=".debug_*" \
--remove-section="!.debug_line" \
@ -56,6 +47,4 @@ package:
release: configure build
release-debug: configure build-debug
default: release