Skip to content

Commit

Permalink
Fix the release process and delete -Werror when we generate the tarball
Browse files Browse the repository at this point in the history
  • Loading branch information
dinosaure committed Apr 5, 2024
1 parent 6ebb32c commit 8b5eaf6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
10 changes: 8 additions & 2 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,23 +53,29 @@ distrib-gen-version-h:
@echo "GEN $(VERSION_H).distrib"
scripts/gen_version_h.sh $(VERSION_H).distrib

delete-werror:
sed -i -e 's/-Werror//g' Makefile.common

# The following target should be used to generate a release tarball of Solo5.
# The tarball will be generated from the currently checked-out branch. Note that
# some files related to CI or E2E tests are deliberately not included, see
# .gitattributes for a list.
.PHONY: distrib
distrib: GIT_VERSION = $(shell git -C . describe --dirty --tags --always)
distrib: GIT_VERSION = $(shell git -C . describe --tags --always)
distrib: GIT_OLDBRANCH = $(shell git rev-parse --abbrev-ref HEAD)
distrib: distrib-gen-version-h
distrib: distrib-gen-version-h delete-werror
git checkout -b distrib/$(GIT_VERSION)
git add $(VERSION_H).distrib
git add Makefile.common
git commit -m "Release tarball for $(GIT_VERSION)"
@echo DISTRIB solo5-$(GIT_VERSION).tar.gz
git archive --format=tar.gz --prefix=solo5-$(GIT_VERSION)/ \
distrib/$(GIT_VERSION) >solo5-$(GIT_VERSION).tar.gz
GIT_VERSION=$(GIT_VERSION) ./scripts/opam-release.sh
-git checkout $(GIT_OLDBRANCH)
-git branch -D distrib/$(GIT_VERSION)
$(RM) $(VERSION_H).distrib
git checkout -- Makefile.common

$(SUBDIRS):
@echo "MAKE $@"
Expand Down
5 changes: 3 additions & 2 deletions scripts/opam-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ if [ ! -d "./opam" ]; then
exit 1
fi

GIT_VERSION=$(git -C . describe --dirty --tags --always)
echo $GIT_VERSION
GIT_VERSION=${GIT_VERSION:-$(git -C . describe --tags --always)}

DEV=
if ! echo "$GIT_VERSION" | grep -q -E '^v[0-9]+.[0-9]+.[0-9]+$'; then
Expand All @@ -22,7 +23,7 @@ if ! echo "$GIT_VERSION" | grep -q -E '^v[0-9]+.[0-9]+.[0-9]+$'; then
fi

WERROR=$(git grep -c ' -Werror' Makefile.common | cut -d ':' -f 2)
if [ "$WERROR" -gt 0 ]; then
if [ -n "$WERROR" ]; then
echo "ERROR: There are occurences of '-Werror' in 'Makefile.common'."
echo "ERROR: This is almost certainly not what you want."
exit 1
Expand Down

0 comments on commit 8b5eaf6

Please sign in to comment.