~welt/murse

ref: signing murse/Makefile -rw-r--r-- 2.0 KiB
408fd8d8welt Fix garbage JSON when wrapping revisions. 2 months ago
                                                                                
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
.POSIX:

REF := $(shell ( git describe --tags --exact-match 2>/dev/null || git rev-parse HEAD ) | sed 1q )
TMPDIR = /tmp/murse-$(REF)

default:
	go build -tags netgo -ldflags '-s -w' -o build/linux/murse

all: clean linux linux386 windows windows386

clean:
	rm -rf build 

linux:
	mkdir -p build/linux/amd64
	CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -tags netgo -ldflags '-s -w' -o build/linux/amd64/murse
linux386:
	mkdir -p build/linux/386
	CGO_ENABLED=0 GOOS=linux GOARCH=386 go build -tags netgo -ldflags '-s -w' -o build/linux/386/murse
windows:
	mkdir -p build/windows/amd64
	CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -tags netgo -ldflags "-s -w" -o build/windows/amd64/murse.exe 
windows386:
	mkdir -p build/windows/386
	CGO_ENABLED=0 GOOS=windows GOARCH=386 go build -tags netgo -ldflags "-s -w" -o build/windows/386/murse.exe

release:
	rm -rf $(TMPDIR)
	mkdir $(TMPDIR)
	git clone ./ $(TMPDIR)

	cd $(TMPDIR);\
	git checkout $(REF);\
	go mod vendor;\

	cd $(TMPDIR);\
	make all sign archive
	
	mkdir -p build/artifacts
	cp $(TMPDIR)/build/artifacts/* build/artifacts/

	cd $(TMPDIR);\
	make clean;\
	rm -rf .git

	tar czf build/artifacts/murse-$(REF)-src.tar.gz  -C $(TMPDIR)/ .
	gpg --output build/artifacts/murse-$(REF)-src.tar.gz.sig --detach-sig build/artifacts/murse-$(REF)-src.tar.gz

	rm -rf $(TMPDIR)

upload:
	hut git artifact upload build/artifacts/*

archive:
	mkdir -p build/artifacts
	tar czf build/artifacts/murse-$(REF)-linux-amd64.tar.gz -C build/linux/amd64 .
	tar czf build/artifacts/murse-$(REF)-linux-386.tar.gz -C build/linux/386/ .
	zip -j build/murse-$(REF)-windows-amd64.zip build/windows/amd64/*
	zip -j build/murse-$(REF)-windows-386.zip build/windows/386/*

sign:
	gpg --output build/linux/amd64/murse.sig --detach-sig build/linux/amd64/murse
	gpg --output build/linux/386/murse.sig --detach-sig build/linux/386/murse
	gpg --output build/windows/amd64/murse.exe.sig --detach-sig build/windows/amd64/murse.exe
	gpg --output build/windows/386/murse.exe.sig --detach-sig build/windows/386/murse.exe

ref:
	@echo $(REF)