mxml/makesrcdist

83 lines
1.9 KiB
Plaintext
Raw Normal View History

2003-06-03 20:28:21 +00:00
#!/bin/sh
#
# makesrcdist - make a source distribution of Mini-XML.
#
# https://www.msweet.org/mxml
#
# Copyright © 2003-2024 by Michael R Sweet.
#
# Licensed under Apache License v2.0. See the file "LICENSE" for more
# information.
2003-06-03 20:28:21 +00:00
#
if test $# != 1; then
echo "Usage: ./makesrcdist version"
exit 1
2003-06-03 20:28:21 +00:00
fi
# Check that various files are up-to-date...
version=$1
2003-06-03 20:28:21 +00:00
version_major=$(echo $version | awk -F. '{print $1}')
version_minor=$(echo $version | awk -F. '{print $2}')
status=0
if ! grep -q "Changes in Mini-XML $version" CHANGES.md; then
echo "Update CHANGES.md."
status=1
fi
if test "$(grep AC_INIT configure.ac | awk '{print $2}')" != "[$version],"; then
echo "Update configure.ac."
status=1
fi
if test "$(grep MXML_MAJOR_VERSION mxml.h | awk '{print $4}')" != "$version_major"; then
echo "Update MXML_MAJOR_VERSION in mxml.h."
status=1
fi
if test "$(grep MXML_MINOR_VERSION mxml.h | awk '{print $4}')" != "$version_minor"; then
echo "Update MXML_MINOR_VERSION in mxml.h."
status=1
fi
if ! grep -q "Version: $version" mxml.spec; then
echo "Update mxml.spec."
status=1
fi
2024-03-20 16:14:01 +00:00
if ! grep -q "<version>$version</version>" vcnet/libmxml4_native.nuspec; then
echo "Update vcnet/libmxml4_native.nuspec."
status=1
fi
2024-03-20 16:14:01 +00:00
if ! grep -q "version=\"$version\" />" vcnet/libmxml4_native.nuspec; then
echo "Update vcnet/libmxml4_native.nuspec."
status=1
fi
2024-03-20 16:14:01 +00:00
if ! grep -q "<version>$version</version>" vcnet/libmxml4_native.redist.nuspec; then
echo "Update vcnet/libmxml4_native.redist.nuspec."
status=1
fi
if test $status = 1; then
exit 1
fi
# Create tag and archives...
echo Creating tag for release...
git tag -m "Tag $version" v$version
git push origin v$version
2003-06-03 20:28:21 +00:00
echo Creating mxml-$version.tar.gz...
git archive --format tar --prefix=mxml-$version/ HEAD | gzip -v9 >mxml-$version.tar.gz
gpg --detach-sign mxml-$version.tar.gz
2021-11-06 14:12:49 +00:00
echo Creating mxml-$version.zip...
git archive --format zip --prefix=mxml-$version/ HEAD >mxml-$version.zip
gpg --detach-sign mxml-$version.zip