chore(go): route release notes through vociferate
This commit is contained in:
9
script/download-vociferate-binary.sh
Normal file
9
script/download-vociferate-binary.sh
Normal file
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
curl --fail --location \
|
||||
-H "Authorization: token ${TOKEN}" \
|
||||
-o "$BINARY_PATH" \
|
||||
"$ASSET_URL"
|
||||
chmod +x "$BINARY_PATH"
|
||||
51
script/resolve-vociferate-runtime.sh
Normal file
51
script/resolve-vociferate-runtime.sh
Normal file
@@ -0,0 +1,51 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
case "${RUNNER_ARCH}" in
|
||||
X64)
|
||||
arch="amd64"
|
||||
;;
|
||||
ARM64)
|
||||
arch="arm64"
|
||||
;;
|
||||
*)
|
||||
echo "Unsupported runner architecture: ${RUNNER_ARCH}" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
source_root="${GITHUB_ACTION_PATH}"
|
||||
if [[ ! -f "${source_root}/go.mod" ]]; then
|
||||
source_root="$(realpath "${GITHUB_ACTION_PATH}/..")"
|
||||
fi
|
||||
|
||||
printf 'source_root=%s\n' "$source_root" >> "$GITHUB_OUTPUT"
|
||||
|
||||
if [[ "${ACTION_REF:-}" == v* ]]; then
|
||||
release_tag="${ACTION_REF}"
|
||||
normalized_version="${release_tag#v}"
|
||||
asset_name="vociferate_${normalized_version}_linux_${arch}"
|
||||
cache_dir="${RUNNER_TEMP}/vociferate/${release_tag}/linux-${arch}"
|
||||
binary_path="${cache_dir}/vociferate"
|
||||
asset_url="${SERVER_URL}/aether/vociferate/releases/download/${release_tag}/${asset_name}"
|
||||
|
||||
provided_cache_token="$(printf '%s' "${CACHE_TOKEN:-}" | sed 's/^[[:space:]]\+//; s/[[:space:]]\+$//')"
|
||||
if [[ -n "$provided_cache_token" ]]; then
|
||||
cache_token="$provided_cache_token"
|
||||
else
|
||||
cache_token="${ACTION_REPOSITORY:-aether/vociferate}-${release_tag}"
|
||||
fi
|
||||
|
||||
mkdir -p "$cache_dir"
|
||||
|
||||
printf 'use_binary=true\n' >> "$GITHUB_OUTPUT"
|
||||
printf 'release_tag=%s\n' "$release_tag" >> "$GITHUB_OUTPUT"
|
||||
printf 'cache_token=%s\n' "$cache_token" >> "$GITHUB_OUTPUT"
|
||||
printf 'asset_name=%s\n' "$asset_name" >> "$GITHUB_OUTPUT"
|
||||
printf 'asset_url=%s\n' "$asset_url" >> "$GITHUB_OUTPUT"
|
||||
printf 'cache_dir=%s\n' "$cache_dir" >> "$GITHUB_OUTPUT"
|
||||
printf 'binary_path=%s\n' "$binary_path" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
printf 'use_binary=false\n' >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
Reference in New Issue
Block a user