Skip to content

Commit 8b5eaf6

Browse files
committed
Fix the release process and delete -Werror when we generate the tarball
1 parent 6ebb32c commit 8b5eaf6

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

GNUmakefile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,23 +53,29 @@ distrib-gen-version-h:
5353
@echo "GEN $(VERSION_H).distrib"
5454
scripts/gen_version_h.sh $(VERSION_H).distrib
5555

56+
delete-werror:
57+
sed -i -e 's/-Werror//g' Makefile.common
58+
5659
# The following target should be used to generate a release tarball of Solo5.
5760
# The tarball will be generated from the currently checked-out branch. Note that
5861
# some files related to CI or E2E tests are deliberately not included, see
5962
# .gitattributes for a list.
6063
.PHONY: distrib
61-
distrib: GIT_VERSION = $(shell git -C . describe --dirty --tags --always)
64+
distrib: GIT_VERSION = $(shell git -C . describe --tags --always)
6265
distrib: GIT_OLDBRANCH = $(shell git rev-parse --abbrev-ref HEAD)
63-
distrib: distrib-gen-version-h
66+
distrib: distrib-gen-version-h delete-werror
6467
git checkout -b distrib/$(GIT_VERSION)
6568
git add $(VERSION_H).distrib
69+
git add Makefile.common
6670
git commit -m "Release tarball for $(GIT_VERSION)"
6771
@echo DISTRIB solo5-$(GIT_VERSION).tar.gz
6872
git archive --format=tar.gz --prefix=solo5-$(GIT_VERSION)/ \
6973
distrib/$(GIT_VERSION) >solo5-$(GIT_VERSION).tar.gz
74+
GIT_VERSION=$(GIT_VERSION) ./scripts/opam-release.sh
7075
-git checkout $(GIT_OLDBRANCH)
7176
-git branch -D distrib/$(GIT_VERSION)
7277
$(RM) $(VERSION_H).distrib
78+
git checkout -- Makefile.common
7379

7480
$(SUBDIRS):
7581
@echo "MAKE $@"

scripts/opam-release.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ if [ ! -d "./opam" ]; then
1212
exit 1
1313
fi
1414

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

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

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

0 commit comments

Comments
 (0)