Skip to content

Commit

Permalink
Merge pull request #20 from MassMesh/add-goreleaser
Browse files Browse the repository at this point in the history
Add goreleaser.
  • Loading branch information
cure authored Dec 12, 2021
2 parents f833e85 + ccdf6fe commit 448bd73
Show file tree
Hide file tree
Showing 4 changed files with 114 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist
111 changes: 111 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
before:
hooks:
- go mod tidy
builds:
- id: amd64-server
env:
- cgo_enabled=1
goos:
- linux
goarch:
- amd64
dir: ./cmd/autoygg-server
binary: autoygg-server
mod_timestamp: "{{ .CommitTimestamp }}"
ldflags:
- -s -w -X github.com/massmesh/autoygg/internal.version=v{{.Version}}

- id: amd64-server-static
env:
- CGO_ENABLED=1
goos:
- linux
goarch:
- amd64
dir: ./cmd/autoygg-server
binary: autoygg-server-amd64-static
mod_timestamp: "{{ .CommitTimestamp }}"
ldflags:
- -s -w -extldflags "-static" -X github.com/massmesh/autoygg/internal.Version=v{{.Version}}

- id: arm64-server
env:
- CGO_ENABLED=1
# Needs to have the gcc-aarch64-linux-gnu package installed.
- CC=aarch64-linux-gnu-gcc
goos:
- linux
goarch:
- arm64
dir: ./cmd/autoygg-server
binary: autoygg-server-arm64
mod_timestamp: "{{ .CommitTimestamp }}"
ldflags:
- -s -w -X github.com/massmesh/autoygg/internal.Version=v{{.Version}}

- id: amd64-client
env:
- CGO_ENABLED=1
goos:
- linux
goarch:
- amd64
dir: ./cmd/autoygg-client
binary: autoygg-client
mod_timestamp: "{{ .CommitTimestamp }}"
ldflags:
- -s -w -X github.com/massmesh/autoygg/internal.Version=v{{.Version}}

- id: rpi4-client
env:
- CGO_ENABLED=0
# - CC=aarch64-linux-gnu-gcc
goos:
- linux
goarch:
- arm64
dir: ./cmd/autoygg-client
binary: autoygg-client-rpi4
mod_timestamp: "{{ .CommitTimestamp }}"
flags:
- -v
ldflags:
- -s -w -X github.com/massmesh/autoygg/internal.Version=v{{.Version}}

- id: rpi3-client
env:
- CGO_ENABLED=0
goos:
- linux
goarch:
- arm
goarm:
- 7
dir: ./cmd/autoygg-client
mod_timestamp: "{{ .CommitTimestamp }}"
binary: autoygg-client-rpi3
ldflags:
- -s -w -X github.com/massmesh/autoygg/internal.Version=v{{.Version}}

archives:
- id: golang-cross
builds:
- amd64-server
- amd64-server-static
- arm64-server
- amd64-client
- rpi4-client
- rpi3-client
name_template: "{{ .Binary }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
format: binary

checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ incpatch .Version }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
1 change: 1 addition & 0 deletions cmd/autoygg-client/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
coverage.out
autoygg-client
autoygg-client-*
1 change: 1 addition & 0 deletions cmd/autoygg-server/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
coverage.out
autoygg-server
autoygg-server-*

0 comments on commit 448bd73

Please sign in to comment.