From 8f7cef338b9f7d412a83f7bad4b2a78a41c8c72b Mon Sep 17 00:00:00 2001 From: Chung-Ting Huang Date: Thu, 26 Jul 2018 15:45:18 -0500 Subject: [PATCH] TUN-804: create makefile recipe to release cloudflared using equinox --- Makefile | 18 +++++++++++++++++ cfsetup.yaml | 57 +++++++++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 72 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index d5e60f08..d510847b 100644 --- a/Makefile +++ b/Makefile @@ -6,6 +6,16 @@ IMPORT_PATH := github.com/cloudflare/cloudflared PACKAGE_DIR := $(CURDIR)/packaging INSTALL_BINDIR := usr/local/bin +EQUINOX_FLAGS = --version="$(VERSION)" \ + --platforms="$(EQUINOX_BUILD_PLATFORMS)" \ + --app="$(EQUINOX_APP_ID)" \ + --token="$(EQUINOX_TOKEN)" \ + --channel="$(EQUINOX_CHANNEL)" + +ifeq ($(EQUINOX_IS_DRAFT), true) + EQUINOX_FLAGS := --draft $(EQUINOX_FLAGS) +endif + .PHONY: all all: cloudflared test @@ -23,3 +33,11 @@ cloudflared-deb: cloudflared cp cloudflared $(PACKAGE_DIR)/cloudflared fakeroot fpm -C $(PACKAGE_DIR) -s dir -t deb --deb-compression bzip2 \ -a $(GOARCH) -v $(VERSION) -n cloudflared + +.PHONY: release +release: bin/equinox + bin/equinox release $(EQUINOX_FLAGS) -- $(VERSION_FLAGS) $(IMPORT_PATH)/cmd/cloudflared + +bin/equinox: + mkdir -p bin + curl -s https://bin.equinox.io/c/75JtLRTsJ3n/release-tool-beta-$(EQUINOX_PLATFORM).tgz | tar xz -C bin/ diff --git a/cfsetup.yaml b/cfsetup.yaml index 4936fc62..de5e0b72 100644 --- a/cfsetup.yaml +++ b/cfsetup.yaml @@ -8,7 +8,6 @@ stretch: - build-essential post-cache: - export GOPATH=/cfsetup_build/ - - export CGO_ENABLED=1 - export GOOS=linux - export GOARCH=amd64 - make cloudflared @@ -21,10 +20,63 @@ stretch: - rubygem-fpm post-cache: - export GOPATH=/cfsetup_build/ - - export CGO_ENABLED=1 - export GOOS=linux - export GOARCH=amd64 - make cloudflared-deb + release-linux-amd64: + build_dir: *build_dir + builddeps: + - *pinned_go + - build-essential + post-cache: + - export GOPATH=/cfsetup_build/ + - export GOOS=linux + - export GOARCH=amd64 + - make release + release-linux-armv6: + build_dir: *build_dir + builddeps: + - *pinned_go + - crossbuild-essential-armhf + - gcc-arm-linux-gnueabihf + post-cache: + - export GOPATH=/cfsetup_build/ + - export GOOS=linux + - export GOARCH=arm + - export CC=arm-linux-gnueabihf-gcc + - make release + release-linux-386: + build_dir: *build_dir + builddeps: + - *pinned_go + - gcc-multilib + post-cache: + - export GOPATH=/cfsetup_build/ + - export GOOS=linux + - export GOARCH=386 + - make release + release-windows-amd64: + build_dir: *build_dir + builddeps: + - *pinned_go + - gcc-mingw-w64 + post-cache: + - export GOPATH=/cfsetup_build/ + - export GOOS=windows + - export GOARCH=amd64 + - export CC=x86_64-w64-mingw32-gcc + - make release + release-windows-386: + build_dir: *build_dir + builddeps: + - *pinned_go + - gcc-mingw-w64 + post-cache: + - export GOPATH=/cfsetup_build/ + - export GOOS=windows + - export GOARCH=386 + - export CC=i686-w64-mingw32-gcc-win32 + - make release test: build_dir: *build_dir builddeps: @@ -32,7 +84,6 @@ stretch: - build-essential post-cache: - export GOPATH=/cfsetup_build/ - - export CGO_ENABLED=1 - export GOOS=linux - export GOARCH=amd64 - make test