forked from tobozo/M5Stack-SD-Updater
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
116 lines (104 loc) · 3.97 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
language: generic
env:
global:
- IDE_VERSION=1.8.9
- REPO_NAME=M5Stack-SD-Updater
- SDAPP_FOLDER=$PWD/examples/M5Stack-SD-Menu/SD-Apps
- TRAVIS_TAG="v0.4.1"
- M5_SD_BUILD_DIR=$TRAVIS_BUILD_DIR/build/SD-Content
matrix:
- EXAMPLE="M5Stack-SD-Menu" BOARD="espressif:esp32:m5stack-core-esp32:FlashFreq=80"
# - EXAMPLE="M5Stack-SDLoader-Snippet" BOARD="espressif:esp32:m5stack-core-esp32:FlashFreq=80"
before_install:
- /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_1.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :1 -ac -screen 0 1280x1024x16
- sleep 3
- export DISPLAY=:1.0
- export JAVA_ARGS="-Djavax.jmdns.level=OFF"
- wget http://downloads.arduino.cc/arduino-$IDE_VERSION-linux64.tar.xz
- tar xf arduino-$IDE_VERSION-linux64.tar.xz
- mv arduino-$IDE_VERSION ~/arduino-ide
- rm arduino-$IDE_VERSION-linux64.tar.xz
- export PATH=$PATH:~/arduino-ide
- mkdir -p $M5_SD_BUILD_DIR
- if [[ "$BOARD" =~ "espressif:esp32:" ]]; then
mkdir -p ~/Arduino/hardware/espressif &&
cd ~/Arduino/hardware/espressif &&
git clone https://github.com/espressif/arduino-esp32.git esp32 &&
cd esp32/ &&
git submodule update --init --recursive &&
cd tools/ &&
python get.py &&
cd $TRAVIS_BUILD_DIR;
fi
install:
- gem install git.io
- git submodule update --init --recursive
- cd $SDAPP_FOLDER
- git submodule foreach --recursive git pull origin master
- cd $TRAVIS_BUILD_DIR;
- mkdir -p ~/Arduino/libraries
- ln -s $PWD ~/Arduino/libraries/.
- echo "Installing extra libraries"
- cd $SDAPP_FOLDER
- ./get-deps.sh
script:
- cd $TRAVIS_BUILD_DIR;
- arduino --pref "compiler.warning_level=none" --save-prefs
- arduino --pref "build.warn_data_percentage=75" --save-prefs
- arduino --preserve-temp-files --verbose-build --verify --board $BOARD $PWD/examples/$EXAMPLE/$EXAMPLE.ino &>/dev/null
- find /tmp -name \*.partitions.bin -exec rm {} \; #
- find /tmp -name \*.bin -exec mv {} $M5_SD_BUILD_DIR/TobozoLauncher.bin \; #
- cp $M5_SD_BUILD_DIR/TobozoLauncher.bin $M5_SD_BUILD_DIR/menu.bin
- echo "Fake Binary" >> $M5_SD_BUILD_DIR/Downloader.bin
- echo "Main APPs Compilation successful, now compiling deps"
- cd $SDAPP_FOLDER
- ./gen-apps.sh
- echo "Fetching precompiled projects"
- ./get-precompiled.sh
- ls $M5_SD_BUILD_DIR/ -la
- sleep 15 # give some time to the logs to come up
before_deploy:
# Set up git user name and tag this commit
- cd $PWD
#if ! [[ $TRAVIS_TAG ]]; then
# git config --global user.email "[email protected]"
# git config --global user.name "Travis CI"
# git tag ${TRAVIS_TAG}
#fi
- cd /home/travis/build/tobozo/
- echo "#define M5_SD_UPDATER_VERSION F(\"${TRAVIS_TAG}\")" > $REPO_NAME/src/gitTagVersion.h
- rm -Rf $REPO_NAME/examples/M5Stack-SD-Menu/SD-Apps
- rm -Rf $REPO_NAME/examples/M5Stack-SD-Menu/SD-Content
- zip -r $TRAVIS_BUILD_DIR/$REPO_NAME.zip $REPO_NAME -x *.git*
- cd $M5_SD_BUILD_DIR
- zip -r $TRAVIS_BUILD_DIR/SD-Apps-Folder.zip ./
- cd $TRAVIS_BUILD_DIR
# - export BODY=$(cat CHANGELOG.md) # boo! Travis doesn't like multiline body
deploy:
provider: releases
api_key: $GH_TOKEN
overwrite: true
skip_cleanup: true
target_commitish: $TRAVIS_COMMIT
tag_name: $TRAVIS_TAG
name: SD-Extras-autorelease $TRAVIS_TAG
body: Automated release from Travis CI with added SD Apps binary files from Arduino compilation
draft: true
file_glob: true
file:
- $TRAVIS_BUILD_DIR/SD-Apps-Folder.zip
# - $TRAVIS_BUILD_DIR/$REPO_NAME.zip
#file: $TRAVIS_BUILD_DIR/SD-Apps-Folder.zip
on:
tags: true
branch: master
notifications:
email:
on_success: never
on_failure: always
webhooks:
urls:
- https://webhooks.gitter.im/e/2d1ffb10865e412333a9
on_success: change # options: [always|never|change] default: always
on_failure: always # options: [always|never|change] default: always
on_start: never # options: [always|never|change] default: always