@@ -136,7 +136,6 @@ function bazel_build() {
136136 fi
137137 cp bazel-genfiles/site/jekyll-tree.tar $1 /docs.bazel.build.tar
138138 cp bazel-bin/src/tools/benchmark/webapp/site.tar $1 /perf.bazel.build.tar.nobuild
139- cp bazel-genfiles/scripts/packages/README.md $1 /README.md
140139 fi
141140}
142141
@@ -181,20 +180,8 @@ function generate_email() {
181180 fi
182181}
183182
184- # Deploy a github release using a third party tool:
185- # https://github.com/c4milo/github-release
186- # This methods expects the following arguments:
187- # $1..$n files generated by package_build (should not contains the README file)
188- # Please set GITHUB_TOKEN to talk to the Github API and GITHUB_RELEASE
189- # for the path to the https://github.com/c4milo/github-release tool.
190- # This method is also affected by GIT_REPOSITORY_URL which should be the
191- # URL to the github repository (defaulted to https://github.com/bazelbuild/bazel).
192- function release_to_github() {
193- local url=" ${GIT_REPOSITORY_URL} "
194- local release_name=$( get_release_name)
195- local rc=$( get_release_candidate)
196- local release_tool=" ${GITHUB_RELEASE:- $(which github-release 2>/ dev/ null || true)} "
197- local gpl_warning='
183+ function get_release_page() {
184+ echo " # $( git_commit_msg) " '
198185
199186_Notice_: Bazel installers contain binaries licensed under the GPLv2 with
200187Classpath exception. Those installers should always be redistributed along with
@@ -210,8 +197,23 @@ The binaries and source-code of the bundled OpenJDK can be
210197_Security_: All our binaries are signed with our
211198[public key](https://bazel.build/bazel-release.pub.gpg) 48457EE0.
212199'
200+ }
213201
214- if [ ! -x " ${release_tool} " ]; then
202+ # Deploy a github release using a third party tool:
203+ # https://github.com/c4milo/github-release
204+ # This methods expects the following arguments:
205+ # $1..$n files generated by package_build (should not contains the README file)
206+ # Please set GITHUB_TOKEN to talk to the Github API and GITHUB_RELEASE
207+ # for the path to the https://github.com/c4milo/github-release tool.
208+ # This method is also affected by GIT_REPOSITORY_URL which should be the
209+ # URL to the github repository (defaulted to https://github.com/bazelbuild/bazel).
210+ function release_to_github() {
211+ local url=" ${GIT_REPOSITORY_URL} "
212+ local release_name=$( get_release_name)
213+ local rc=$( get_release_candidate)
214+ local release_tool=" ${GITHUB_RELEASE:- $(which github-release 2>/ dev/ null || echo release-tool-not-found)} "
215+
216+ if [ " ${release_tool} " = " release-tool-not-found" ]; then
215217 echo " Please set GITHUB_RELEASE to the path to the github-release binary." >&2
216218 echo " This probably means you haven't installed https://github.com/c4milo/github-release " >&2
217219 echo " on this machine." >&2
@@ -221,25 +223,24 @@ _Security_: All our binaries are signed with our
221223 if [ -n " ${release_name} " ] && [ -z " ${rc} " ]; then
222224 mkdir -p " ${tmpdir} /to-github"
223225 cp " ${@ } " " ${tmpdir} /to-github"
224- " ${GITHUB_RELEASE } " " ${github_repo} " " ${release_name} " " " " # $( git_commit_msg ) ${gpl_warning} " " ${tmpdir} /to-github/" ' *'
226+ " ${release_tool } " " ${github_repo} " " ${release_name} " " " " $( get_release_page ) " " ${tmpdir} /to-github/" ' *'
225227 fi
226228}
227229
228230# Creates an index of the files contained in folder $1 in mardown format
229231function create_index_md() {
230- # First, add the README.md
231- local file=$1 /__temp.md
232- if [ -f $1 /README.md ]; then
233- cat $1 /README.md
232+ # First, add the release notes
233+ get_release_page
234+ # Build log
235+ if [ -f $1 /build.log ]; then
236+ echo
237+ echo " [Build log](build.log)"
238+ echo
234239 fi
235240 # Then, add the list of files
236241 echo
237242 echo " ## Index of files"
238243 echo
239- # Security notice
240- echo " _Security_: All our binaries are signed with our"
241- echo " [public key](https://bazel.build/bazel-release.pub.gpg) 48457EE0."
242- echo
243244 for f in $1 /* .sha256; do # just list the sha256 ones
244245 local filename=$( basename $f .sha256) ;
245246 echo " - [${filename} ](${filename} ) [[SHA-256](${filename} .sha256)] [[SIG](${filename} .sig)]"
@@ -411,9 +412,8 @@ function release_to_apt() {
411412# A wrapper around the release deployment methods.
412413function deploy_release() {
413414 local github_args=()
414- # Filters out README.md for github releases
415415 for i in " $@ " ; do
416- if ! ( [[ " $i " =~ README.md$ ]] || [[ " $i " =~ bazel.dsc ]] || [[ " $i " =~ bazel.tar.gz ]] || [[ " $i " =~ .nobuild$ ]] ) ; then
416+ if ! ( [[ " $i " =~ build.log ]] || [[ " $i " =~ bazel.dsc ]] || [[ " $i " =~ bazel.tar.gz ]] || [[ " $i " =~ .nobuild$ ]] ) ; then
417417 github_args+=(" $i " )
418418 fi
419419 done
@@ -443,7 +443,6 @@ function deploy_release() {
443443# RELEASE_EMAIL_SUBJECT: the subject of the email to be sent
444444# RELEASE_EMAIL_CONTENT: the content of the email to be sent
445445function bazel_release() {
446- local README=$2 /README.md
447446 tmpdir=$( mktemp -d ${TMPDIR:-/ tmp} /tmp.XXXXXXXX)
448447 trap ' rm -fr ${tmpdir}' EXIT
449448 ensure_gpg_secret_key_imported
@@ -455,7 +454,7 @@ function bazel_release() {
455454 for file in $folder /* ; do
456455 local filename=$( basename $file )
457456 if [ " $filename " != README.md ]; then
458- if [ " $filename " == " bazel.dsc" ] || [ " $filename " == " bazel.tar.gz" ] \
457+ if [ " $filename " == " bazel.dsc" ] || [ " $filename " == " bazel.tar.gz" ] \
459458 || [[ " $filename " =~ bazel-(.* )-dist\. zip ]] ; then
460459 local destfile=${tmpdir} /$filename
461460 elif [[ " $file " =~ /([^/]* )(\. [^\. /]+)$ ]]; then
@@ -473,7 +472,7 @@ function bazel_release() {
473472 fi
474473 done
475474 done
476- deploy_release $README $ ( find ${tmpdir} -type f)
475+ deploy_release $( find ${tmpdir} -type f)
477476
478477 export RELEASE_EMAIL=" $( generate_email) "
479478
0 commit comments