From 802f7d580a23a51d8bbbb845c9ffb3a76a1eb9a0 Mon Sep 17 00:00:00 2001 From: Lucas Teske Date: Sun, 19 Aug 2018 03:05:46 -0300 Subject: [PATCH] Added multi-arch build --- .gitignore | 2 ++ .travis.yml | 41 +++++++++++++++++++++++++++++++++-------- travis-build.sh | 26 ++++++++++++++++++++++++++ 3 files changed, 61 insertions(+), 8 deletions(-) create mode 100755 travis-build.sh diff --git a/.gitignore b/.gitignore index 459ee98..bde9deb 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,5 @@ segdsp.prof *.float32 *.cfile *.bytes +out +bins diff --git a/.travis.yml b/.travis.yml index 4769d73..48f20bb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,12 +9,37 @@ sudo: required services: - docker -before_install: - - docker build -t racerxdl/segdsp . -script: - - docker images racerxdl/segdsp -after_success: - - echo $COMMIT - - docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD" - - docker push racerxdl/segdsp +jobs: + include: + # - stage: dockerBuilds + # before_install: + # - docker build -t racerxdl/segdsp . + # script: + # - docker images racerxdl/segdsp + # after_success: + # - echo $COMMIT + # - docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD" + # - docker push racerxdl/segdsp + - stage: tagBuilds + language: go + go: + "1.10.x" + script: + - git describe --exact-match --tags HEAD 2>> /dev/null && export TRAVIS_TAG="`git describe --exact-match --tags HEAD`"; echo "" + - ./travis-build.sh + deploy: + skip_cleanup: true + provider: releases + api_key: + secure: "cdifHn6ogMEdX7f0BLvowq5Jqr6fYQDFnNxTiBmL3KKZ9UvVpGtaNTaBFt++xE+P7RtVL7Ipxbg0TX15KdaC4eftSS4JnrCnFg8FjGO37114qL0xmA4rnhkdMBz/TtxXKGAks0KOeYP3VraNhqjjBb+9wnFDES56OIJwHPmtX+zP9rizXwGSvLvAtvcvG2+x5zvWtOJmm7t70iRgh4120ePdPHWU5DZak8WbVWlA0qpYgMTQS7o6vqO3nNLB/UqMmGChYXR2aVE5CovDttRnCDLsDPGVuwZURSuv10bWgTUZkSJkJX8gf10Pikh8N7XqYgC0hMjTjQR14AhlfjuPofrO2kbvQygHSkXsLqx8mVeUrkUjSm+g4DPCv9ClZRZh4J8nq4Gut50Ry6OJN7CR0pdcY+phEv+OtEBzeGoAqbQO6qJKMYDvTQwDWLHuDQ+w1LLg/ARUqctmDcU0Nk8YDUfEaiYsxtfKb04po9it8BhD5PTmmqOZefBb943OzRLnNDcm7yB7pexAtj5x0t21QrecM01R5nvmX+YtPQatAp4LepgZEXYXBM0stPr6YFNw7st6MZDeX23jq4HgdRKZrOB9li0oQ/FL9bMt4B71TlJGXdP6fuI6eYLBwAbtAQojKYClngjjBbgU3L19rqNUJMSrCsuirQOHl5eeiJJXWYs=" + file: + - bins/segdsp-linux-386.zip + - bins/segdsp-linux-amd64.zip + - bins/segdsp-linux-arm64.zip + - bins/segdsp-linux-arm.zip + - bins/segdsp-windows-386.zip + - bins/segdsp-windows-amd64.zip + on: + tags: true + repo: racerxdl/segdsp \ No newline at end of file diff --git a/travis-build.sh b/travis-build.sh new file mode 100755 index 0000000..9d56af7 --- /dev/null +++ b/travis-build.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +TAG=`git describe --exact-match --tags HEAD` + +if [ $? -eq 0 ]; +then + echo "Releasing for tag ${TAG}" + echo "Downloading deps" + go get -v + echo "Dowloading gox for multi-arch" + go get github.com/mitchellh/gox + mkdir out + mkdir bins + echo "Multi-arch build" + gox -output "out/{{.OS}}-{{.Arch}}/{{.Dir}}" -arch="arm arm64 386 amd64" -os="windows linux" + cd out + for i in * + do + echo "Zipping segdsp-${i}.zip" + zip ../bins/segdsp-$i.zip $i/* + done + cd .. + ls -la bins +else + echo "No tags for current commit. Skipping releases." +fi