| #!/usr/bin/env bash |
| |
| set -o errexit -o nounset -o pipefail |
| |
| # Set by GH actions, see |
| # https://docs.github.com/en/actions/learn-github-actions/environment-variables#default-environment-variables |
| TAG=${GITHUB_REF_NAME} |
| PREFIX="rules_python-${TAG}" |
| SHA=$(git archive --format=tar --prefix=${PREFIX}/ ${TAG} | gzip | shasum -a 256 | awk '{print $1}') |
| |
| cat << EOF |
| WORKSPACE setup: |
| |
| \`\`\`starlark |
| load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") |
| http_archive( |
| name = "rules_python", |
| sha256 = "${SHA}", |
| strip_prefix = "${PREFIX}", |
| url = "https://github.com/bazelbuild/rules_python/archive/refs/tags/${TAG}.tar.gz", |
| ) |
| \`\`\` |
| EOF |