Skip to content

Commit

Permalink
chore: setup goreleaser
Browse files Browse the repository at this point in the history
  • Loading branch information
xNaCly committed Mar 28, 2023
1 parent b1ed7a3 commit f0e7312
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

dist/
34 changes: 34 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# This is an example .goreleaser.yml file with some sensible defaults.
# Make sure to check the documentation at https://goreleaser.com
builds:
- ldflags: -s -w -X main.VERSION={{ .Version }} -X main.COMMITSHA={{ .Commit }} -X main.COMMITDATE={{ .CommitDate }}
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 }}_{{ .Version }}_{{- 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:"
2 changes: 1 addition & 1 deletion cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,5 +110,5 @@ website: https://github.com/xnacly/gleichzeitig`)
}

func printVersion() {
fmt.Printf("gleichzeitig v%s\n", VERSION)
fmt.Printf("gleichzeitig [version=%s] [commit=%s] [commitDate=%s]\n", VERSION, COMMITSHA, COMMITDATE)
}
5 changes: 4 additions & 1 deletion gleichzeitig.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ import (
"os/signal"
)

var VERSION = "0.0.1"
var VERSION = ""
var COMMITSHA = ""
var COMMITDATE = ""

var CONFIG Config = Config{}

func main() {
Expand Down

0 comments on commit f0e7312

Please sign in to comment.