From 686961a8e67dc1bdc4fb450ab8c51a3e1972ede8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A5le=20Dahl?= Date: Tue, 10 May 2022 17:24:37 +0200 Subject: [PATCH] Zip release files when building --- .github/workflows/release.yml | 2 +- Makefile | 19 ++++++++++++++----- README.md | 12 +++++++++++- 3 files changed, 26 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5d9ab9b..a44c71d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,5 +24,5 @@ jobs: - uses: ncipollo/release-action@v1 with: - artifacts: "bin/span.*" + artifacts: "bin/*.zip" token: ${{ secrets.GITHUB_TOKEN }} diff --git a/Makefile b/Makefile index c13b211..8add204 100644 --- a/Makefile +++ b/Makefile @@ -11,11 +11,20 @@ LDFLAGS := "-X github.com/lab5e/spancli/pkg/global.Version=$(VERSION)" all: test vet span release: all - @cd cmd/span && GOOS=linux GOARCH=amd64 go build -ldflags=$(LDFLAGS) -o ../../bin/span.amd64-linux - @cd cmd/span && GOOS=darwin GOARCH=amd64 go build -ldflags=$(LDFLAGS) -o ../../bin/span.amd64-macOS - @cd cmd/span && GOOS=darwin GOARCH=arm64 go build -ldflags=$(LDFLAGS) -o ../../bin/span.arm64-macOS - @cd cmd/span && GOOS=windows GOARCH=amd64 go build -ldflags=$(LDFLAGS) -o ../../bin/span.amd64-win.exe - @cd cmd/span && GOOS=linux GOARCH=arm GOARM=5 go build -ldflags=$(LDFLAGS) -o ../../bin/span.arm5-rpi-linux + @cd cmd/span && GOOS=linux GOARCH=amd64 go build -ldflags=$(LDFLAGS) -o ../../bin/span + @cd bin && zip span.amd64-linux.zip span && rm span + + @cd cmd/span && GOOS=darwin GOARCH=amd64 go build -ldflags=$(LDFLAGS) -o ../../bin/span + @cd bin && zip span.amd64-macos.zip span && rm span + + @cd cmd/span && GOOS=darwin GOARCH=arm64 go build -ldflags=$(LDFLAGS) -o ../../bin/span + @cd bin && zip span.arm64-macos.zip span && rm span + + @cd cmd/span && GOOS=windows GOARCH=amd64 go build -ldflags=$(LDFLAGS) -o ../../bin/span.exe + @cd bin && zip span.amd64-win.zip span.exe && rm span.exe + + @cd cmd/span && GOOS=linux GOARCH=arm GOARM=5 go build -ldflags=$(LDFLAGS) -o ../../bin/span + @cd bin && zip span.arm5-rpi-linux.zip span && rm span clean: @rm -rf bin diff --git a/README.md b/README.md index 168858e..48a45c7 100644 --- a/README.md +++ b/README.md @@ -7,10 +7,20 @@ install of this command. ## Installing -You can install this utility by issuing the following command. +If you have Go installed you can install this utility by issuing the following command. go get github.com/lab5e/spancli/cmd/span@latest +Alternatively you can download one of the prebuilt binaries from the [releases page](https://github.com/lab5e/spancli/releases) + +* [Windows](https://github.com/lab5e/spancli/releases/download/span.amd64-win.zip) +* [Linux](https://github.com/lab5e/spancli/releases/download/span.amd64-linux.zip) +* [MacOS (Intel-based)](https://github.com/lab5e/spancli/releases/download/span.amd64-macos.zip) +* [MacOS (M1-based)](https://github.com/lab5e/spancli/releases/download/span.arm64-macos.zip) +* [Raspberry Pi (ARM5)](https://github.com/lab5e/spancli/releases/download/span.arm5-rpi-linux.zip) + +Note that the executables are *not signed*. + ## Usage The general usage of `span` is