Skip to content

Commit

Permalink
fix: ensure ${repo} is used in the workspace snippet generation (#209)
Browse files Browse the repository at this point in the history
  • Loading branch information
cgrindel authored Feb 1, 2023
1 parent d870d83 commit 05f5a38
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion bzlrelease/tools/generate_workspace_snippet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ done
[[ "${add_github_src_archive_url}" == true ]] && \
url_templates+=( 'http://github.com/${owner}/${repo}/archive/${tag}.tar.gz' )
[[ "${add_github_release_archive_url}" == true ]] && \
url_templates+=( 'https://github.com/${owner}/${repo}/releases/download/${tag}/repo_name.${tag}.tar.gz' )
url_templates+=( 'https://github.com/${owner}/${repo}/releases/download/${tag}/${repo}.${tag}.tar.gz' )
[[ ${#url_templates[@]} -gt 0 ]] || fail "Expected one ore more url templates."

# MARK - Ensure that we have a SHA256 value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ generate_workspace_snippet(
sha256_file = ":archive_sha256",
template = "workspace_snippet.tmpl",
url_templates = [
"https://mirror.foo.org/${owner}/${repo}/repo_name.${tag}.tar.gz",
"https://mirror.foo.org/${owner}/${repo}/${repo}.${tag}.tar.gz",
],
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ assert_match bazel_starlib_dependencies "${actual}" "With Template bazel_starlib

actual="$( "${with_sha256_file_and_url_template_sh}" --tag "${tag}" )"
assert_match \
'https://github.com/cgrindel/bazel-starlib/releases/download/v999.0.0/repo_name.v999.0.0.tar.gz' \
'https://github.com/cgrindel/bazel-starlib/releases/download/v999.0.0/bazel-starlib.v999.0.0.tar.gz' \
"${actual}" \
"With SHA256 File and URL Template correct release artifact URL"
assert_match \
'https://mirror.foo.org/cgrindel/bazel-starlib/repo_name.v999.0.0.tar.gz' \
'https://mirror.foo.org/cgrindel/bazel-starlib/bazel-starlib.v999.0.0.tar.gz' \
"${actual}" \
"With SHA256 File and URL Template correct custom URL"
assert_no_match 'strip_prefix' "${actual}" "With SHA256 File and URL Template no strip_prefix"
Expand Down

0 comments on commit 05f5a38

Please sign in to comment.