add support for travis attaching build artifacts to releases

- new phony target build: same as install but creating aptly-$version and
  putting it into a build/ subdir
- env TRAVIS_TAG in the makefile now overrides the TAG lookup, this ensures
  that the tag travis is working with is actually the one being used to
  construct the version number
- subdir is gitignored
- travis runs new target - lists artifacts - deploys artifacts to github

all of the above only happens on builds that are a tag and DEPLOY_BINARIES
is set to yes (which is only the case for latest stable go version)
This commit is contained in:
Harald Sitter
2018-05-14 17:27:14 +02:00
parent d31144b9ae
commit 9a30a11786
3 changed files with 33 additions and 3 deletions
+12 -2
View File
@@ -1,5 +1,10 @@
GOVERSION=$(shell go version | awk '{print $$3;}')
VERSION=$(shell git describe --tags | sed 's@^v@@' | sed 's@-@+@g')
ifdef TRAVIS_TAG
TAG=$(TRAVIS_TAG)
else
TAG="$(shell git describe --tags)"
endif
VERSION=$(shell echo $(TAG) | sed 's@^v@@' | sed 's@-@+@g')
PACKAGES=context database deb files gpg http query swift s3 utils
PYTHON?=python
TESTS?=
@@ -31,6 +36,11 @@ endif
install:
go install -v -ldflags "-X main.Version=$(VERSION)"
build:
rm -rf build
mkdir -p build
go build -v -ldflags "-X main.Version=$(VERSION)" -o "build/aptly-$(VERSION)"
system/env: system/requirements.txt
ifeq ($(RUN_LONG_TESTS), yes)
rm -rf system/env
@@ -71,4 +81,4 @@ man:
version:
@echo $(VERSION)
.PHONY: man version
.PHONY: man version build