-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbump_version.sh
executable file
·40 lines (36 loc) · 1.06 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
#!/bin/bash
set -e # fail script on any error, show commands
OLD_VERSION=$1 # e.g., 0.0.0
NEW_VERSION=$2 # e.g., 0.0.1
NEW_VERSION_LENGTH=$(printf "%s" "$NEW_VERSION" | wc -c)
DASHES=$(printf "%${NEW_VERSION_LENGTH}s" | sed 's/ /-/g')
echo "git checkout main"
echo "git pull"
echo "git checkout -b release/v${NEW_VERSION}"
echo ""
echo "sed -i -e 's/${OLD_VERSION}/${NEW_VERSION}/g' phillydb/__version__.py"
echo "sed -i -e '/Development/,/-----------/ c\\
Development\\
-----------\\
\\
* Placeholder\\
\\
${NEW_VERSION}\\
${DASHES}
' CHANGELOG.md"
echo "rm -f phillydb/__version__.py-e"
echo "rm -f CHANGELOG.md-e"
echo ""
echo "git commit -am \"Bump version\" "
echo "git tag v${NEW_VERSION}"
echo "git push -u origin release/v${NEW_VERSION} --tags"
echo "git checkout main"
echo "git pull"
echo "git merge release/v${NEW_VERSION}"
echo "git push"
echo ""
echo "rm -r dist build phillydb.egg-info" # reset build dirs
echo "python3 setup.py sdist"
echo "pip3 wheel --no-deps . -w dist"
echo "python3 -m twine upload dist/*" # requires PyPI credentials
echo "git checkout main"