diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 7da5d70..ae9a3b5 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -12,6 +12,27 @@ builds: - linux - windows - darwin + - aix + - dragonfly + - freebsd + - netbsd + - openbsd + - plan9 + - solaris + goarch: + - amd64 + - arm + - arm64 + - '386' + - wasm + - mips + - mips64 + - mips64le + - mipsle + - ppc64 + - ppc64le + - riscv64 + - s390x ldflags: - -X main.Version={{.Version}} -s -f @@ -42,7 +63,7 @@ brews: bin.install "gobinsec" # Archive all attachements archives: - - name_template: '{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}' + - name_template: '{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}' format_overrides: - goos: windows format: zip diff --git a/install b/install index 9aa25e3..89c6b6f 100755 --- a/install +++ b/install @@ -4,6 +4,9 @@ # # $ sh -c "$(curl -L https://github.com/intercloud/gobinsec/releases/latest/download/install)" # +# or (if you don't have curl installed): +# +# $ sh -c "$(wget -O - https://github.com/intercloud/gobinsec/releases/latest/download/install)" set -e @@ -83,20 +86,18 @@ else executableFolder="/bin" fi -# check command availability -command -v curl >/dev/null 2>&1 || { logF "curl is required"; } +if command -v curl >/dev/null 2>&1; then + downloadCmd="curl -sS --fail --location --output " +elif command -v wget >/dev/null 2>&1; then + downloadCmd="wget --quiet --output-document=" +else + logF "curl or wget is required" +fi # Set URI to download assetUri="${githubUrl}/${owner}/${repo}/releases/download/${version}/${fileName}" -if [[ "${version}" == "latest" ]]; then - - asset=$( - curl -sSf ${githubUrl}/${owner}/${repo}/releases | - grep -o "${owner}/${repo}/releases/download/.*/${fileName}" | - head -n 1 - ) - - assetUri="${githubUrl}/${asset}" +if [ "${version}" = "latest" ]; then + assetUri="${githubUrl}/${owner}/${repo}/releases/latest/download/${fileName}" fi downloadFolder="/tmp/${binary}" @@ -104,7 +105,7 @@ mkdir -p ${downloadFolder} downloadedFile="${downloadFolder}/${fileName}" log "[1/2] Download ${assetUri}" -curl -sS --fail --location --output "${downloadedFile}" "${assetUri}" +$downloadCmd"${downloadedFile}" "${assetUri}" log "[2/2] Install ${binary} to '${executableFolder}'" if [ -w "${directory}" ]; then