-
-
Notifications
You must be signed in to change notification settings - Fork 24
/
release.sh
executable file
·48 lines (38 loc) · 1.3 KB
/
release.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
# Automated release script for the Road Generator addon.
echo "Starting release..."
# Affirm on the master branch
BRANCH=$(git rev-parse --abbrev-ref HEAD)
if [ "$BRANCH" != "main" ]; then
echo -e "Not on master branch, run:"
echo "git checkout main"
exit
fi
# TODO: Set up once all gitignores are fully established.
# if [[ `git status --porcelain` ]]; then
# echo "There are uncommited changes, ending"
# exit
# fi
git pull main --quiet
echo ""
echo "Current status (should be empty!)"
git status
./run_tests.sh
if [ "$?" != "0" ]; then
echo "Tests failed $LINENO."
exit 1
fi
# Extract the current version number.
VER=$(grep "version=" addons/road-generator/plugin.cfg | awk -F'"' '{print $2}')
echo "Current version detected:"
echo $VER
echo "Is this the correct version to be generating?"
echo "(if not, exit and edit: addons/road-generator/plugin.cfg)"
read -p "(Y/N): " confirm && [[ $confirm == [yY] || $confirm == [yY][eE][sS] ]] || exit 1
echo ""
echo "Creating release with tag: $VER"
gh release create $VER --generate-notes --draft
echo ""
echo "Done, validate release and check download:"
echo "https://github.com/TheDuckCow/godot-road-generator/releases/tag/$VER"
echo "And then close the according milestone, if any"
echo "https://github.com/TheDuckCow/godot-road-generator/milestones"