From 72ac43e88865fd9451b40fcc22fec1ec5e4f9b53 Mon Sep 17 00:00:00 2001 From: Jan Janak Date: Thu, 18 Aug 2022 15:33:28 +0200 Subject: [PATCH] Create source tarball during release Closes #93 --- tools/release.sh | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/tools/release.sh b/tools/release.sh index 0e191da..10cac59 100755 --- a/tools/release.sh +++ b/tools/release.sh @@ -51,26 +51,29 @@ fi new_tag="v$version" name="$basename-$version" +# Create the tag in the local git repository clone. Fail if the tag already +# exists. Create a signed and annotated tag. +git tag -s -a "$new_tag" -m "Version $version" + +# Generate the files VERSION and LIB_VERSION so that they can be included in the +# source tarball (which does not contain git version information). make VERSION LIB_VERSION # Create a source code tarball for the release that can be built without git. echo -n "Creating source tarball..." -tar --exclude .git \ - --exclude *.bin \ - --exclude *.hex \ - --exclude *.map \ - --exclude *.tar.gz \ - --exclude obj \ - --exclude .gitmodules \ + +command -v gtar &>/dev/null && tar=gtar || tar=tar +$tar --exclude .git \ + --exclude *.bin \ + --exclude *.hex \ + --exclude *.map \ + --exclude *.tar.gz \ + --exclude obj \ + --exclude .gitmodules \ + --transform "s,^,$name/," \ -zcf $name.tar.gz . echo "done." -exit 0 - -# Create the tag in the local git repository clone. Fail if the tag already -# exists. Create a signed and annotated tag. -git tag -s -a "$new_tag" -m "Version $version" - # Build both release and debug versions of the firmware binary make release make debug