Skip to content

Commit

Permalink
refactor: Changing goreleaser to use binary instead of .tar.gz
Browse files Browse the repository at this point in the history
  • Loading branch information
logandonley committed Dec 8, 2024
1 parent 8d63aab commit d28229c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
8 changes: 1 addition & 7 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,15 @@ builds:
goarch:
- amd64
- arm64
ignore:
- goos: linux
goarch: arm64

archives:
- format: tar.gz
- format: binary
name_template: >-
{{ .ProjectName }}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
format_overrides:
- goos: windows
format: zip
changelog:
sort: asc
Expand Down
10 changes: 3 additions & 7 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ success() {

# Check for required commands
command -v curl >/dev/null 2>&1 || error "curl is required but not installed"
command -v tar >/dev/null 2>&1 || error "tar is required but not installed"

# Detect OS and architecture
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
Expand Down Expand Up @@ -56,7 +55,7 @@ fi
info "Latest version: $VERSION"

# Generate download URL
DOWNLOAD_URL="https://github.com/${GITHUB_REPO}/releases/download/${VERSION}/${BINARY_NAME}_${OS}_${ARCH}.tar.gz"
DOWNLOAD_URL="https://github.com/${GITHUB_REPO}/releases/download/${VERSION}/${BINARY_NAME}_${OS}_${ARCH}"

# Create temporary directory
TMP_DIR=$(mktemp -d)
Expand All @@ -65,12 +64,9 @@ cleanup() {
}
trap cleanup EXIT

# Download and extract
# Download binary
info "Downloading $DOWNLOAD_URL..."
curl -sL "$DOWNLOAD_URL" -o "$TMP_DIR/fm.tar.gz"

info "Extracting archive..."
tar xzf "$TMP_DIR/fm.tar.gz" -C "$TMP_DIR"
curl -sL "$DOWNLOAD_URL" -o "$TMP_DIR/fm"

# Install binary
info "Installing to $INSTALL_DIR..."
Expand Down

0 comments on commit d28229c

Please # to comment.