diff --git a/distro/README.md b/distro/README.md index e4164f7..77fffd6 100644 --- a/distro/README.md +++ b/distro/README.md @@ -5,7 +5,8 @@ WARNING: These are what worked last time. Reality might be different. ## Step 1: Make the release - Pick a new version number -- Run distro/makerel.sh *version* +- Update version.bzl +- Run distro/makerel.sh - Go to the [Releases](https://github.com/bazelbuild/platforms/releases) page - Draft a new release - Name the release with a version number diff --git a/distro/makerel.sh b/distro/makerel.sh index e6f8fe3..7f77f33 100755 --- a/distro/makerel.sh +++ b/distro/makerel.sh @@ -1,16 +1,16 @@ #!/bin/bash -if [[ $# != 1 ]] ; then - echo "usage: $0 version" - exit 1 -fi -version="$1" - if [[ ! -f WORKSPACE ]] ; then echo 'You must run this command from the top of the workspace.' exit 1 fi +if [[ ! -f version.bzl ]] ; then + version.bzl is missing. + exit 1 +fi +version=$(sed -n -e 's/^version *= *"\(.*\)".*$/\1/p' version.bzl) + # tar on macos builds a file with different checksums each time. if [[ $(uname) != 'Linux' ]] ; then echo 'You must run this command from a linux machine.' @@ -19,9 +19,10 @@ fi dist_file="/tmp/platforms-${version}.tar.gz" -tar czf "$dist_file" BUILD LICENSE WORKSPACE cpu os +tar czf "$dist_file" BUILD LICENSE WORKSPACE version.bzl cpu os sha256=$(shasum -a256 "$dist_file" | cut -d' ' -f1) +path="github.com/bazelbuild/platforms/releases/download/$version/platforms-$version.tar.gz" cat <