From a338e27c1eefbb3fe105bdc8389566f489ae5fd5 Mon Sep 17 00:00:00 2001 From: Thibault Gilles Date: Fri, 9 Nov 2018 16:50:54 +0100 Subject: [PATCH] Criteo: travis build Change-Id: I6f6913b3f07ede35c40bb92294ee506b0dd9dc4c --- .travis.yml | 27 +++++++++++++++++++++++++++ GNUmakefile | 14 ++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000000..2be90737125c --- /dev/null +++ b/.travis.yml @@ -0,0 +1,27 @@ +language: go + +go: + - "1.14.2" + +script: + - export VERSION=$(echo $TRAVIS_TAG | sed 's/^v//' ) + - export PRERELEASE=$(echo $VERSION | cut -d '-' -f 2) + - sed -i "s/VersionPrerelease = \".*\"/VersionPrerelease = \"$PRERELEASE\"/" version/version.go + - make -j 3 multiarch + +sudo: false + +before_deploy: + - echo "Deploying $VERSION(-$PRERELEASE) to GitHub releases" + - for d in $(find ./pkg/bin -maxdepth 1 -mindepth 1 -type d | cut -d '/' -f4); do zip -j consul_${VERSION}_${d}.zip ./pkg/bin/${d}/consul* ; done + +deploy: + provider: releases + api_key: + secure: D3SCrX3k1UkNnJPi6tjYgoRmVLrDwXq/hvvRh4VD+H8HnYeheJxokhLbvL3IjHFaE/ruoNFeCyIWLGoNVnPtooeUV5+k4m8Raj3utPNV8esLXRVc0vRwpTYPmCbdjXyNuiHtrFI231caQfUv4vKmCWCy8OWu+fO4BUrjcO86HIEIzcG2ovSCRhLmjmAqDuZl077oYZ7xSkScW9yDtU09fCZxsQdxevkxG8pQ0mifPvbXrb9+Vz86VD/3c6S0KeLRaw+OppTreRZcVFQVZJQFyvu9kVWK2MwKlSNXcOKBb62c1HsZluveotnghCAJ/2R/7ndrKCip2iYwTEeNlvsm4apVPJgjndvpw5Av4jgtb5xaY/MyTcS3fKRmlVg6C7Laroq+VOkQXhnDA6I7B7gQWPXG7TChpd8M40Ua7X53JA9SxMxJeVISm9KY/dxQeaffubjE2PzDG0FREZvqrmIEdeXsy8uqdz1T/Ftnu7k4i6rYhadaqSDSyQ7T7yPkdg9wsP0GDPlBeejp/P2kgqcBki6QvM7k/9FaJre29/FhGuiTdCiC927mCLTZUnL2J1QoVL0C7ctDIrMGhwXcZwVEEtuyim4EznNvj9Ds7WgbjdJHWWfHeJ+UHT+ZMY4mciK8MrDWPzKTzPCj+keJg8yiCPMkWJcScZVCj4WBWZd0Z/E= + file_glob: true + file: consul_*.zip + skip_cleanup: true + on: + repo: criteo-forks/consul + tags: true diff --git a/GNUmakefile b/GNUmakefile index edba540f6e17..5d1d03151e6c 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -189,6 +189,20 @@ changelogfmt: linux: @$(SHELL) $(CURDIR)/build-support/scripts/build-local.sh -o linux -a amd64 +pkg/bin/windows_amd64/consul.exe: + mkdir -p pkg/bin/windows_amd64 + GOOS=windows GOARCH=amd64 go build -o pkg/bin/windows_amd64/consul.exe + +pkg/bin/linux_amd64/consul: + mkdir -p pkg/bin/linux_amd64 + GOOS=linux GOARCH=amd64 go build -o pkg/bin/linux_amd64/consul + +pkg/bin/darwin_amd64/consul: + mkdir -p pkg/bin/darwin_amd64 + GOOS=darwin GOARCH=amd64 go build -o pkg/bin/darwin_amd64/consul + +multiarch: pkg/bin/windows_amd64/consul.exe pkg/bin/linux_amd64/consul pkg/bin/darwin_amd64/consul + # dist builds binaries for all platforms and packages them for distribution dist: @$(SHELL) $(CURDIR)/build-support/scripts/release.sh -t '$(DIST_TAG)' -b '$(DIST_BUILD)' -S '$(DIST_SIGN)' $(DIST_VERSION_ARG) $(DIST_DATE_ARG) $(DIST_REL_ARG)