-
-
Notifications
You must be signed in to change notification settings - Fork 131
/
Copy path.travis.yml
106 lines (95 loc) · 3.63 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
matrix:
include:
- os: linux
TARGETOS: linux
dist: trusty
sudo: required
language: python
python: 3.6.2
env:
- TARGETOS=linux
- os: osx
TARGETOS: osx
sudo: required
env:
- TARGETOS=osx
- os: linux
language: python
python: 3.6.2
env:
- DOCKER=true TARGETOS=windows
services:
- docker
addons:
chrome: stable
before_script:
- if [[ "$TARGETOS" != "osx" ]]; then export DISPLAY=:99.0 ; fi
- if [[ "$TARGETOS" != "osx" ]]; then sh -e /etc/init.d/xvfb start ; fi
- if [[ "$TARGETOS" != "osx" ]]; then sleep 3 ; fi
before_install:
- if [[ "$TARGETOS" == "osx" ]]; then brew upgrade python ; fi
- if [[ "$TARGETOS" != "windows" ]]; then python3 -V; fi
- if [[ "$TARGETOS" != "windows" ]]; then pip3 -V; fi
# command to install dependencies
install:
- cd src
# command to run tests
script:
# Test script on non-windows instances
- sudo chmod +x jadx/bin/jadx
- if [[ "$TARGETOS" != "windows" ]]; then
pip3 install -r requirements.txt;
python3 stacoan.py -p test-apk.apk --disable-browser;
fi
# BUILDING ---------------
# Fix the helpers issue
# sed is different on os x...
- if [[ "$TARGETOS" == "osx" ]]; then
sed -i '' 's/from helpers./from /g' helpers/*.py || :;
sed -i '' 's/from helpers./from /g' stacoan.py;
sed -i '' 's/os.path.join(parentdir, "config.ini")/"config.ini"/g' helpers/logger.py ;
else sed -i 's/from helpers./from /g' helpers/*.py || :;
sed -i 's/from helpers./from /g' stacoan.py;
sed -i 's/os.path.join(parentdir, "config.ini")/"config.ini"/g' helpers/logger.py ;
fi
- cp helpers/* ./ || :;
# WINDOWS BUILD
- if [[ "$TARGETOS" == "windows" ]]; then
docker pull cdrx/pyinstaller-windows;
docker run -v "$(pwd):/src/" cdrx/pyinstaller-windows;
fi
# LINUX AND MAC OS X
- if [[ "$TARGETOS" != "windows" ]]; then pip3 install pyinstaller; fi
- if [[ "$TARGETOS" != "windows" ]]; then python3 -m PyInstaller stacoan.py --onefile --icon icon.ico --name stacoan --clean --noupx; fi
# Making directories for the build and add resources
- mkdir deploy;
- mkdir deploy/report;
- cp report/start.html ./deploy/report;
- cp -R report/html ./deploy/report;
- cp -R jadx ./deploy/;
- cp -R config ./deploy/;
- cp ../README.md ./deploy/README.md;
- cp config.ini ./deploy/config.ini;
# Create zip for the release
- if [[ "$TARGETOS" == "windows" ]];
then cp dist/windows/* ./deploy/;
else cp dist/* ./deploy/;
fi
- name_zip=$TARGETOS".zip"
- zip -r $(echo $name_zip) deploy
# [end of building] -----
# Testing the build on Linux and mac
# - cd deploy;
# - if [[ "$TRAVIS_OS_NAME" != "windows" ]];
# then ./stacoan -p test-apk.apk --disable-browser;
# fi
deploy:
provider: releases
skip_cleanup: true
prerelease: true
on:
all_branches: true
tags: true
api_key:
secure: LHo4mTW5GAq2YqArglFcB4T4Gmq8Z3aZIZiAGtvtdUhHhtKBJR1LDRITDsedeNXHf/wye9IxBwbiA6E1GDeZzsk20i6+5UMxsMasMYlq4OFVrbJrdm6adrjagSgZp7JePbk2EXzFFYDL4lvXT3lhSXW7exKBhzQRcr3y4Tuc2DczJ7G5y+ZQnrUYOLX3ln5Pq2DViUcPmH+ycFAq89X5zrXKyIoZTNAA3ffqVac0gMX24sLodTU/bMnp22fde6v7W//yx4nkoaaVqRk3doE8wxm1oaBaAT+Oy9N4P5AZ/5HA3mb96o0+Rfo3FIZGJ9kvv1Mk1eVb8ii1Kd0hA6EzU+ay9w84p77oSPUCAWUcJgNYgcsurRnW9f4GjRWt2KQ8NWP9sHOTsabtkLVhJ6/RBdSM5cvZkxMUgP8ebOtIyaWouO3qBYcZ43Jio44IhF/a6pRIlhLsRuozaBvOWfN/207d2I2p+EMcwpK9I14A1wbc+7Naph6a7gACohmt9+6r8GTMzLPwhev1T7JJn3DbPLsQBX4yWaMMbdITDgbZUxTluwYviCehrb7WhtfMiNWeSluCvn2p9rwyxxUq2fgxd3gteeEVYdTjLa3rTunRS8F8X/YDhgRmd9TEoB0OAkW+vqOAFaPED6tvhVlLHxIotHQ4rQt2LtBD/TaGnbnJiJ4=
file: $(echo $name_zip)