Skip to content

Commit

Permalink
Add per platform executables (#103)
Browse files Browse the repository at this point in the history
Adding the `goreleaser.yaml` file to build binaries for MacOS, Linux,
and Windows. Yes, we are finally doing this.
  • Loading branch information
CtrlSpice authored Mar 27, 2023
1 parent 167efb4 commit 4917612
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 80 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.DS_Store
otel-desktop-viewer
desktop-exporter/node_modules
.vscode
.vscode/*
.vscode/
dist/
38 changes: 38 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@

before:
hooks:
- go mod tidy
- go generate ./...
builds:
- env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin

archives:
- format: tar.gz
# this name template makes the OS and Arch compatible with the results of uname.
name_template: >-
{{ .ProjectName }}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}v{{ .Arm }}{{ end }}
# use zip for windows archives
format_overrides:
- goos: windows
format: zip
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ incpatch .Version }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'

3 changes: 1 addition & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ require (
github.com/klauspost/compress v1.15.13 // indirect
github.com/knadh/koanf v1.4.4 // indirect
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
github.com/magiconair/properties v1.8.6 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
Expand All @@ -57,7 +56,7 @@ require (
github.com/prometheus/statsd_exporter v0.22.7 // indirect
github.com/rs/cors v1.8.3 // indirect
github.com/shirou/gopsutil/v3 v3.22.12 // indirect
github.com/spf13/cobra v1.6.1 // indirect
github.com/spf13/cobra v1.6.1
github.com/spf13/pflag v1.0.5 // indirect
github.com/tklauser/go-sysconf v0.3.11 // indirect
github.com/tklauser/numcpus v0.6.0 // indirect
Expand Down
Loading

0 comments on commit 4917612

Please sign in to comment.