Skip to content

Commit

Permalink
Add GoReleaser configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
maddie committed Mar 19, 2020
1 parent 0ebda01 commit c3ad222
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,5 @@ fabric.properties

# Dependency directories (remove the comment below to include it)
# vendor/

dist/
68 changes: 68 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
project_name: 'librespeed-cli'
#dist: ./out
before:
hooks:
- go mod download
builds:
- main: ./main.go
env:
- CGO_ENABLED=0
flags:
- -trimpath
ldflags:
- -w -s -X "librespeed-cli/defs.ProgName={{ .ProjectName }}" -X "librespeed-cli/defs.ProgVersion=v{{ .Version }}" -X "librespeed-cli/defs.BuildDate={{ .Date }}"
goos:
- windows
- linux
- darwin
- freebsd
goarch:
- 386
- amd64
- arm
- arm64
- mips
- mipsle
- mips64
- mips64le
goarm:
- 5
- 6
- 7
gomips:
- hardfloat
- softfloat
ignore:
- goos: darwin
goarch: 386
hooks:
post: ./upx.sh
archives:
- format_overrides:
- goos: windows
format: zip
files:
- LICENSE
checksum:
name_template: 'checksums.txt'
changelog:
skip: false
sort: asc
brews:
- github:
owner: librespeed
name: homebrew-tap
commit_author:
name: "Maddie Zhan"
email: maddie.zhan@gmail.com
folder: Formula
homepage: "https://github.com/librespeed/speedtest-cli"
description: "Command-line client for LibreSpeed"
skip_upload: true
custom_block: |
head "https://github.com/librespeed/speedtest-cli.git"
release:
github:
owner: librespeed
name: speedtest-cli
disable: false
2 changes: 2 additions & 0 deletions upx.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
(which upx > /dev/null && ls -1 dist/*/* | xargs -I{} -n1 -P 4 $(which upx) -9 "{}") || echo "not using upx for binary compression"

0 comments on commit c3ad222

Please sign in to comment.