forked from letscontrolit/ESPEasy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
release
executable file
·38 lines (28 loc) · 1006 Bytes
/
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
#!/bin/bash
set -e
NEW="$1"
[ "$NEW" != "" ] || exit 1
PREV=`git tag --sort=creatordate|tail -1`
############## update Release_notes.txt
NOTES="dist/Release_notes.txt"
echo "-------------------------------------------------" > "$NOTES.new"
echo "Changes in release $NEW (since $PREV)" >> "$NOTES.new"
echo "-------------------------------------------------" >> "$NOTES.new"
echo -e "\nRelease date: `date`\n" >> "$NOTES.new"
git shortlog --no-merges $PREV..HEAD >> "$NOTES.new"
echo >> "$NOTES.new"
cat "$NOTES" >> "$NOTES.new"
mv "$NOTES.new" "$NOTES"
git add "$NOTES"
git commit -m "automaticly updated release notes for $NEW"
################ tag and add tag message
echo > /tmp/tagmessage
echo "Release $NEW" >> /tmp/tagmessage
echo >> /tmp/tagmessage
echo "Changes in $NEW (since $PREV):" >> /tmp/tagmessage
echo >> /tmp/tagmessage
git shortlog --no-merges $PREV..HEAD >> /tmp/tagmessage
git tag -a "$NEW" -m "`cat /tmp/tagmessage`"
################ push everything
git push
git push --tags