-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdo_release
executable file
·57 lines (41 loc) · 1.07 KB
/
do_release
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
#!/bin/bash
# Create a new edge-playbook release that can be uploaded to a repository.
#
# usage: do_release 0.2.0
set -e
set -o errexit
set -o pipefail
if [ -z ${1} ]
then
>&2 echo "Error: Usage: ${0} VERSION"
exit 1
fi
set -o nounset
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd ${SCRIPTDIR}
if [ "$(git rev-parse --abbrev-ref HEAD)" != "develop" ]
then
>&2 echo "Error: please switch to the develop branch before doing a release!"
exit 1
fi
if ! git diff --exit-code --quiet
then
>&2 echo "Error: there are unstaged changes!"
exit 1
fi
if ! git diff --cached --exit-code --quiet
then
>&2 echo "Error: there are uncommitted changes!"
exit 1
fi
git clean -dxf
source /etc/os-release
NEW_VERSION="${1}"
gbp dch --new-version ${NEW_VERSION} --release --distribution ${VERSION_CODENAME} --debian-branch develop --debian-tag v%\(version\)s
git add debian/changelog
git commit -m "New version ${NEW_VERSION}."
git flow release start ${NEW_VERSION}
git flow release finish
git push origin main
git push origin develop
git push --tags