From f0ae48af4c0ff9319accb49e38234c20748f73ee Mon Sep 17 00:00:00 2001 From: Ben Johnson Date: Sun, 24 Jan 2021 08:47:16 -0700 Subject: [PATCH] Add signed homebrew install --- Makefile | 13 ++++++++----- README.md | 10 ++++++++++ etc/gon.hcl | 15 +++++++++++++++ 3 files changed, 33 insertions(+), 5 deletions(-) create mode 100644 etc/gon.hcl diff --git a/Makefile b/Makefile index 1524d97..5200b16 100644 --- a/Makefile +++ b/Makefile @@ -1,19 +1,22 @@ default: -dist: +dist-linux: mkdir -p dist cp etc/litestream.yml dist/litestream.yml docker run --rm -v "${PWD}":/usr/src/litestream -w /usr/src/litestream -e GOOS=linux -e GOARCH=amd64 golang:1.15 go build -v -o dist/litestream ./cmd/litestream tar -cz -f dist/litestream-linux-amd64.tar.gz -C dist litestream -deb: dist +dist-macos: ifndef LITESTREAM_VERSION $(error LITESTREAM_VERSION is undefined) endif - cat etc/nfpm.yml | envsubst > dist/nfpm.yml - nfpm pkg --config dist/nfpm.yml --packager deb --target dist/litestream.deb + mkdir -p dist + go build -v -ldflags "-X 'main.Version=${LITESTREAM_VERSION}'" -o dist/litestream ./cmd/litestream + gon etc/gon.hcl + mv dist/litestream.zip dist/litestream-${LITESTREAM_VERSION}-darwin-amd64.zip + openssl dgst -sha256 dist/litestream-${LITESTREAM_VERSION}-darwin-amd64.zip clean: rm -rf dist -.PHONY: deb dist clean +.PHONY: default dist-linux dist-macos clean diff --git a/README.md b/README.md index 53753b1..a6230e9 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,16 @@ GitHub. ## Installation +### Mac OS (Homebrew) + +To install from homebrew, first add the Litestream tap and then install: + +```sh +$ brew tap benbjohnson/litestream +$ brew install litestream +``` + + ### Linux (Debian) You can download the `.deb` file from the [Releases page][releases] page and diff --git a/etc/gon.hcl b/etc/gon.hcl new file mode 100644 index 0000000..7a614a3 --- /dev/null +++ b/etc/gon.hcl @@ -0,0 +1,15 @@ +source = ["./dist/litestream"] +bundle_id = "com.middlemost.litestream" + +apple_id { + username = "benbjohnson@yahoo.com" + password = "@env:AC_PASSWORD" +} + +sign { + application_identity = "Developer ID Application: Middlemost Systems, LLC" +} + +zip { + output_path = "dist/litestream.zip" +}