Skip to content

Commit

Permalink
Update .travis.yml
Browse files Browse the repository at this point in the history
* Change build commands to make log a little easier to read
* Create a backup of the _config.h file before starting
* Add `before_deploy` and `deploy` sections to deploy compiled binaries when a release is tagged
  • Loading branch information
benlye authored May 8, 2019
1 parent 2b47958 commit 2b4ac41
Showing 1 changed file with 82 additions and 2 deletions.
84 changes: 82 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ before_install:
arduino --install-boards multi4in1:avr;
fi
#
- buildMulti() { arduino --verify --board $BOARD Multiprotocol/Multiprotocol.ino; }
- buildMulti() { BUILDCMD="arduino --verify --board $BOARD Multiprotocol/Multiprotocol.ino --pref build.path=./build/"; echo $BUILDCMD; $BUILDCMD; echo; }
- buildProtocol() { opt_disable $ALL_PROTOCOLS; opt_enable $1; buildMulti; }
- buildEachProtocol() { exitcode=0; for PROTOCOL in $ALL_PROTOCOLS ; do echo Building $PROTOCOL; buildProtocol $PROTOCOL; if [ $? -ne 0 ]; then exitcode=1; fi; echo; done; return $exitcode; }
- buildEachProtocol() { exitcode=0; for PROTOCOL in $ALL_PROTOCOLS ; do echo Building $PROTOCOL; buildProtocol $PROTOCOL; if [ $? -ne 0 ]; then exitcode=1; fi; done; return $exitcode; }
#
install: true
before_script:
Expand All @@ -52,6 +52,8 @@ before_script:
- cd ${TRAVIS_BUILD_DIR}
# Log the initial Multi config
- cat Multiprotocol/_Config.h
# Back up the configuration
- cp Multiprotocol/_Config.h ./_Config.h.bak
# Derive the Multi protocols from the Multi source
- A7105_PROTOCOLS=$(sed -n 's/[\/\/]*[[:blank:]]*#define[[:blank:]]*\([[:alnum:]_]*_A7105_INO\)\(.*\)/\1/p' Multiprotocol/_Config.h)
- CC2500_PROTOCOLS=$(sed -n 's/[\/\/]*[[:blank:]]*#define[[:blank:]]*\([[:alnum:]_]*_CC2500_INO\)\(.*\)/\1/p' Multiprotocol/_Config.h)
Expand Down Expand Up @@ -95,3 +97,81 @@ script:
#
# Build each protocol individually
- buildEachProtocol
before_deploy:
# Create somwhere to put the binaries
- mkdir ./binaries
# Restore the default configuration
- cp ./_Config.h.bak Multiprotocol/_Config.h
# Build the release files for OrangeRX
- if [[ "$BOARD" =~ "multi4in1:avr:multixmega32d4" ]]; then
opt_enable $ALL_PROTOCOLS;
opt_disable ORANGE_TX_BLUE;
buildMulti;
mv build/Multiprotocol.ino.hex ./binaries/Multi-OrangeRX_Green_INV-$TRAVIS_TAG.hex;
opt_enable ORANGE_TX_BLUE;
buildMulti;
mv build/Multiprotocol.ino.hex ./binaries/Multi-OrangeRX_Blue_INV-$TRAVIS_TAG.hex;
fi
# Build the release files for AVR without bootloader
- if [[ "$BOARD" =~ "multi4in1:avr:multiatmega328p:bootloader=none" ]]; then
opt_disable CHECK_FOR_BOOTLOADER;
opt_disable $ALL_PROTOCOLS;
opt_enable $A7105_PROTOCOLS;
buildMulti;
mv build/Multiprotocol.ino.hex ./binaries/Multi-AVR_USBASP_A7105_INV-$TRAVIS_TAG.hex;
opt_disable $ALL_PROTOCOLS;
opt_enable $CC2500_PROTOCOLS;
buildMulti;
mv build/Multiprotocol.ino.hex ./binaries/Multi-AVR_USBASP_CC2500_INV-$TRAVIS_TAG.hex;
opt_disable $ALL_PROTOCOLS;
opt_enable $CYRF6936_PROTOCOLS;
buildMulti;
mv build/Multiprotocol.ino.hex ./binaries/Multi-AVR_USBASP_CYRF6936_INV-$TRAVIS_TAG.hex;
fi
# Build the release files for AVR with bootloader
- if [[ "$BOARD" =~ "multi4in1:avr:multiatmega328p:bootloader=optiboot" ]]; then
opt_enable CHECK_FOR_BOOTLOADER;
opt_disable $ALL_PROTOCOLS;
opt_enable $A7105_PROTOCOLS;
buildMulti;
mv build/Multiprotocol.ino.hex ./binaries/Multi-AVR_TXFLASH_A7105_INV-$TRAVIS_TAG.hex;
opt_disable $ALL_PROTOCOLS;
opt_enable $CC2500_PROTOCOLS;
buildMulti;
mv build/Multiprotocol.ino.hex ./binaries/Multi-AVR_TXFLASH_CC2500_INV-$TRAVIS_TAG.hex;
opt_disable $ALL_PROTOCOLS;
opt_enable $CYRF6936_PROTOCOLS;
buildMulti;
mv build/Multiprotocol.ino.hex ./binaries/Multi-AVR_TXFLASH_CYRF6936_INV-$TRAVIS_TAG.hex;
fi
# Build the release files for STM32 without bootloader
- if [[ "$BOARD" =~ "multi4in1:STM32F1:multistm32f103c:upload_method=serialMethod" ]]; then
opt_disable CHECK_FOR_BOOTLOADER;
opt_enable $ALL_PROTOCOLS;
buildMulti;
mv build/Multiprotocol.ino.bin ./binaries/Multi-STM_FTDI_INV-$TRAVIS_TAG.hex;
opt_disable MULTI_STATUS;
opt_enable MULTI_TELEMETRY;
buildMulti;
mv build/Multiprotocol.ino.bin ./binaries/Multi-STM_FTDI_INV_OPENTX-$TRAVIS_TAG.hex;
fi
# Build the release files for STM32 with bootloader
- if [[ "$BOARD" =~ "multi4in1:STM32F1:multistm32f103c:upload_method=TxFlashMethod" ]]; then
opt_enable CHECK_FOR_BOOTLOADER;
opt_enable $ALL_PROTOCOLS;
buildMulti;
mv build/Multiprotocol.ino.bin ./binaries/Multi-STM_TXFLASH_INV-$TRAVIS_TAG.hex;
opt_disable MULTI_STATUS;
opt_enable MULTI_TELEMETRY;
buildMulti;
mv build/Multiprotocol.ino.bin ./binaries/Multi-STM_TXFLASH_INV_OPENTX-$TRAVIS_TAG.hex;
fi
deploy:
provider: releases
api_key:
secure: bk6IaUVPxvPwD7jk3IpfWazDCiaQBGNPSF+M61rpi79CZSDzSuLQh9DPLoVqM4HM7JMZMo6r5zNB24VN3p6a8CjI0ui01lkz92EuttAZ2bSPlwo9vasGI8UamJ7AHhI9ZYx22PdER/YA29mEV4JqxaZrh4FUcl8G5VNt0Q1ChP8nGKOU/ffSUm1NydXmK9P3OmPCy/yMHZOrBwbQ6g4vfHTZ1Phc00K2xcWqDTTznVIzdlYvdymM846lwCHJXcNmfgC9vIREWdozlUWiTaGGk/8bfU/dU0F8e0pCGwit+iRKbLLBeo4qKaVFOnHmUjUQ2DCehCEuwJ3TK5K1DfFqIjxOreyIgEFxbkMBjhFdQ3Hh0m8MpaVMwVsUQRz5xwcPE0/OqOuvzNeWtE6nBjh7lZN52ZENSfIOVmsBoBRR8snIh8uwjKOytHXz48mK5qzPAtE4IviE0dNvVk6ESA6n2TlpI8Yac11oneWruJbEOvhV/fDL3HTX71Y3fDdGvVJczQo5eUeZ9DqvwRbSrNOPU79oPa8zOcYVSzpjigOoVLOb9GhsGNSRUvVl/Ais97ZG4eLo5KSySzZ6yZ/8qIQwx4aNFNl2PruIWpzCsct94XX7QdCLN3h9Fy/ZPBlyyNd4h+6Wm6JmpIv7E3ZAE2w63OSLSgyMq2hmwUJ2ZdBeTdg=
skip_cleanup: true
file_glob: true
file: binaries/*
on:
tags: true

0 comments on commit 2b4ac41

Please sign in to comment.