Skip to content

Commit

Permalink
Prepend tag annotation with new line and try to make travis set the n…
Browse files Browse the repository at this point in the history
…ame and release notes from the tag (and publish as a draft)
  • Loading branch information
friday committed Aug 24, 2021
1 parent 2f3748c commit 5bbcf38
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ branches:
- "/^\\d+.\\d+.\\d+/"
deploy:
provider: releases
draft: true
name: $TRAVIS_TAG
body: $(git tag -l --format='%(contents)' $TRAVIS_TAG)
api_key:
secure: EG0AuBGirBDu5XYKFZwITcXq/0U50f2PR5UVhbspr6D8LLcLbuxItMVnNjSuT1BQNpt7ijJ3gQfkh0QXZdv02d/H0l0+U2YCCyytvypMeqSfVawIGxYvYK2i5DH+0k7rVC9WoimpB+4lNx+VZILwzjudCzzefH8+ZSPPoeFOPYC8SU/VYPx2K31jgz7LlTWiEsijPF8XErXmHdQ3IDnDFnNZpNVnWPlArozQkqsJF9tosBPO72ZLFKLpAH+Eg+WVnPmqQlzH6MIzE9bsyxDD98mRvhkBNUI8EJI/qPqLczA9wJVt33VJrnQhJP5QEhNZ4IwyHuK61oUqM6/Q80LJhFpxeNebnkGIYWrkmY8pKJAV/BnIU8ejiVrMxqLzq+plb1Bzz08NLSyD9xp0o4KHDuMC/e6dohuNFaSlOCHv41Z9bQrGBXnQRjG4b4vN1cAK8ozVVLO2hosWf1vj0ItUPzZG4X1psjspbEcWlDyPak6ZUYoVsT9/xsGojN7N6MPqXxnrkzn+ffHL/gzdE6nIxwQNeg42xrRfepvO+96G4c53gF/YEMLYccKarfriLmrpRd+OzYx2Dbc8K2AMhXE5gseswQmHeSJj0ln0Kd1XKBEGqYlwtha3ZzRvOR00I9ONhAZL2fasX/H19nL9odH5NsdVjzxv9vuA2Q2KiA/meZc=
file:
Expand Down
15 changes: 12 additions & 3 deletions scripts/tag-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,24 @@ tag-release() {
exit 1
fi

set -f

TAG=$1
PREVIOUSTAG=$(git describe --tags --abbrev=0)
LOG=$(git log $PREVIOUSTAG..HEAD --pretty=format:"* %s")
# If the previous release was a pre-release, we should include the changes in that release too
if [[ "$PREVIOUSTAG" == *-* ]]; then
PREVIOUSLOG=$(git tag -l --format='%(contents)' $PREVIOUSTAG)
LOG="Changes since $PREVIOUSTAG:\n$LOG\n\nChanges in $PREVIOUSTAG:\n$PREVIOUSLOG"
LOG=$(printf "Changes since $PREVIOUSTAG:\n$LOG\n\nChanges in $PREVIOUSTAG:\n$PREVIOUSLOG")
fi

# Creates the tag and opens an editor with the LOG since last tag as the annotation
git tag -a $TAG -m "$LOG" -e
echo "$LOG" > /tmp/ulauncher-release-notes
# Let us edit the log
$EDITOR /tmp/ulauncher-release-notes
LOG=$(cat /tmp/ulauncher-release-notes)

# Creates the tag
git tag -a $TAG -m "\n$LOG"

echo "Push the new tag with 'git push' and 'git push origin $TAG' (assuming origin is the correct remote)"
}

0 comments on commit 5bbcf38

Please sign in to comment.