Skip to content

Commit 5e1bd55

Browse files
committed
Add release support
1 parent 036cd20 commit 5e1bd55

File tree

4 files changed

+79
-0
lines changed

4 files changed

+79
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dist

.goreleaser.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
project_name: game-of-life
2+
before:
3+
hooks:
4+
- go mod tidy
5+
- rm -rf dist
6+
- gofumpt -l -w .
7+
builds:
8+
- env:
9+
- CGO_ENABLED=0
10+
goos:
11+
#- darwin
12+
- linux
13+
#- windows
14+
goarch:
15+
- amd64
16+
- "386"
17+
- arm
18+
- arm64
19+
goarm:
20+
- "7"
21+
ldflags:
22+
- -s -w -X=github.com/ebarped/game-of-life/internal.Version={{.Version}} # go tool link flags
23+
ignore:
24+
- goos: windows
25+
goarch: arm
26+
- goos: windows
27+
goarch: arm64
28+
- goos: windows
29+
goarch: "386"
30+
archives:
31+
- format_overrides:
32+
- goos: windows
33+
format: zip
34+
replacements:
35+
darwin: Darwin
36+
linux: Linux
37+
windows: Windows
38+
386: i386
39+
amd64: x86_64
40+
release:
41+
snapshot:
42+
name_template: "{{ .Tag }}-next"
43+

Makefile

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
############## TARGETS SECTION ##############
2+
.PHONY: all test clean
3+
4+
build: # @HELP builds for current GOOS/GOARCH
5+
build:
6+
@goreleaser build --snapshot --single-target --skip-validate
7+
8+
snapshot: # @HELP generate a snapshot for all OS_ARCH combinations
9+
snapshot:
10+
@goreleaser --snapshot --skip-publish
11+
12+
release: # @HELP releases a new version for all OS_ARCH combinations
13+
release:
14+
@goreleaser release
15+
16+
dep-upgrade: # @HELP upgrades all dependencies
17+
dep-upgrade:
18+
@go get -u ./...
19+
@go mod tidy
20+
21+
clean: # @HELP removes built binaries and temporary files
22+
clean:
23+
@rm -rf dist
24+
25+
help: # @HELP prints this message
26+
help:
27+
@echo "TARGETS:"
28+
@grep -E '^.*: *# *@HELP' Makefile \
29+
| awk ' \
30+
BEGIN {FS = ": *# *@HELP"}; \
31+
{ printf " %-30s %s\n", $$1, $$2 }; \
32+
'

internal/version.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
package version
2+
3+
var Version = "version is set by build process"

0 commit comments

Comments
 (0)