forked from fedora-java/xmvn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
make_release
executable file
·65 lines (55 loc) · 1.6 KB
/
make_release
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
#!/bin/sh
# Copyright (c) 2012-2020 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Written by Mikolaj Izdebski <mizdebsk@redhat.com>
set -e
name=xmvn
ver=$(git describe --tags)
# Decimal integer >= 0
number="(0|[1-9][0-9]*)"
# Allowed format of release version
version_regex="^${number}[.]${number}[.]${number}$"
if ! grep -qE "${version_regex}" <<<"${ver}"; then
cat >&2 <<EOF
Current version '${ver}' is not a correct release version.
Release versions must be in format maj.min.rel; maj >= 0, min >= 0 and rel >= 0
(they must match ${version_regex} regex).
EOF
exit 1
fi
tarball=${name}-${ver}.tar.xz
git archive -v --prefix=${name}-${ver}/ ${ver} | xz >${tarball}
read -e -p "Upload ${tarball} to fedorahosted.org? (y/N): "
if [ "$REPLY" = y ]; then
git push --tags
scp ${tarball} fedorahosted.org:/srv/web/releases/x/m/xmvn/
fi
news=$(sed -n '
/^*/ {
s/..//
:l
s/^ //
p
n
s/^*//
Tl
q
}' src/site/apt/news.apt)
echo
tee news-${ver}.eml <<EOF
To: Fedora Java Development List <java-devel@lists.fedoraproject.org>
Subject: XMvn ${ver} release notes
${news}
EOF