File: release.sh

package info (click to toggle)
kadu 4.1-1.1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 54,532 kB
  • sloc: cpp: 128,331; sh: 988; awk: 105; makefile: 75
file content (246 lines) | stat: -rwxr-xr-x 5,757 bytes parent folder | download | duplicates (2)
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
#!/usr/bin/env bash

function expand_version()
{
	if [[ $VERSION =~ ^[0-9]+\.[0-9]+(\.[0-9]+)?$ ]];
	then
		export BRANCH=STABLE
		export EN_TEST=stable
		export PL_TEST=stabilna
	else
		export BRANCH=UNSTABLE
		export EN_TEST=test
		export PL_TEST=testowa
	fi

	[[ $VERSION =~ ^([0-9]+)\..+$ ]]
	export MAIN=${BASH_REMATCH[1]}
}

function prepare_links()
{
	export SOURCE_SF=https://sourceforge.net/projects/kadu/files/kadu/$VERSION/kadu-$VERSION.tar.bz2/download
	export SOURCE_KADU=http://download.kadu.im/unstable/kadu-$VERSION.tar.bz2
	export SOURCE_KADU_MD5=http://download.kadu.im/unstable/kadu-$VERSION.tar.bz2.md5
	export SOURCE_KADU_SHA1=http://download.kadu.im/unstable/kadu-$VERSION.tar.bz2.sha1
	export EXE_SF=https://sourceforge.net/projects/kadu/files/kadu/$VERSION/Kadu-$VERSION.x86.exe/download
	export EXE_KADU=http://download.kadu.im/unstable/windows/Kadu-$VERSION.x86.exe
	export EXE_KADU_MD5=http://download.kadu.im/unstable/windows/Kadu-$VERSION.x86.exe.md5
	export EXE_KADU_SHA1=http://download.kadu.im/unstable/windows/Kadu-$VERSION.x86.exe.sha1
}

function read_changelog()
{
	CHANGELOG=""
	while read line; do
		if [[ -z "$line" ]]; then
			break
		fi
		if [[ "$line" =~ ^\*.* ]]; then
			if [[ -z "$CHANGELOG" ]]; then
				CHANGELOG=$line
			else
				CHANGELOG="$CHANGELOG
$line"
			fi
		fi
	done < ChangeLog

	export CHANGELOG=$CHANGELOG
}

function update_version_file()
{
	echo $VERSION > VERSION

	git commit -a -m "version: update to $VERSION"
}

function git_tag()
{
	git tag $VERSION
	git push origin $VERSION
}

function create_package()
{
	pushd package
	../scripts/create-package.sh $VERSION
	popd
}

function build_binary()
{
	rm -rf package-build
	mkdir package-build
	pushd package-build
	cmake ../package/kadu-$VERSION/
	make -j4
	popd
}

function write_forum_entry()
{
	pushd package
	cat > forum <<-END
		Nowa $PL_TEST wersja Kadu z serii $MAIN została właśnie wydana!

		Notka o wydaniu:
		 http://www.kadu.im/w/NotkaOWydaniu$MAIN
		 http://www.kadu.im/w/English:ReleaseNotes$MAIN

		Zmiany:
		$CHANGELOG

		Instalator Windows i sumy kontrolne:
		 $EXE_SF
		 $EXE_KADU
		 $EXE_KADU_MD5
		 $EXE_KADU_SHA1

		Źródła i sumy kontrolne:
		 $SOURCE_SF
		 $SOURCE_KADU
		 $SOURCE_KADU_MD5
		 $SOURCE_KADU_SHA1

		Przed instalacją zalecane jest zrobienie kopii katalogu z danymi ~/.kadu lub C:\Users\..\AppData\Roaming\Kadu.
		Błędy jak zawsze proszę zgłaszac na redmine: http://www.kadu.im/redmine/
END

	popd
}

