-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
26 lines (24 loc) · 974 Bytes
/
Makefile
File metadata and controls
26 lines (24 loc) · 974 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
.PHONY: release-patch
release-patch:
git add .
$(eval CURRENT_VERSION=$(shell git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0"))
$(eval NEW_VERSION=$(shell echo $(CURRENT_VERSION) | awk -F. -v OFS=. '{$$NF++;} 1'))
git commit --no-verify --allow-empty -m "patch release $(NEW_VERSION)"
git push origin main
git tag $(NEW_VERSION)
git push origin $(NEW_VERSION)
.PHONY: release-minor
release-minor:
git add .
$(eval CURRENT_VERSION=$(shell git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0"))
$(eval NEW_VERSION=$(shell echo $(CURRENT_VERSION) | awk -F. -v OFS=. '{$$2++; $$NF=0} 1'))
git commit --no-verify --allow-empty -m "minor release $(NEW_VERSION)"
git push origin main
git tag $(NEW_VERSION)
git push origin $(NEW_VERSION)
build-windows:
GOOS=windows GOARCH=amd64 go build -o bin/main.exe main.go
build-linux:
GOOS=linux GOARCH=amd64 go build -o bin/main main.go
build-mac:
GOOS=darwin GOARCH=amd64 go build -o bin/main main.go