-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnew-version.sh
executable file
·39 lines (28 loc) · 1.17 KB
/
new-version.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
37
38
#!/bin/bash
if [[ $# != 1 ]]; then
echo "Usage: $0 <version>"
echo ""
echo "eg: $0 1.2.1"
exit
fi
VERSION=$1
VS=(${VERSION//\./ })
if [[ ${#VS[@]} != 3 ]]; then
echo "Error: version must have 3 numbers separated by periods, eg 1.2.1"
exit
fi
PRIO=$(printf "%d%02d%02d0" ${VS[0]} ${VS[1]} ${VS[2]})
echo "Using version $VERSION and priority $PRIO..."
perl -pi -e "s/(#.*\@NEW_VERSION\@)/DEBS=\"\\\$DEBS ceylon-${VERSION}_${VERSION}-0_all.deb\"\n\$1/" repo/build.sh
dch --changelog dist-pkg/debian/changelog --newversion ${VERSION}-0 --package ceylon-$VERSION "New release $VERSION"
dch --changelog dist-pkg/debian/changelog --release Gee
git commit -a -m "New version $VERSION"
git checkout -q -b version-${VERSION}
git mv dist-pkg/debian/ceylon-VERSION.postinst dist-pkg/debian/ceylon-${VERSION}.postinst
git mv dist-pkg/debian/ceylon-VERSION.prerm dist-pkg/debian/ceylon-${VERSION}.prerm
sed -i -- "s/@@VERSION@@/${VERSION}/g" dist-pkg/debian/*
sed -i -- "s/@@VERSIONPRIO@@/${PRIO}/g" dist-pkg/debian/*
git commit -a -m "New version $VERSION with modified scripts"
git push --set-upstream origin version-$VERSION
git tag $VERSION
git push origin $VERSION