From 4b4cb99b30f8157c2286e47a9389dd49ce6dc59e Mon Sep 17 00:00:00 2001 From: Andrey Meshkov Date: Fri, 25 Jan 2019 22:12:48 +0300 Subject: [PATCH 1/2] Closes #557: Travis deploy --- .gitignore | 4 +++- .travis.yml | 46 ++++++++++++++++++++++++++++++++++++++-------- release.sh | 23 +++++++++++++---------- 3 files changed, 54 insertions(+), 19 deletions(-) diff --git a/.gitignore b/.gitignore index f8e86c54..b4047c5b 100644 --- a/.gitignore +++ b/.gitignore @@ -2,9 +2,11 @@ /.vscode /.idea /AdGuardHome +/AdGuardHome.exe /AdGuardHome.yaml /data/ /build/ +/dist/ /client/node_modules/ /querylog.json /querylog.json.1 @@ -13,4 +15,4 @@ # Test output dnsfilter/tests/top-1m.csv -dnsfilter/tests/dnsfilter.TestLotsOfRules*.pprof +dnsfilter/tests/dnsfilter.TestLotsOfRules*.pprof \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index a4993ffe..ca7ef396 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,15 +1,9 @@ language: go sudo: false + go: - 1.11.x - 1.x - -cache: - directories: - - $HOME/.cache/go-build - - $HOME/gopath/pkg/mod - - $HOME/Library/Caches/go-build - os: - linux - osx @@ -21,6 +15,12 @@ before_install: install: - npm --prefix client install +cache: + directories: + - $HOME/.cache/go-build + - $HOME/gopath/pkg/mod + - $HOME/Library/Caches/go-build + script: - node -v - npm -v @@ -31,4 +31,34 @@ script: - make after_success: - - bash <(curl -s https://codecov.io/bash) \ No newline at end of file + - bash <(curl -s https://codecov.io/bash) + +matrix: + include: + # Release build configuration + - name: release + go: + - 1.11.x + os: + - linux + + script: + - node -v + - npm -v + # Run tests just in case + - go test -race -v -bench=. ./... + # Prepare releases + - ./release.sh + - ls -l dist + + deploy: + provider: releases + api_key: $GITHUB_TOKEN + file: + - dist/AdGuardHome_* + on: + repo: AdguardTeam/AdGuardHome + tags: true + draft: true + file_glob: true + skip_cleanup: true \ No newline at end of file diff --git a/release.sh b/release.sh index 80df5c8c..94cda10b 100755 --- a/release.sh +++ b/release.sh @@ -9,23 +9,26 @@ version=`git describe --abbrev=4 --dirty --always --tags` f() { make cleanfast; CGO_DISABLED=1 make if [[ $GOOS == darwin ]]; then - rm -f ../AdGuardHome_"$version"_MacOS.zip - zip ../AdGuardHome_"$version"_MacOS.zip AdGuardHome README.md LICENSE.TXT + zip dist/AdGuardHome_"$version"_MacOS.zip AdGuardHome README.md LICENSE.txt elif [[ $GOOS == windows ]]; then - rm -f ../AdGuardHome_"$version"_Windows.zip - zip ../AdGuardHome_"$version"_Windows.zip AdGuardHome.exe README.md LICENSE.TXT + zip dist/AdGuardHome_"$version"_Windows.zip AdGuardHome.exe README.md LICENSE.txt else - pushd .. - tar zcvf AdGuardHome_"$version"_"$GOOS"_"$GOARCH".tar.gz AdGuardHome/{AdGuardHome,LICENSE.TXT,README.md} - popd + tar zcvf dist/AdGuardHome_"$version"_"$GOOS"_"$GOARCH".tar.gz AdGuardHome README.md LICENSE.txt fi } -#make clean -#make +# Clean and rebuild both static and binary +make clean +make + +# Prepare the dist folder +rm -rf dist +mkdir -p dist + +# Prepare releases GOOS=darwin GOARCH=amd64 f GOOS=linux GOARCH=amd64 f GOOS=linux GOARCH=386 f GOOS=linux GOARCH=arm GOARM=6 f GOOS=linux GOARCH=arm64 GOARM=6 f -GOOS=windows GOARCH=amd64 f +GOOS=windows GOARCH=amd64 f \ No newline at end of file From 911250cfbec46c79181bf09fd2f0f397cc7eca35 Mon Sep 17 00:00:00 2001 From: Andrey Meshkov Date: Fri, 25 Jan 2019 22:23:09 +0300 Subject: [PATCH 2/2] MORE BADGES FOR THE GOD OF BADGES! --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 64fa5bc0..6280333a 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,9 @@ Go Report Card + + GolangCI + Latest release