Skip to content

Commit

Permalink
Merge pull request #739 from aptly-dev/travis-binaries
Browse files Browse the repository at this point in the history
add support for travis attaching build artifacts to releases
  • Loading branch information
hsitter committed May 15, 2018
2 parents d31144b + 9a30a11 commit 5f904a1
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -35,3 +35,6 @@ man/aptly.1.ronn
.goxc.local.json

system/env/

# created by make build for release artifacts
build/
19 changes: 18 additions & 1 deletion .travis.yml
Expand Up @@ -29,7 +29,9 @@ matrix:
- go: 1.9.x
env: RUN_LONG_TESTS=yes
- go: 1.10.x
env: RUN_LONG_TESTS=yes
env:
- RUN_LONG_TESTS=yes
- DEPLOY_BINARIES=yes
- go: master
env: RUN_LONG_TESTS=no

Expand All @@ -54,3 +56,18 @@ notifications:
on_success: change # options: [always|never|change] default: always
on_failure: always # options: [always|never|change] default: always
on_start: false # default: false

before_deploy:
- make build
- export FILE_TO_UPLOAD=$(ls build/aptly-*)

deploy:
provider: releases
api_key:
- secure: "MMk5S1Im6RrVudZasjtlCJa/rvRp4oavrR86WI2kQszs1iZIcdGyVhHiOGfWTwMjA/3iPdbAdu/WrjxCwI14GC5ws+rs8ICO6JIZktjtAwlfwlrV+nsrCiYx1EThghq43VEcykgz2UAJoJj/egv+UCEpe8yDTsvJ6we5HiXdTw0="
file_glob: true
file: "${FILE_TO_UPLOAD}"
skip_cleanup: true
on:
tags: true
condition: "$DEPLOY_BINARIES = yes"
14 changes: 12 additions & 2 deletions Makefile
@@ -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?=
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -71,4 +81,4 @@ man:
version:
@echo $(VERSION)

.PHONY: man version
.PHONY: man version build

0 comments on commit 5f904a1

Please sign in to comment.