diff --git a/.gitignore b/.gitignore index 60d2ebd..3d599e5 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,5 @@ SatHelperApp cmd/xritparse/xritparse cmd/demuxReplay/replay release* +bins +zips diff --git a/.travis.yml b/.travis.yml index 4c30728..e9cb87d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,11 +1,14 @@ dist: xenial +env: + global: + - COMMIT=${TRAVIS_COMMIT::8} before_install: - sudo add-apt-repository ppa:opensatelliteproject/ppa -y - sudo add-apt-repository ppa:opensatelliteproject/drivers -y - sudo add-apt-repository ppa:myriadrf/gnuradio -y - sudo apt-get -qq update - - sudo apt-get install -y limesuite libaec-dev libaec0 liblimesuite-dev libcorrect libsathelper libsoapysdr0.6 libairspy0 libsoapysdr-dev libairspy-dev libusb-1.0-0-dev + - sudo apt-get install -y limesuite libaec-dev libaec0 liblimesuite-dev libcorrect libsathelper libsoapysdr0.6 libairspy0 libsoapysdr-dev libairspy-dev git g++ cmake libsqlite3-dev libi2c-dev libusb-1.0-0-dev language: go @@ -17,11 +20,26 @@ git: script: - cd /home/travis/gopath - - mv /home/travis/gopath/src/github.com/opensatelliteproject /home/travis/gopath/src/github.com/OpenSatelliteProject # Fix Naming + - mv /home/travis/gopath/src/github.com/opensatelliteproject /home/travis/gopath/src/github.com/OpenSatelliteProject - cd /home/travis/gopath/src/github.com/OpenSatelliteProject/SatHelperApp - go get - for i in /home/travis/gopath/src/github.com/OpenSatelliteProject/SatHelperApp/cmd/*; do echo "Go Getting $i"; cd $i; go get; cd ../..; done - cd /home/travis/gopath/src/github.com/OpenSatelliteProject/SatHelperApp - curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | bash -s -- -b $GOPATH/bin v1.10.2 - - golangci-lint run # run a bunch of code checkers/linters in parallel - - go test -v -race $(go list ./... | grep -v /parts/ | grep -v /prime/ | grep -v /snap/ | grep -v /stage/ | grep -v /tmp/ ) # Run all the tests with the race detector enabled \ No newline at end of file + - golangci-lint run + - go test -v -race $(go list ./... | grep -v /parts/ | grep -v /prime/ | grep -v /snap/ | grep -v /stage/ | grep -v /tmp/ ) + - cd /home/travis/gopath/src/github.com/OpenSatelliteProject/SatHelperApp + - ./travis-build.sh + - ln -s /home/travis/gopath/src/github.com/OpenSatelliteProject /home/travis/gopath/src/github.com/opensatelliteproject + +deploy: + provider: releases + api_key: + secure: cID0Ex92EsQRN6Xsh1ngF9jZVqiVdYCNC2JhnEbnTtipb5Z00m8wasdo3R22aafGUkaWpcg0zbRRSC/VCMqrLj6PRoKJ0KBtOQA4BiJ3xc4YkWg2nmwOs19KSn61vO6VIrIDfQfBSlavfTsUdLKc0tE2QGxkw2j49Y8+0vswynXvx9yQ+renigtS8yhK6FT6VpIQ1+Yqx0DSN7XnFyAlqA1fymx32GzXIFhs1llOUiUPmnyOryJFfJxus8GGf1f8QX+elgBEN08nYkvc2yGlhh/+LhY7SBcdKgR3acHvhooaxmuPXfC92OVlrizV27wLsTX913jT7ELm5kGqEP7FuBpE4kvxoZhcZI71vt5P3CR60ELz9vTfN+U2YTnaZ43Nlgjwzq9SfQPxXBF2FLGEEBd4zkuEKGvATYLrI1WdPo1Zns85viFWo3X65eZ/WW2tK+m5wVYQmMWw8RYc/ANrVdovzX6Ss+Z2hTh9qvGNjy1Ph+qvaVU9cdeO8JM9r9+Xsm4UTGZ7nUEnYN5DbeZ7aDGk4p8E67B19Xvroyzt/JEIrfH3C+y+eX1YZOS74xi9REeFzje90SODBh18onsI6sfssw+AHE7H24hMfHadjUWqMzx/5vgCi/pyP13inuwasCrqS13XJEvlY3elwhdFVbb8OkwVW99Ukkzn+rq5tVE= + file_glob: true + file: zips/* + skip_cleanup: true + on: + tags: true + repo: opensatelliteproject/SatHelperApp + diff --git a/travis-build.sh b/travis-build.sh new file mode 100755 index 0000000..4bd8de8 --- /dev/null +++ b/travis-build.sh @@ -0,0 +1,50 @@ +#!/bin/bash + +TAG=`git describe --exact-match --tags HEAD` + +if [ $? -eq 0 ]; +then + echo "Releasing for tag ${TAG}" + ORIGINAL_FOLDER="`pwd`" + echo "I'm in `pwd`" + mkdir -p bins + mkdir -p zips + + echo "Building Static LimeSuite" + git clone https://github.com/myriadrf/LimeSuite.git + cd LimeSuite + git checkout stable + mkdir builddir && cd builddir + cmake ../ -DBUILD_SHARED_LIBS=OFF + make -j10 + sudo make install + sudo ldconfig + cd .. + + echo "Going back to $ORIGINAL_FOLDER" + cd "$ORIGINAL_FOLDER" + + echo "Updating Code to have static libLimeSuite" + sed -i 's/-lLimeSuite/-l:libLimeSuite.a -l:libstdc++.a -lm -lusb-1.0/g' Frontend/LimeDevice/LimeDevice.go + + echo "Building" + cd cmd + for i in * + do + echo "Building $i" + cd $i + echo go build -o ../../bins/$i + go build -o ../../bins/$i + echo "Zipping ${i}-${TAG}-linux-amd64.zip" + zip -r "../../zips/${i}-${TAG}-linux-amd64.zip" ../../bins/$i + cd .. + done + cd .. + echo "Binaries: " + ls -la bins + echo "Zip Files: " + ls -la zips +else + echo "No tags for current commit. Skipping releases." +fi +