File: release.sh

package info (click to toggle)
jitterdebugger 0.3.1%2Bgit20200117.b90ff3a-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 180 kB
  • sloc: ansic: 1,581; python: 77; sh: 44; makefile: 42
file content (41 lines) | stat: -rwxr-xr-x 945 bytes parent folder | download | duplicates (4)
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
#!/bin/sh
# SPDX-License-Identifier: MIT

OLD_VERSION=${1:-}
NEW_VERSION=${2:-}

usage() {
    echo "$0: OLD_VERSION NEW_VERSION"
    echo ""
    echo "example:"
    echo "  $0 0.1 0.2"
}

if [ -z "$OLD_VERSION" ] || [ -z "$NEW_VERSION" ] ; then
    usage
    exit 1
fi

echo "$NEW_VERSION" > newchangelog
git shortlog "$OLD_VERSION".. >> newchangelog
cat CHANGELOG.md >> newchangelog

emacs newchangelog --eval "(text-mode)"

echo -n "All fine, ready to release? [y/N]"
read a
a=$(echo "$a" | tr '[:upper:]' '[:lower:]')
if [ "$a" != "y" ]; then
    echo "no not happy, let's stop doing the release"
    exit 1
fi

mv newchangelog CHANGELOG.md
sed -i "s,\(__version__ =\).*,\1 \'$NEW_VERSION\'," jitterplot
sed -i "s,\(#define JD_VERSION\).*,\1 \"$NEW_VERSION\"," jitterdebugger.h

git add CHANGELOG.md jitterplot jitterdebugger.h

git commit -m "Release $NEW_VERSION"
git tag -s -m "Release $NEW_VERSION" "$NEW_VERSION"
git push --follow-tags