Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/littlefs-project/littlefs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Haster <chaster@utexas.edu>2018-09-29 19:18:53 +0300
committerChristopher Haster <chaster@utexas.edu>2018-09-29 20:31:27 +0300
commit0bb1f7af17755bd792f0c4966877fb1886dfc802 (patch)
tree285694ec0995c9e42574539c2079118585e8bf7e
parent447d89cbd8ed836cc5550ae012e5a34f910886c5 (diff)
Modified release script to create notes only on minor releasesv1.6.2
Before, release notes with a list of changes were created every patch release. Unfortunately, it looks like this will create a lot of noise on github, with a notification every patch release, which may be as often as every time a PR is merged. Rather than creating all of this noise for relatively uninteresting changes, the script will now stick to simple tags, and create the release notes only on minor releases. I think this is what several of you were originally suggesting, sorry about the journey, at least I learned a lot.
-rw-r--r--.travis.yml47
1 files changed, 29 insertions, 18 deletions
diff --git a/.travis.yml b/.travis.yml
index 6062c42..e4ea93d 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -140,12 +140,13 @@ jobs:
- LFS_VERSION_MINOR=$((0xffff & ($LFS_VERSION >> 0)))
# Grab latests patch from repo tags, default to 0, needs finagling to get past github's pagination api
- PREV_URL=https://api.github.com/repos/$TRAVIS_REPO_SLUG/git/refs/tags/v$LFS_VERSION_MAJOR.$LFS_VERSION_MINOR.
- - PREV_URL=$(curl -f -u "$GEKY_BOT_RELEASES" "$PREV_URL" -I
+ - PREV_URL=$(curl -u "$GEKY_BOT_RELEASES" "$PREV_URL" -I
| sed -n '/^Link/{s/.*<\(.*\)>; rel="last"/\1/;p;q0};$q1'
|| echo $PREV_URL)
- - LFS_VERSION_PATCH=$(curl -f -u "$GEKY_BOT_RELEASES" "$PREV_URL"
+ - LFS_VERSION_PATCH=$(curl -u "$GEKY_BOT_RELEASES" "$PREV_URL"
| jq 'map(.ref | match("\\bv.*\\..*\\.(.*)$";"g")
- .captures[].string | tonumber + 1) | max // 0')
+ .captures[].string | tonumber) | max + 1'
+ || echo 0)
# We have our new version
- LFS_VERSION="v$LFS_VERSION_MAJOR.$LFS_VERSION_MINOR.$LFS_VERSION_PATCH"
- echo "VERSION $LFS_VERSION"
@@ -156,24 +157,34 @@ jobs:
| jq -re '.sha')
if [ "$TRAVIS_COMMIT" == "$CURRENT_COMMIT" ]
then
- # Build release notes
- PREV=$(git tag --sort=-v:refname -l "v*" | head -1)
- if [ ! -z "$PREV" ]
- then
- echo "PREV $PREV"
- CHANGES=$'### Changes\n\n'$( \
- git log --oneline $PREV.. --grep='^Merge' --invert-grep)
- printf "CHANGES\n%s\n\n" "$CHANGES"
- fi
- # Create the release
+ # Create a simple tag
curl -f -u "$GEKY_BOT_RELEASES" -X POST \
- https://api.github.com/repos/$TRAVIS_REPO_SLUG/releases \
+ https://api.github.com/repos/$TRAVIS_REPO_SLUG/git/refs \
-d "{
- \"tag_name\": \"$LFS_VERSION\",
- \"target_commitish\": \"$TRAVIS_COMMIT\",
- \"name\": \"${LFS_VERSION%.0}\",
- \"body\": $(jq -sR '.' <<< "$CHANGES")
+ \"ref\": \"refs/tags/$LFS_VERSION\",
+ \"sha\": \"$TRAVIS_COMMIT\"
}"
+ # Minor release?
+ if [[ "$LFS_VERSION" == *.0 ]]
+ then
+ # Build release notes
+ PREV=$(git tag --sort=-v:refname -l "v*.0" | head -1)
+ if [ ! -z "$PREV" ]
+ then
+ echo "PREV $PREV"
+ CHANGES=$'### Changes\n\n'$( \
+ git log --oneline $PREV.. --grep='^Merge' --invert-grep)
+ printf "CHANGES\n%s\n\n" "$CHANGES"
+ fi
+ # Create the release
+ curl -f -u "$GEKY_BOT_RELEASES" -X POST \
+ https://api.github.com/repos/$TRAVIS_REPO_SLUG/releases \
+ -d "{
+ \"tag_name\": \"$LFS_VERSION\",
+ \"name\": \"${LFS_VERSION%.0}\",
+ \"body\": $(jq -sR '.' <<< "$CHANGES")
+ }"
+ fi
fi
# Manage statuses