-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
39 lines (29 loc) · 1.39 KB
/
Makefile
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
27
28
29
30
31
32
33
34
35
36
37
38
39
COMMIT ?= $(shell git describe --tags --always --dirty --match=v* 2> /dev/null || echo v0)
BUILDTIME ?= $(shell date +"%Y.%m.%d.%H%M%S")
BUILDSETTING=-X github.com/onaci/cirrid/install.Commit=$(COMMIT) -X github.com/onaci/cirrid/install.BuildTime=$(BUILDTIME)
all: clean cirrid cirrid-osx cirrid.exe
clean:
rm cirrid cirrid-osx cirrid.exe | true
cirrid:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -tags netgo -ldflags '-w -extldflags "-static" $(BUILDSETTING)' -o cirrid
cirrid-osx:
env GOOS=darwin GOARCH=amd64 go build -a -o cirrid-osx -ldflags="-s -w $(BUILDSETTING)"
cirrid.exe:
env GOOS=windows GOARCH=amd64 go build -a -o cirrid.exe -ldflags="-s -w $(BUILDSETTING)"
github-release: clean
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -tags netgo -ldflags '-w -extldflags "-static" $(BUILDSETTING)' -o cirrid
env GOOS=darwin GOARCH=amd64 go build -a -o cirrid-osx -ldflags="-s -w $(BUILDSETTING)"
# need to fix windows builds later
env GOOS=windows GOARCH=amd64 go build -a -o cirrid.exe -ldflags="-s -w $(BUILDSETTING)"
hub release create \
--draft \
--prerelease \
--commitish master \
--message "20 May 2021, cirrid ona.im DNS shim for OSX and Linux." \
--attach "cirrid#Linux amd64" \
--attach "cirrid-osx#OS X amd64" \
--attach "cirrid.exe#Windows amd64" \
v0.$(BUILDTIME)
docker-release:
docker build -t onaci/cirrid:cmdline .
docker push onaci/cirrid:cmdline