File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3838
3939sha_for () {
4040 local name=" $1 "
41- awk -v target= " ./${name} " ' $2 == target { print $1 }' " ${checksums} "
41+ awk -v bare= " ${name} " -v dotted= " ./${name} " ' $2 == bare || $2 == dotted { print $1; exit }' " ${checksums} "
4242}
4343
4444darwin_amd64_archive=" mainline_${version} _darwin_amd64.tar.gz"
Original file line number Diff line number Diff line change @@ -58,6 +58,11 @@ json_escape() {
5858 python3 -c ' import json,sys; print(json.dumps(sys.argv[1]))' " $1 "
5959}
6060
61+ sha_for () {
62+ local name=" $1 "
63+ awk -v bare=" ${name} " -v dotted=" ./${name} " ' $2 == bare || $2 == dotted { print $1; exit }' " ${checksums} "
64+ }
65+
6166{
6267 printf ' {\n'
6368 printf ' "version": %s,\n' " $( json_escape " ${version} " ) "
@@ -80,7 +85,7 @@ json_escape() {
8085 if [[ " ${goos} " = " windows" ]]; then
8186 name=" mainline_${version} _${goos} _${goarch} .zip"
8287 fi
83- sha=" $( awk -v target= " ./ ${name} " ' $2 == target { print $1 } ' " ${checksums }" ) "
88+ sha=" $( sha_for " ${name} " ) "
8489 if [[ -z " ${sha} " ]]; then
8590 echo " missing checksum for ${name} " >&2
8691 exit 1
Original file line number Diff line number Diff line change @@ -27,6 +27,13 @@ test -f "${output_dir}/SHA256SUMS"
2727tar -tzf " ${output_dir} /mainline_v0.0.0-test_linux_amd64.tar.gz" | grep -q ' mainline_v0.0.0-test_linux_amd64/mainline$'
2828unzip -Z1 " ${output_dir} /mainline_v0.0.0-test_windows_amd64.zip" | grep -q ' ^mainline_v0.0.0-test_windows_amd64/mainline.exe$'
2929
30+ bare_checksums=" ${output_dir} /SHA256SUMS.bare"
31+ sed ' s# \./# #g' " ${output_dir} /SHA256SUMS" > " ${bare_checksums} "
32+ " ${repo_root} /scripts/generate-homebrew-formula.sh" --version v0.0.0-test --checksums " ${bare_checksums} " --output " ${output_dir} /mainline.rb"
33+ " ${repo_root} /scripts/generate-release-manifest.sh" --version v0.0.0-test --checksums " ${bare_checksums} " --output " ${output_dir} /release-manifest.json"
34+ ruby -c " ${output_dir} /mainline.rb" > /dev/null
35+ grep -q ' "name": "mainline_v0.0.0-test_darwin_amd64.tar.gz"' " ${output_dir} /release-manifest.json"
36+
3037host_os=" $( uname -s | tr ' [:upper:]' ' [:lower:]' ) "
3138host_arch=" $( uname -m) "
3239case " ${host_arch} " in
You can’t perform that action at this time.
0 commit comments