2
0

Only distribute release tags, include TAG and VERSION.

This commit is contained in:
Maarten Billemont 2017-09-04 14:43:26 -04:00
parent 3d46f60ff4
commit 895df6377d
2 changed files with 8 additions and 6 deletions

View File

@ -5,6 +5,7 @@ mpw
mpw-bench mpw-bench
mpw-tests mpw-tests
TAG
VERSION VERSION
mpw-*.tar.gz mpw-*.tar.gz
mpw-*.tar.gz.sig mpw-*.tar.gz.sig

View File

@ -2,11 +2,11 @@
set -e set -e
cd "${BASH_SOURCE%/*}" cd "${BASH_SOURCE%/*}"
tag=$(git describe --match '*-cli*') tag=$(git describe --exact-match --match '*-cli*') || { echo >&2 "Tree is not at a release tag."; exit 1; }
commit=$(git describe --long --dirty --match '*-cli*') version=$(git describe --match '*-cli*' --long --dirty --broken)
[[ $commit != *-dirty ]] || { echo >&2 "Tree is dirty, first commit any changes."; exit 1; } [[ $version != *-dirty ]] || { echo >&2 "Tree is dirty, first commit any changes."; exit 1; }
mpwArchive=mpw-$commit.tar.gz mpwArchive=mpw-$version.tar.gz
[[ -e $mpwArchive ]] && echo >&2 "WARNING: $mpwArchive already exists. Will overwrite." [[ -e $mpwArchive ]] && echo >&2 "WARNING: $mpwArchive already exists. Will overwrite."
read -n1 -p "Will prepare and release $mpwArchive. Press a key to continue or ^C to abort." read -n1 -p "Will prepare and release $mpwArchive. Press a key to continue or ^C to abort."
@ -14,8 +14,9 @@ echo "Cleaning .."
( git clean -ffdx . && cd core && git clean -ffdx . ) ( git clean -ffdx . && cd core && git clean -ffdx . )
echo "Creating archive $mpwArchive .." echo "Creating archive $mpwArchive .."
git show --show-signature --pretty=format:%H --quiet "$tag" > VERSION echo "$version" > VERSION
{ git ls-files -z .; printf VERSION; } | xargs -0 tar -Lcvzf "$mpwArchive" git show --show-signature --pretty=format:%H --quiet "$tag" > TAG
{ git ls-files -z .; printf '%s\0' VERSION TAG; } | xargs -0 tar -Lcvzf "$mpwArchive"
echo "Creating archive signature $mpwArchive.sig .." echo "Creating archive signature $mpwArchive.sig .."
gpg --detach-sign "$mpwArchive" gpg --detach-sign "$mpwArchive"