Skip to content

Commit

Permalink
build: package release changelog for releases
Browse files Browse the repository at this point in the history
Package the changelog for the release line as `CHANGELOG.md` when
building a release binary tarball.

PR-URL: #38033
Fixes: #38025
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Beth Griggs <bgriggs@redhat.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
richardlau authored and targos committed May 1, 2021
1 parent dd8c9ad commit 079d90b
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Makefile
Expand Up @@ -767,6 +767,7 @@ docclean:

RAWVER=$(shell $(PYTHON) tools/getnodeversion.py)
VERSION=v$(RAWVER)
CHANGELOG=doc/changelogs/CHANGELOG_V$(firstword $(subst ., ,$(RAWVER))).md

# For nightly builds, you must set DISTTYPE to "nightly", "next-nightly" or
# "custom". For the nightly and next-nightly case, you need to set DATESTRING
Expand Down Expand Up @@ -954,6 +955,15 @@ release-only: check-xz
echo "" >&2 ; \
exit 1 ; \
fi
@if [ "$(RELEASE)" = "0" -o -f "$(CHANGELOG)" ]; then \
exit 0; \
else \
echo "" >&2 ; \
echo "#NODE_VERSION_IS_RELEASE is set to $(RELEASE) but " >&2 ; \
echo "$(CHANGELOG) does not exist." >&2 ; \
echo "" >&2 ; \
exit 1 ; \
fi

$(PKG): release-only
$(RM) -r $(MACOSOUTDIR)
Expand Down Expand Up @@ -1121,7 +1131,11 @@ $(BINARYTAR): release-only
$(MAKE) install DESTDIR=$(BINARYNAME) V=$(V) PORTABLE=1
cp README.md $(BINARYNAME)
cp LICENSE $(BINARYNAME)
ifeq ("$(wildcard $(CHANGELOG))","")
cp CHANGELOG.md $(BINARYNAME)
else
cp $(CHANGELOG) $(BINARYNAME)/CHANGELOG.md
endif
ifeq ($(OSTYPE),darwin)
SIGN="$(CODESIGN_CERT)" PKGDIR="$(BINARYNAME)" sh tools/osx-codesign.sh
endif
Expand Down

0 comments on commit 079d90b

Please sign in to comment.