Skip to content

Commit

Permalink
build: Add release.mk
Browse files Browse the repository at this point in the history
Makefile used to tag and create official tarballs.

Signed-off-by: Jan Friesse <[email protected]>
  • Loading branch information
jfriesse committed Oct 12, 2023
1 parent 375e60a commit 10004d1
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ EXTRA_DIST = autogen.sh conf/booth.conf.example \
contrib \
$(SPEC).in booth-rpmlintrc \
.version build-aux/git-version-gen build-aux/PKG_CHECK_VAR.m4 \
build-aux/gitlog-to-changelog
build-aux/gitlog-to-changelog build-aux/release.mk

AUTOMAKE_OPTIONS = foreign

Expand Down
55 changes: 55 additions & 0 deletions build-aux/release.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# to build official release tarballs, handle tagging and publish.

# example:
# make -f build-aux/release.mk all version=1.1 release=yes

project=booth

all: checks setup tag tarballs sha256

checks:
ifeq (,$(version))
@echo ERROR: need to define version=
@exit 1
endif
@if [ ! -d .git ]; then \
echo This script needs to be executed from top level cluster git tree; \
exit 1; \
fi

@if ! grep "fallback $(version)" configure.ac > /dev/null; then \
echo "Don't forget update fallback version in configure.ac before release"; \
exit 1; \
fi

setup: checks
./autogen.sh
./configure --without-glue
make maintainer-clean

tag: setup ./tag-$(version)

tag-$(version):
ifeq (,$(release))
@echo Building test release $(version), no tagging
else
git tag -a -m "v$(version) release" v$(version) HEAD
@touch $@
endif

tarballs: tag
./autogen.sh
./configure --without-glue
BOOTH_RUNTESTS_ROOT_USER=1 make distcheck DISTCHECK_CONFIGURE_FLAGS="--without-glue"

sha256: tarballs $(project)-$(version).sha256

$(project)-$(version).sha256:
ifeq (,$(release))
@echo Building test release $(version), no sha256
else
sha256sum $(project)-$(version)*tar* | sort -k2 > $@
endif

clean:
rm -rf $(project)-* tag-*

0 comments on commit 10004d1

Please sign in to comment.