Skip to content
This repository was archived by the owner on Jan 7, 2025. It is now read-only.

Commit 2f2fa87

Browse files
committed
package as zip
Signed-off-by: Johan Siebens <[email protected]>
1 parent 489067f commit 2f2fa87

File tree

3 files changed

+21
-10
lines changed

3 files changed

+21
-10
lines changed

.github/workflows/release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
with:
1717
fetch-depth: 1
1818

19-
- run: make test dist hash
19+
- run: make test dist
2020

2121
- uses: skx/github-action-publish-binaries@master
2222
env:

Makefile

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ SHELL := bash
22
LDFLAGS := "-s -w"
33
.PHONY: all
44

5+
.PHONY: %.zip
6+
%.zip:
7+
touch $@
8+
59
.PHONY: test
610
test:
711
go test ./...
@@ -13,12 +17,9 @@ build:
1317
.PHONY: dist
1418
dist:
1519
mkdir -p dist
16-
GOOS=linux go build -ldflags $(LDFLAGS) -o dist/do-droplets
17-
GOOS=darwin go build -ldflags $(LDFLAGS) -o dist/do-droplets-darwin
18-
GOOS=linux GOARCH=arm GOARM=6 go build -ldflags $(LDFLAGS) -o dist/do-droplets-armhf
19-
GOOS=linux GOARCH=arm64 go build -ldflags $(LDFLAGS) -o dist/do-droplets-arm64
20-
GOOS=windows go build -ldflags $(LDFLAGS) -o dist/do-droplets.exe
21-
22-
.PHONY: hash
23-
hash:
24-
for f in dist/do-droplets*; do shasum -a 256 $$f > $$f.sha256; done
20+
./scripts/dist.sh linux amd64
21+
./scripts/dist.sh linux arm64
22+
./scripts/dist.sh linux arm
23+
./scripts/dist.sh darwin amd64
24+
./scripts/dist.sh windows amd64
25+
cd dist && shasum -a 256 *.zip > do-droplets_SHA256SUMS && cd ..

scripts/dist.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
3+
suffix=""
4+
if [ $1 == "windows" ]; then
5+
suffix=".exe"
6+
fi
7+
8+
GOOS=$1 GOARCH=$2 go build -ldflags "-s -w" -o "dist/do-droplets${suffix}"
9+
zip -j dist/do-droplets_$1_$2.zip "dist/do-droplets${suffix}"
10+
rm -rf "dist/do-droplets${suffix}"

0 commit comments

Comments
 (0)