File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : publish release
2+ on :
3+ push :
4+ tags :
5+ - " *"
6+
7+ jobs :
8+ release :
9+ runs-on : ubuntu-latest
10+ steps :
11+ - name : Checkout
12+ uses : actions/checkout@v2
13+ with :
14+ submodules : true
15+
16+ - name : Set up Docker Buildx
17+ uses : docker/setup-buildx-action@v1
18+
19+ - name : Install Go
20+ uses : actions/setup-go@v2
21+ with :
22+ go-version : 1.19
23+
24+ - name : Build binaries
25+ run : |
26+ make all
27+ ls builds/
28+
29+ - name : Release files
30+ uses : softprops/action-gh-release@v1
31+ with :
32+ files : builds/*
Original file line number Diff line number Diff line change 1515# vendor/
1616/.idea /*
1717/coverage.txt
18+ /builds /
Original file line number Diff line number Diff line change 11OS = darwin linux windows
2- ARCH = amd64
2+ ARCH = amd64 arm64
33export DRIVER =$(shell which chromedriver)
44
55default :
@@ -11,18 +11,42 @@ static:
1111 CGO_ENABLED=0 go build -a -ldflags ' -s -w -extldflags "-static"' .
1212
1313all :
14- git pull
14+ make clean
1515 @echo " Build all platform executables..."
1616 @for o in $(OS ) ; do \
1717 for a in $(ARCH) ; do \
18- CGO_ENABLED=0 GOOS=$$o GOARCH=$$a go build -ldflags="-s -w" -o builds/DailyGakki-$$o-$$a .; \
19- done \
18+ echo "Building $$o-$$a..."; \
19+ if [ "$$o" = "windows" ]; then \
20+ CGO_ENABLED=0 GOOS=$$o GOARCH=$$a go build -ldflags="-s -w" -o builds/archiver-$$o-$$a.exe .; \
21+ else \
22+ CGO_ENABLED=0 GOOS=$$o GOARCH=$$a go build -ldflags="-s -w" -o builds/archiver-$$o-$$a .; \
23+ fi; \
24+ done \
2025 done
2126
27+ @make universal
28+ @make checksum
2229
2330clean :
2431 @rm -rf builds
2532 @rm -f archiver
2633
2734test :
2835 go test -v -coverprofile=coverage.txt -covermode=atomic
36+
37+ checksum : builds/*
38+ @echo " Generating checksums..."
39+ if [ " $( shell uname) " = " Darwin" ]; then \
40+ shasum -a 256 $^ >> builds/checksum-sha256sum.txt ; \
41+ else \
42+ sha256sum $^ >> builds/checksum-sha256sum.txt; \
43+ fi
44+
45+
46+ universal :
47+ @echo " Building macOS universal binary..."
48+ docker run --rm -v $(shell pwd) /builds:/app/ bennythink/lipo-linux -create -output \
49+ archiver-darwin-universal \
50+ archiver-darwin-amd64 archiver-darwin-arm64
51+
52+ file builds/archiver-darwin-universal
You can’t perform that action at this time.
0 commit comments