-
-
Notifications
You must be signed in to change notification settings - Fork 163
/
makesrcdist
executable file
·82 lines (65 loc) · 1.94 KB
/
makesrcdist
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#!/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.
#
if test $# != 1; then
echo "Usage: ./makesrcdist version"
exit 1
fi
# Check that various files are up-to-date...
version=$1
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
if ! grep -q "<version>$version</version>" vcnet/libmxml4_native.nuspec; then
echo "Update vcnet/libmxml4_native.nuspec."
status=1
fi
if ! grep -q "version=\"$version\" />" vcnet/libmxml4_native.nuspec; then
echo "Update vcnet/libmxml4_native.nuspec."
status=1
fi
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
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
echo Creating mxml-$version.zip...
git archive --format zip --prefix=mxml-$version/ HEAD >mxml-$version.zip
gpg --detach-sign mxml-$version.zip