#!/bin/bash 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.' exit 1 fi dist_file="/tmp/platforms-${version}.tar.gz" tar czf "$dist_file" BUILD LICENSE MODULE.bazel WORKSPACE WORKSPACE.bzlmod version.bzl cpu os host sha256=$(shasum -a256 "$dist_file" | cut -d' ' -f1) path="github.com/bazelbuild/platforms/releases/download/$version/platforms-$version.tar.gz" cat <