fix: goreleaser format for homebrew

This commit is contained in:
Pavel Sviderski
2025-02-06 13:51:15 +10:00
parent 58e1c2eea3
commit 7d25bbafdf
3 changed files with 16 additions and 11 deletions
+8 -3
View File
@@ -40,7 +40,9 @@ archives:
- id: uncloud - id: uncloud
builds: builds:
- uncloud - uncloud
format: gz formats:
# gz is not compatible with homebrew releases, so we use tar.gz
- tar.gz
name_template: >- name_template: >-
{{ .Binary }}_ {{ .Binary }}_
{{- if eq .Os "darwin"}}macos {{- if eq .Os "darwin"}}macos
@@ -49,14 +51,16 @@ archives:
# use zip for windows archives # use zip for windows archives
format_overrides: format_overrides:
- goos: windows - goos: windows
format: zip formats:
- zip
files: files:
- none* - none*
- id: uncloudd - id: uncloudd
builds: builds:
- uncloudd - uncloudd
format: gz formats:
- tar.gz
name_template: "{{ .Binary }}_{{ .Os }}_{{ .Arch }}" name_template: "{{ .Binary }}_{{ .Os }}_{{ .Arch }}"
files: files:
- none* - none*
@@ -79,6 +83,7 @@ brews:
- uncloud - uncloud
install: | install: |
bin.install "uncloud" bin.install "uncloud"
bin.install_symlink "uncloud" => "uc"
skip_upload: false skip_upload: false
repository: repository:
owner: psviderski owner: psviderski
+5 -5
View File
@@ -112,17 +112,17 @@ install_uncloud_binaries() {
local uncloudd_url local uncloudd_url
if [ "${UNCLOUD_VERSION}" == "latest" ]; then if [ "${UNCLOUD_VERSION}" == "latest" ]; then
uncloudd_url="${UNCLOUD_GITHUB_URL}/releases/latest/download/uncloudd_linux_${file_arch}.gz" uncloudd_url="${UNCLOUD_GITHUB_URL}/releases/latest/download/uncloudd_linux_${file_arch}.tar.gz"
else else
uncloudd_url="${UNCLOUD_GITHUB_URL}/releases/download/${UNCLOUD_VERSION}/uncloudd_linux_${file_arch}.gz" uncloudd_url="${UNCLOUD_GITHUB_URL}/releases/download/${UNCLOUD_VERSION}/uncloudd_linux_${file_arch}.tar.gz"
fi fi
local uncloudd_download_path="${tmp_dir}/uncloudd.gz" local uncloudd_download_path="${tmp_dir}/uncloudd.tar.gz"
log "⏳ Downloading uncloudd binary: ${uncloudd_url}" log "⏳ Downloading uncloudd binary: ${uncloudd_url}"
if ! curl -fsSL -o "${uncloudd_download_path}" "${uncloudd_url}"; then if ! curl -fsSL -o "${uncloudd_download_path}" "${uncloudd_url}"; then
error "Failed to download uncloudd binary." error "Failed to download uncloudd binary."
fi fi
gzip -d "${uncloudd_download_path}" tar -xf "${uncloudd_download_path}"
if ! install "${uncloudd_download_path%.gz}" "${uncloudd_install_path}"; then if ! install "${uncloudd_download_path%.gz}" "${uncloudd_install_path}"; then
error "Failed to install uncloud binary to ${uncloudd_install_path}" error "Failed to install uncloud binary to ${uncloudd_install_path}"
fi fi
@@ -196,7 +196,7 @@ install_corrosion() {
if ! curl -fsSL -o "${corrosion_download_path}" "${corrosion_url}"; then if ! curl -fsSL -o "${corrosion_download_path}" "${corrosion_url}"; then
error "Failed to download uncloud-corrosion binary." error "Failed to download uncloud-corrosion binary."
fi fi
tar -xzf "${corrosion_download_path}" -C "${tmp_dir}" tar -xf "${corrosion_download_path}" -C "${tmp_dir}"
if ! install "${tmp_dir}/corrosion" "${corrosion_install_path}"; then if ! install "${tmp_dir}/corrosion" "${corrosion_install_path}"; then
error "Failed to install uncloud-corrosion binary to ${corrosion_install_path}" error "Failed to install uncloud-corrosion binary to ${corrosion_install_path}"
fi fi
+3 -3
View File
@@ -64,7 +64,7 @@ esac
if [ "$VERSION" = "latest" ]; then if [ "$VERSION" = "latest" ]; then
VERSION=$(latest_version) VERSION=$(latest_version)
fi fi
BINARY_NAME="uncloud_${BINARY_OS}_${BINARY_ARCH}.gz" BINARY_NAME="uncloud_${BINARY_OS}_${BINARY_ARCH}.tar.gz"
BINARY_URL="https://github.com/${GITHUB_REPO}/releases/download/${VERSION}/${BINARY_NAME}" BINARY_URL="https://github.com/${GITHUB_REPO}/releases/download/${VERSION}/${BINARY_NAME}"
CHECKSUM_URL="https://github.com/${GITHUB_REPO}/releases/download/$VERSION/checksums.txt" CHECKSUM_URL="https://github.com/${GITHUB_REPO}/releases/download/$VERSION/checksums.txt"
@@ -89,14 +89,14 @@ cd "$TMP_DIR"
#echo "Checksum is valid." #echo "Checksum is valid."
# Decompress and install the binary. # Decompress and install the binary.
gzip -d "${BINARY_NAME}" tar -xf "${BINARY_NAME}"
if [ -z "${SUDO}" ]; then if [ -z "${SUDO}" ]; then
echo "Installing uncloud binary to ${INSTALL_DIR}" echo "Installing uncloud binary to ${INSTALL_DIR}"
else else
echo "Installing uncloud binary to ${INSTALL_DIR} using sudo. You may be prompted for your password." echo "Installing uncloud binary to ${INSTALL_DIR} using sudo. You may be prompted for your password."
fi fi
if ! $SUDO install "${BINARY_NAME%.gz}" "${INSTALL_DIR}/uncloud"; then if ! $SUDO install "${BINARY_NAME%.tar.gz}" "${INSTALL_DIR}/uncloud"; then
echo "Failed to install uncloud binary to ${INSTALL_DIR}" echo "Failed to install uncloud binary to ${INSTALL_DIR}"
print_manual_install print_manual_install
exit 1 exit 1