diff --git a/Makefile b/Makefile index a012491bd1..4e0fe0b1ed 100644 --- a/Makefile +++ b/Makefile @@ -1048,3 +1048,7 @@ update-gopogh-version: ## update gopogh version update-gotestsum-version: (cd hack/update/gotestsum_version && \ go run update_gotestsum_version.go) + +.PHONY: generate-licenses +generate-licenses: + ./hack/generate_licenses.sh $(RAW_VERSION) diff --git a/hack/generate_licenses.sh b/hack/generate_licenses.sh new file mode 100755 index 0000000000..45725df31e --- /dev/null +++ b/hack/generate_licenses.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +# Copyright 2022 The Kubernetes Authors All rights reserved. +# +# 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. + +set -eu -o pipefail + +DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) + +version=$1 + +GOBIN="$DIR" go install github.com/google/go-licenses@latest + +rm -rf ./out/licenses +"${DIR}/go-licenses" save k8s.io/minikube/cmd/minikube --save_path="out/licenses" --force +pushd ./out +tar -zcvf "licenses-$version.tar.gz" ./licenses +rm -rf ./licenses +popd diff --git a/hack/jenkins/release_build_and_upload.sh b/hack/jenkins/release_build_and_upload.sh index 0f3cfd110e..a53969707f 100755 --- a/hack/jenkins/release_build_and_upload.sh +++ b/hack/jenkins/release_build_and_upload.sh @@ -44,6 +44,9 @@ export GOPATH=$HOME/go echo "Verifying ISO exists ..." make verify-iso +# Generate licenses +make generate-licenses + # Build and upload env BUILD_IN_DOCKER=y \ make -j 16 \ diff --git a/hack/release_notes.sh b/hack/release_notes.sh index ebaba83866..e4b37794ff 100755 --- a/hack/release_notes.sh +++ b/hack/release_notes.sh @@ -28,17 +28,17 @@ function cleanup_token() { } trap cleanup_token EXIT -if ! [[ -x release-notes ]] || ! [[ -x pullsheet ]]; then +if ! [[ -x "${DIR}/release-notes" ]] || ! [[ -x "${DIR}/pullsheet" ]]; then echo >&2 'Installing release-notes' - go install github.com/corneliusweig/release-notes@latest - go install github.com/google/pullsheet@latest + GOBIN="$DIR" go install github.com/corneliusweig/release-notes@latest + GOBIN="$DIR" go install github.com/google/pullsheet@latest fi git pull https://github.com/kubernetes/minikube.git master --tags recent=$(git describe --abbrev=0) recent_date=$(git log -1 --format=%as $recent) -release-notes kubernetes minikube --since $recent +"${DIR}/release-notes" kubernetes minikube --since $recent echo "" 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)." @@ -52,12 +52,12 @@ echo "Thank you to our PR reviewers for this release!" echo "" 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}' -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" +"${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" echo "" echo "Thank you to our triage members for this release!" echo "" AWK_ISSUE_COMMENTS='NR>1{arr[$4] += $7}END{for (a in arr) printf "%d %s\n", arr[a], a}' -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 +"${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 if [[ "$recent" != *"beta"* ]]; then echo "" diff --git a/hack/update_contributions.sh b/hack/update_contributions.sh index 80c790d8f0..fec75534e7 100755 --- a/hack/update_contributions.sh +++ b/hack/update_contributions.sh @@ -19,7 +19,7 @@ set -eu -o pipefail DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) echo >&2 'Installing pullsheet' -go install github.com/google/pullsheet@latest +GOBIN="$DIR" go install github.com/google/pullsheet@latest git fetch --tags -f git pull https://github.com/kubernetes/minikube.git master --tags @@ -69,6 +69,6 @@ while read -r tag_index tag_name tag_start tag_end; do # Print header for page. printf -- "---\ntitle: \"$tag_name - $tag_end\"\nlinkTitle: \"$tag_name - $tag_end\"\nweight: $tag_index\n---\n" > "$destination/$tag_name.html" # Add pullsheet content - pullsheet leaderboard --token-path "$TMP_TOKEN" --repos kubernetes/minikube --since "$tag_start" --until "$tag_end" --hide-command --logtostderr=false --stderrthreshold=2 \ + "${DIR}/pullsheet" leaderboard --token-path "$TMP_TOKEN" --repos kubernetes/minikube --since "$tag_start" --until "$tag_end" --hide-command --logtostderr=false --stderrthreshold=2 \ >> "$destination/$tag_name.html" done <<< "$tags_with_range" diff --git a/site/content/en/docs/contrib/releasing/binaries.md b/site/content/en/docs/contrib/releasing/binaries.md index 983bcaa39d..63fc912a73 100644 --- a/site/content/en/docs/contrib/releasing/binaries.md +++ b/site/content/en/docs/contrib/releasing/binaries.md @@ -34,7 +34,7 @@ Run the `kic-release` job in Jenkins, which will automatically create a PR which Run the following script from your local upstream repo copy to generate updated release notes: ```shell -hack/release_notes.sh +make release-notes ``` Paste the output into CHANGELOG.md, sorting changes by importance to an end-user. If there are >8 changes, split them into *Improvements* and *Bug fixes*