-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrelease
executable file
·64 lines (60 loc) · 2.46 KB
/
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
#!/bin/bash
if [ $# != 1 ]
then
echo "Usage: $0 <version>" >&2
exit 1
fi
VERSION="$1"
AUTHOR="Julien Bigot <[email protected]>"
DEB_DATE="$(date -R)"
RPM_DATE="$(LC_ALL=C date "+%a %b %d %Y")"
DEB_PKG_VERSION="$(echo "${VERSION}"|sed 's/-/~/g')"
RPM_PKG_VERSION="$(echo "${VERSION}"|sed 's/-/~/g')"
BCF_SRC_VERSION="{upstream_version}"
RPM_SRC_VERSION="%{version}"
if [ "x${VERSION}" != "x${DEB_PKG_VERSION}" ]
then
BCF_SRC_VERSION="${VERSION}"
RPM_SRC_VERSION="${VERSION}"
fi
if [[ ! ${VERSION} =~ ^[0-9].* ]]
then
DEB_PKG_VERSION="$(date '+%s')${VERSION}"
BCF_SRC_VERSION="${VERSION}"
fi
if [ "x${VERSION}" == "xmain" ]
then
AUTHOR="Pending release on main <[email protected]>"
sed \
-e "1{h;s/(.*$/(${DEB_PKG_VERSION}-1) unstable devel; urgency=medium\n\n * Upstream release ${VERSION}\n\n -- ${AUTHOR} ${DEB_DATE}\n/;p;x}" \
-i pdi/debian/changelog pdiplugin*/debian/changelog
sed \
-e 's/path: "/path: "pdi-main./' \
-e 's#url: "https://repo.pdi.dev/#url: "https://repo.pdi.dev/pdi-main.#' \
-e "s%https://github\.com/pdidev/pdi/archive/[a-zA-Z0-9{}%_/]*\.tar.gz%https://github.com/pdidev/pdi/archive/refs/heads/main.tar.gz%" \
-i build.conf
sed \
-e "s/%changelog/%changelog\n\* ${RPM_DATE} - ${AUTHOR}\n- Upstream release main/" \
-e "s#https://github\.com/pdidev/pdi/archive/[a-zA-Z0-9{}%_/]*\.tar.gz#https://github.com/pdidev/pdi/archive/refs/heads/main.tar.gz#" \
-i pdi*/*.spec
else
sed \
-e 's/path: "pdi-main\./path: "/' \
-e 's#url: "https://repo.pdi.dev/pdi-main.#url: "https://repo.pdi.dev/#' \
-e "s%https://github\.com/pdidev/pdi/archive/[a-zA-Z0-9{}%_/]*\.tar.gz%https://github.com/pdidev/pdi/archive/refs/tags/${BCF_SRC_VERSION}.tar.gz%" \
-i build.conf
sed \
-e "s#https://github\.com/pdidev/pdi/archive/[a-zA-Z0-9{}%_/]*\.tar.gz#https://github.com/pdidev/pdi/archive/refs/tags/${RPM_SRC_VERSION}.tar.gz#" \
-i pdi*/*.spec
fi
sed \
-e "s/Pending release on main <[email protected]> [A-Za-z]*, [0-9]* [A-Za-z]* [0-9]* [0-9]*:[0-9]*:[0-9]* +[0-9]*/${AUTHOR} ${DEB_DATE}/" \
-e "s/([0-9]*main-1)/(${DEB_PKG_VERSION}-1)/" \
-e "s/\* Upstream release main/* Upstream release ${VERSION}/" \
-i pdi/debian/changelog pdiplugin*/debian/changelog
sed \
-e "s/[A-Za-z]* [A-Za-z]* [0-9]* [0-9]* - Pending release on main <[email protected]>/${RPM_DATE} - ${AUTHOR}/" \
-e "s/Version: .*/Version: ${RPM_PKG_VERSION}/" \
-e "s/- Upstream release main/- Upstream release ${VERSION}/" \
-e "s/=\s*main\b/= %{version}/" \
-i pdi*/*.spec