Skip to content

Commit

Permalink
Add Go releaser and version to binary
Browse files Browse the repository at this point in the history
  • Loading branch information
eloylp committed Nov 23, 2019
1 parent 0e220dc commit 60cb0af
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
before:
hooks:
- go mod download
builds:
- binary: gol
ldflags:
- -s -w -X main.version={{.Version}}
env:
- CGO_ENABLED=0
goos:
- linux
- darwin
- windows
goarch:
- amd64
- 386
- arm
- arm64
goarm:
- 7
- 6
- 5
ignore:
- goos: darwin
goarch: 386
- goos: openbsd
goarch: arm
- goos: freebsd
goarch: arm
archives:
- replacements:
darwin: Darwin
linux: Linux
windows: Windows
386: i386
amd64: x86_64
format_overrides:
- goos: windows
format: zip
id: gol
format: binary

checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ .Tag }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
5 changes: 5 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
package main

import (
"fmt"
"log"
)

var Version string

func main() {

cfg := Config()
if err := CheckConfig(cfg); err != nil {
log.Fatal(err)
}
fmt.Println("Conway`s game of life")
fmt.Println(Version)
b := RandomBoard(cfg.boardX, cfg.boardY)
g := NewGame(b, cfg.generations, cfg.intervalSecs)
g.Run()
Expand Down

0 comments on commit 60cb0af

Please sign in to comment.