From aa5e551de6d22ea493a02717d496b92689ec1da8 Mon Sep 17 00:00:00 2001 From: Chung-Ting Huang Date: Wed, 15 Aug 2018 17:11:30 -0700 Subject: [PATCH] TUN-901: makefile target for homebrew release --- Makefile | 14 ++++++++++++++ publish-homebrew-formula.sh | 31 +++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100755 publish-homebrew-formula.sh diff --git a/Makefile b/Makefile index d510847b..4234695b 100644 --- a/Makefile +++ b/Makefile @@ -34,6 +34,20 @@ cloudflared-deb: cloudflared fakeroot fpm -C $(PACKAGE_DIR) -s dir -t deb --deb-compression bzip2 \ -a $(GOARCH) -v $(VERSION) -n cloudflared +.PHONY: cloudflared-darwin-amd64.tgz +cloudflared-darwin-amd64.tgz: cloudflared + tar czf cloudflared-darwin-amd64.tgz cloudflared + rm cloudflared + +.PHONY: homebrew-upload +homebrew-upload: cloudflared-darwin-amd64.tgz + aws s3 --endpoint-url $(S3_ENDPOINT) cp --acl public-read $$^ $(S3_URI)/cloudflared-$$(VERSION)-$1.tgz + aws s3 --endpoint-url $(S3_ENDPOINT) cp --acl public-read $(S3_URI)/cloudflared-$$(VERSION)-$1.tgz $(S3_URI)/cloudflared-stable-$1.tgz + +.PHONY: homebrew-release +homebrew-release: homebrew-upload + ./publish-homebrew-formula.sh cloudflared-darwin-amd64.tgz $(VERSION) homebrew-cloudflare + .PHONY: release release: bin/equinox bin/equinox release $(EQUINOX_FLAGS) -- $(VERSION_FLAGS) $(IMPORT_PATH)/cmd/cloudflared diff --git a/publish-homebrew-formula.sh b/publish-homebrew-formula.sh new file mode 100755 index 00000000..3635fd07 --- /dev/null +++ b/publish-homebrew-formula.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +FILENAME=$1 +VERSION=$2 +TAP_ROOT=$3 +URL="https://developers.cloudflare.com/argo-tunnel/dl/cloudflared-${VERSION}-darwin-amd64.tgz" +SHA256=$(sha256sum -b "${FILENAME}" | cut -b1-64) + +cd "${TAP_ROOT}" || exit 1 +git checkout -f master +git reset --hard origin/master + +tee cloudflared.rb <