2018-10-04 21:28:39 +00:00
#!/bin/bash
2018-10-04 22:56:55 +00:00
2018-10-04 21:40:48 +00:00
# Copyright 2018 The Kubernetes Authors All rights reserved.
2018-10-04 21:28:39 +00:00
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
2018-10-04 21:40:48 +00:00
2020-08-03 21:21:15 +00:00
set -eu -o pipefail
2018-10-04 21:28:39 +00:00
DIR = $( cd " $( dirname " ${ BASH_SOURCE [0] } " ) " && pwd )
2021-07-15 20:14:13 +00:00
# Parse the token from `gh auth`
2021-07-15 20:19:07 +00:00
GH_TOKEN = $( mktemp)
gh auth status -t 2>& 1 | sed -n -r 's/^.*Token: ([a-zA-Z0-9_]*)/\1/p' > " $GH_TOKEN "
2021-07-15 20:14:13 +00:00
# Ensure the token is deleted when the script exits, so the token is not leaked.
function cleanup_token( ) {
2021-07-15 20:19:07 +00:00
rm -f " $GH_TOKEN "
2021-07-15 20:14:13 +00:00
}
trap cleanup_token EXIT
2021-05-04 18:33:02 +00:00
2022-10-14 23:46:46 +00:00
if ! [ [ -x " ${ DIR } /release-notes " ] ] || ! [ [ -x " ${ DIR } /pullsheet " ] ] ; then
2019-10-14 21:16:01 +00:00
echo >& 2 'Installing release-notes'
2022-10-14 23:46:46 +00:00
GOBIN = " $DIR " go install github.com/corneliusweig/release-notes@latest
GOBIN = " $DIR " go install github.com/google/pullsheet@latest
2019-10-14 21:16:01 +00:00
fi
2021-07-15 20:09:02 +00:00
git pull https://github.com/kubernetes/minikube.git master --tags
2019-12-02 22:46:31 +00:00
recent = $( git describe --abbrev= 0)
2021-05-04 18:33:02 +00:00
recent_date = $( git log -1 --format= %as $recent )
2019-12-02 22:46:31 +00:00
2022-10-14 23:46:46 +00:00
" ${ DIR } /release-notes " kubernetes minikube --since $recent
2018-10-04 21:28:39 +00:00
2021-05-04 18:33:02 +00:00
echo ""
2022-01-29 00:41:41 +00:00
echo "For a more detailed changelog, including changes occurring in pre-release versions, see [CHANGELOG.md](https://github.com/kubernetes/minikube/blob/master/CHANGELOG.md)."
2021-05-04 22:10:33 +00:00
echo ""
2020-12-14 19:43:42 +00:00
echo "Thank you to our contributors for this release!"
echo ""
2019-12-02 22:46:31 +00:00
git log " $recent " .. --format= "%aN" --reverse | sort | uniq | awk '{printf "- %s\n", $0 }'
2021-05-04 18:33:02 +00:00
echo ""
echo "Thank you to our PR reviewers for this release!"
echo ""
2021-05-11 18:41:48 +00:00
AWK_FORMAT_ITEM = '{printf "- %s (%d comments)\n", $2, $1}'
AWK_REVIEW_COMMENTS = 'NR>1{arr[$4] += $6 + $7}END{for (a in arr) printf "%d %s\n", arr[a], a}'
2022-10-14 23:46:46 +00:00
" ${ DIR } /pullsheet " reviews --since " $recent_date " --repos kubernetes/minikube --token-path " $GH_TOKEN " --logtostderr= false --stderrthreshold= 2 | awk -F ',' " $AWK_REVIEW_COMMENTS " | sort -k1nr -k2d | awk -F ' ' " $AWK_FORMAT_ITEM "
2021-05-04 22:01:17 +00:00
echo ""
echo "Thank you to our triage members for this release!"
echo ""
2021-05-11 18:41:48 +00:00
AWK_ISSUE_COMMENTS = 'NR>1{arr[$4] += $7}END{for (a in arr) printf "%d %s\n", arr[a], a}'
2022-10-14 23:46:46 +00:00
" ${ DIR } /pullsheet " issue-comments --since " $recent_date " --repos kubernetes/minikube --token-path " $GH_TOKEN " --logtostderr= false --stderrthreshold= 2 | awk -F ',' " $AWK_ISSUE_COMMENTS " | sort -k1nr -k2d | awk -F ' ' " $AWK_FORMAT_ITEM " | head -n 5
2021-05-19 22:14:24 +00:00
2021-05-21 23:28:25 +00:00
if [ [ " $recent " != *"beta" * ] ] ; then
echo ""
echo " Check out our [contributions leaderboard](https://minikube.sigs.k8s.io/docs/contrib/leaderboard/ $recent /) for this release! "
fi