forked from DakaraProject/dakara-player
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbump_version.sh
executable file
·60 lines (46 loc) · 1.46 KB
/
bump_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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/bash
set -e
# server version
if [[ -z $1 ]]
then
>&2 echo 'Error: no version specified'
exit 1
fi
# next server version
if [[ -z $2 ]]
then
>&2 echo 'Error: no next version specified'
exit 1
fi
version_number=$1
dev_version_number=$2-dev
version_date=$(date -I -u)
# patch version in setup.cfg
setup_file=setup.cfg
sed -i "s/^version = .*$/version = $version_number/" $setup_file
# patch version date in version file
version_file=src/dakara_player_vlc/version.py
sed -i "s/^__date__ = .*$/__date__ = \"$version_date\"/" $version_file
# change version in changelog
changelog_file=CHANGELOG.md
sed -i "/^## Unreleased$/a \\
\\
## $version_number - $version_date" $changelog_file
# change version in appveyor config file
appveyor_file=.appveyor.yml
sed -i "s/^version: .*-{build}$/version: $version_number-{build}/" $appveyor_file
# create commit and tag
git add $setup_file $version_file $changelog_file $appveyor_file
git commit -m "Version $version_number" --no-verify
git tag "$version_number"
# say something
echo "Version bumped to $version_number"
# patch dev version in setup.cfg
sed -i "s/^version = .*$/version = $dev_version_number/" $setup_file
# change version in appveyor config file
sed -i "s/^version: .*-{build}$/version: $dev_version_number-{build}/" $appveyor_file
# create commit
git add $setup_file $appveyor_file
git commit -m "Dev version $dev_version_number" --no-verify
# say something
echo "Updated to dev version $dev_version_number"