function write_mailing_list_entry()
{
	pushd package
	cat > mailing-list <<-END
		New $EN_TEST version of Kadu $MAIN series is available.

		Release notes:
		 http://www.kadu.im/w/English:ReleaseNotes$MAIN
		 http://www.kadu.im/w/NotkaOWydaniu$MAIN

		Changes:
		$CHANGELOG

		Windows installer and checksums:
		 $EXE_SF
		 $EXE_KADU
		 $EXE_KADU_MD5
		 $EXE_KADU_SHA1

		Source code:
		 $SOURCE_SF
		 $SOURCE_KADU
		 $SOURCE_KADU_MD5
		 $SOURCE_KADU_SHA1

		Please create backup of data directory ~/.kadu or C:\Users\..\AppData\Roaming\Kadu before installing.
		Please report all found bugs in redmine: http://www.kadu.im/redmine/

		Regards,
		Rafał Malinowski
END

	popd
}

function write_pl_wiki_entry()
{
	DATE=`date +"%d.%m.%Y"`

	pushd package
	cat > wiki-pl <<-END
		=== Kadu $VERSION wydane ''($DATE)'' ===
		----

		Nowa $PL_TEST wersja Kadu z serii $MAIN została właśnie wydana!

		Notka o wydaniu:
		* [[NotkaOWydaniu$MAIN|Wersja polska]]
		* [[English:ReleaseNotes$MAIN|Wersja angielska]]

		'''Pobierz''':
		:: Źródła dla systemu Linux ([[Instalacja_ze_źródeł|opis instalacji tej wersji Kadu]]):
		::: [$SOURCE_SF Pobierz źródła (serwer SourceForge.net)]
		::: [$SOURCE_KADU Pobierz źródła (serwer Kadu.im)]
		::: [$SOURCE_KADU_MD5 Suma MD5]
		::: [$SOURCE_KADU_SHA1 Suma SHA1]
		:: Instalator Windows:
		::: [$EXE_SF Pobierz Instalator Windows (SourceForge.net)]
		::: [$EXE_KADU Pobierz Instalator Windows (Kadu.im)]
		::: [$EXE_KADU_MD5 Suma MD5]
		::: [$EXE_KADU_SHA1 Suma SHA1]

		Zmiany:
		$CHANGELOG

		Przed instalacją zalecane jest zrobienie kopii katalogu z danymi ~/.kadu lub C:\Users\..\AppData\Roaming\Kadu.

		Błędy prosimy zgłaszać w naszym systemie śledzenia błędów [http://www.kadu.im/redmine Redmine], a propozycje zmian na [http://www.kadu.im/forum forum] w dziale o odpowiednim tytule. Listę znany błędów zaplanowanych do poprawienia w przyszłych wersjach również można znaleźć w Redmine, w [http://www.kadu.im/redmine/projects/kadu/roadmap mapie dla projektu Kadu].

		<p>
		</p>
END

	popd
}

function write_en_wiki_entry()
{
	DATE=`date +"%d/%m/%Y"`

	pushd package
	cat > wiki-en <<-END
		=== Kadu $VERSION has been released ''($DATE)'' ===
		----

		New $EN_TEST version of Kadu $MAIN series is available.

		Release notes:
		* [[English:ReleaseNotes$MAIN|English version]]
		* [[NotkaOWydaniu$MAIN|Polish version]]

		'''Download''':
		:: Source code:
		::: [$SOURCE_SF Download Sources (SourceForge.net)]
		::: [$SOURCE_KADU Download Sources (Kadu.im)]
		::: [$SOURCE_KADU_MD5 MD5 Checksum]
		::: [$SOURCE_KADU_SHA1 SHA1 Checksum]
		:: Windows installer:
		::: [$EXE_SF Download Windows Installer (SourceForge.net)]
		::: [$EXE_KADU  Download Windows Installer (Kadu.im)]
		::: [$EXE_KADU_MD5 MD5 Checksum]
		::: [$EXE_KADU_SHA1 SHA1 Checksum]

		Changes:
		$CHANGELOG

		Please create backup of data directory ~/.kadu or C:\Users\..\AppData\Roaming\Kadu before installing.

		Please report all found issues in our [http://www.kadu.im/redmine Redmine] system.

		<p>
		</p>
END

	popd
}

export VERSION=$1

rm -rf package
mkdir package

expand_version
prepare_links
read_changelog
update_version_file
git_tag
create_package
build_binary
write_forum_entry
write_mailing_list_entry
write_pl_wiki_entry
write_en_wiki_entry