forked from npgsql/npgsql
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbump.sh
More file actions
28 lines (21 loc) · 941 Bytes
/
Copy pathbump.sh
File metadata and controls
28 lines (21 loc) · 941 Bytes
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
#!/bin/bash
if [ "$#" -ne 1 ]; then
echo "usage: bump.sh <version>"
exit 1
fi
v=$1
if [[ $v == *"-" ]]; then
echo "Version must not end with -"
exit 1
fi
# if [[ $v == *"-"* ]]; then
# without_prerelease=`echo $v | cut -d- -f1`
sed -i 's/<VersionPrefix>[^<]*<\/VersionPrefix>/<VersionPrefix>'$v'<\/VersionPrefix>/' src/Npgsql/Npgsql.csproj
sed -i 's/\(<Identity .*Version=\)"[^"]*"/\1"'$v'"/' src/VSIX/source.extension.vsixmanifest
sed -i 's/.*ProvideBindingRedirection.*/[assembly: ProvideBindingRedirection(AssemblyName = "Npgsql", NewVersion = "'$v'.0", OldVersionLowerBound = "0.0.0.0", OldVersionUpperBound = "'$v'.0")]/' src/VSIX/Properties/AssemblyInfo.cs
echo "echo ##teamcity[buildNumber '$v-%1']" > teamcity_set_version.cmd
git add teamcity_set_version.cmd
git add src/Npgsql/Npgsql.csproj
git add src/VSIX/source.extension.vsixmanifest
git add src/VSIX/Properties/AssemblyInfo.cs
git commit -m "Bump version to $v"