use travis jobs to automate releases

This commit is contained in:
Tomas Kral
2018-02-13 14:03:00 +01:00
parent 6e9af357c7
commit acbbe99ef3
3 changed files with 70 additions and 34 deletions

2
.gitignore vendored
View File

@@ -4,6 +4,8 @@
# Ignore compiled files
ocdev
dist
bin
# Ignore coverage report
coverage.txt

View File

@@ -1,31 +1,42 @@
dist: trusty
sudo: required
sudo: false
language: go
go:
- 1.8
- 1.9
go_import_path: github.com/redhat-developer/ocdev
install:
jobs:
include:
# YAML alias, for settings shared across the tests
- &base-test
stage: test
go_import_path: github.com/redhat-developer/ocdev
go: 1.8
install:
- make goget-tools
script:
- make bin
- make validate
script:
- make
- <<: *base-test
go: 1.9
script:
- make bin
- make validate
- make test-coverage
after_success:
after_success:
# submit coverage.txt to codecov.io
- bash <(curl -s https://codecov.io/bash)
before_deploy:
- make cross
- stage: deploy
go_import_path: github.com/redhat-developer/ocdev
go: 1.9
install:
- make goget-tools
script: skip
before_deploy:
- make prepare-release
- ./scripts/generate-bintray-json.sh
deploy:
provider: bintray
deploy:
- provider: bintray
repo: ocdev/ocdev
file: ./.bintray.json
user:
@@ -35,5 +46,14 @@ deploy:
skip_cleanup: true
on:
on: master
go: 1.9
- provider: releases
api_key:
secure: GGP7Kk+ZjhwwOTOgY4/TufeZ82Xh6SQDJkUlig6qzOCd01Rh80waWz5X0MzNgf2UotjeiVpgFbhZ3DOeUDwkRxa+/MmmiX+gxgeS+tb5YnhnFzH0Q/13DYFF+RQQrr8jmFs7d4dm56L3U3gW4qFwyHgn9Fy5Aqsd4R4RmObV4sVtxh1Z4g4px1hJNiaKFd7T9ChFPS/fuSz75ThrSQjG4rJFWW5Sb6BPmEOkwMCGAc+b24oEZngq8HMDknuKLU1UTSOef9T9yo65M4uVVMI1RkmbmazObkd6216L7XlIvZrLhINIy3Jl7RCtT2JLgKEmHQ9582WIenRIm4PerlMn6sDHmfb+oYW2JMXhgYEOBzXk0K/RmiRGc8tCpSfEpB5qe6z28+l8SvirX9plBqZytG0EwXUVEt7qwSOlLtfrT/4tJCVpmmXDoJR/TtDrHe2HqsBTBQJpYDrOemqmEAcDDMFVG+yZq4iO+Z1jTdEqUMXUE+0UYl22//Y3+xGzvS+JEIzwU/VI2Sg+zDlTvkogQBl7IQqNl/ttXgLcRl0V/E2PpJR/gJUlEyYImKI3Gh4pV5cY7IRuT17fytp249KyK/q3mkE85/yKWPZc/fGVgqbqL7pdHTuVg/woDv46kK1VFC2lDB9Ll5yWrMGI6U/kxO8bzPa88PE0Z4i4yMoRRLo=
draft: true
prerelease: true
file_glob: true
file: "./dist/release/*"
skip_cleanup: true
on:
tags: true
repo: redhat-developer/ocdev

14
scripts/prepare-release.sh Executable file
View File

@@ -0,0 +1,14 @@
#!/bin/bash
BIN_DIR="./dist/bin/"
RELEASE_DIR="./dist/release/"
mkdir -p $RELEASE_DIR
for arch in `ls -1 $BIN_DIR/`;do
suffix=""
if [[ $arch == windows-* ]]; then
suffix=".exe"
fi
gzip --keep --to-stdout $BIN_DIR/$arch/ocdev$suffix > $RELEASE_DIR/ocdev-$arch$suffix.gz
done