-
Notifications
You must be signed in to change notification settings - Fork 0
/
check-for-release.sh
executable file
·36 lines (32 loc) · 1.2 KB
/
check-for-release.sh
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
#!/bin/sh
# To be called when checking if a new task-maker-rust release is available.
# If a new version is available, this script updates debian/changelog and
# sets the createpr output to yes
set -e
# Add a new entry to debian/changelog. For example:
# add_changelog_entry 0.5.6
add_changelog_entry() {
tmpfile=`mktemp`
echo "task-maker-rust ($1-1~ubuntu#VERSION_NUM) #VERSION_NAME; urgency=medium" >>$tmpfile
echo "" >>$tmpfile
echo " * Update to version $1" >>$tmpfile
echo "" >>$tmpfile
echo " -- Dario Petrillo <[email protected]> `date -R`" >>$tmpfile
echo "" >>$tmpfile
cat debian/changelog >>$tmpfile
mv $tmpfile debian/changelog
}
if [ -z ${UPSTREAM_VERSION+x} ]; then
echo UPSTREAM_VERSION not provided
else
CUR_RELEASE=`head debian/changelog -n 1 | sed 's/^task-maker-rust (\([0-9\.]*\).*$/\1/'`
echo Last release in changelog is $CUR_RELEASE
echo Last upstream release is $UPSTREAM_VERSION
if dpkg --compare-versions "$CUR_RELEASE" lt "$UPSTREAM_VERSION"; then
echo Updating changelog
add_changelog_entry $UPSTREAM_VERSION
echo "createpr=yes" >> $GITHUB_OUTPUT
else
echo "createpr=no" >> $GITHUB_OUTPUT
fi
fi