forked from mmcc007/screenshots
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
106 lines (94 loc) · 5.43 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
language: generic
os: osx
#osx_image: xcode10.2 # macOS 10.14, JDK 12+33
#osx_image: xcode10.1 # macOS 10.13, JDK 11.0.1+13
# the following osx_image fixes the JDK module problem, has iPhone XS Max
# but doesn't have iPad Pro (12.9-inch) (3rd generation). So for now we exclude the
# iPad Pro (12.9-inch) (3rd generation) in screenshots.yaml
osx_image: xcode10 # macOS 10.13, JDK 10.0.2+13
jobs:
include:
- stage: Run screenshots
# env: Create screenshots
before_install:
# - xcrun simctl list devices
# create repository for artifacts
- mkdir $HOME/screenshots
# Install android tools
- ANDROID_TOOLS=4333796 # android-28
- export ANDROID_HOME=~/android-sdk
- wget -q "https://dl.google.com/android/repository/sdk-tools-darwin-$ANDROID_TOOLS.zip" -O android-sdk-tools.zip
- unzip -q android-sdk-tools.zip -d ${ANDROID_HOME}
- rm android-sdk-tools.zip
# - PATH=${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/tools/bin:${ANDROID_HOME}/platform-tools
- PATH=${PATH}:${ANDROID_HOME}/emulator:${ANDROID_HOME}/tools/bin:${ANDROID_HOME}/platform-tools
# Silence warning.
- mkdir -p ~/.android
- touch ~/.android/repositories.cfg
# Add missing java module used by sdkmanager, etc...
# - export SDKMANAGER_OPTS="--add-modules java.se.ee"
- export JAVA_OPTS='-XX:+IgnoreUnrecognizedVMOptions --add-modules java.se.ee'
# Accept licenses before installing components, no need to echo y for each component
- yes | sdkmanager --licenses
# Platform tools
- sdkmanager "emulator" "tools" "platform-tools" > /dev/null
- sdkmanager --list | head -15
# install older build tools (for emulator)
- sdkmanager "build-tools;25.0.2" "platforms;android-25" > /dev/null
# Download a pinned version of the emulator since upgrades can cause issues
- ${ANDROID_HOME}/emulator/emulator -version
- emulator_version=5264690 # 29.0.9.0 (build_id 5537588) ==> 28.0.23.0 (build_id 5264690)
- curl -fo emulator.zip "https://dl.google.com/android/repository/emulator-darwin-$emulator_version.zip"
- rm -rf "${ANDROID_HOME}/emulator"
- unzip -q emulator.zip -d "${ANDROID_HOME}"
- rm -f emulator.zip
- ${ANDROID_HOME}/emulator/emulator -version
# Create emulator
- EMULATOR_API_LEVEL=22
- ABI="default;armeabi-v7a"
- EMULATOR_NAME='Nexus_6P_API_28'
- sdkmanager "system-images;android-$EMULATOR_API_LEVEL;$ABI" > /dev/null
- sdkmanager --list | head -15
- echo no | avdmanager create avd -n $EMULATOR_NAME -k "system-images;android-$EMULATOR_API_LEVEL;$ABI"
# - cat ~/.android/avd/$EMULATOR_NAME.ini
# - cat ~/.android/avd/$EMULATOR_NAME.avd/config.ini
- echo "hw.lcd.width=1440" >> ~/.android/avd/$EMULATOR_NAME.avd/config.ini
- echo "hw.lcd.height=2560" >> ~/.android/avd/$EMULATOR_NAME.avd/config.ini
- echo "hw.device.name=Nexus 6P" >> ~/.android/avd/$EMULATOR_NAME.avd/config.ini
- echo "hw.device.manufacturer=Google" >> ~/.android/avd/$EMULATOR_NAME.avd/config.ini
- echo "avd.ini.displayname=Nexus 6P API 28" >> ~/.android/avd/$EMULATOR_NAME.avd/config.ini
# fix timezone warning on osx
- sudo ln -sf /usr/share/zoneinfo/US/Pacific /etc/localtime
# setup osx environment for flutter and simulators
- export HOMEBREW_NO_AUTO_UPDATE=1
- brew install libimobiledevice
- brew install ideviceinstaller
- brew install ios-deploy
- brew install cocoapods || echo 'ignore exit(1)'
- brew link --overwrite cocoapods
# install pre-compiled flutter
- sdkmanager "platforms;android-28" "build-tools;28.0.3" > /dev/null # required by flutter
- FLUTTER_CHANNEL=stable
- FLUTTER_VERSION=1.5.4-hotfix.2-${FLUTTER_CHANNEL}
- wget --quiet --output-document=flutter.zip https://storage.googleapis.com/flutter_infra/releases/${FLUTTER_CHANNEL}/macos/flutter_macos_v${FLUTTER_VERSION}.zip && unzip -qq flutter.zip > /dev/null && rm flutter.zip
- export PATH="$PATH":"$HOME/.pub-cache/bin"
- export PATH=$PWD/flutter/bin:$PWD/flutter/bin/cache/dart-sdk/bin:$PATH
- flutter doctor -v
# install ImageMagick
- brew install imagemagick
# install most current (released or unreleased) Screenshots
- pub global activate --source path .
script:
- cd example; screenshots -c screenshots_CI.yaml
# copy artifacts to cache for later deploy
- zip -r $HOME/screenshots/screenshots.zip ios/fastlane/screenshots android/fastlane/metadata/android/*/images
# deploy artifacts if tagged commit
deploy:
provider: releases
skip_cleanup: true
api_key:
secure: wyPNNbjTFChWOGc/JiTpGhN490dRzz/qhU2T3CddZALjy4VN3LywennK3xnTOAq+FEYE9H/quP/SxkUX154al/lxeL6QuN5D0Ev2bL3lS9jyaoe0NOKx5GnNTzfv84taZPi768UF4rgYqzzdF8WJTCe0dlvDH7qKgH+dHIZGoB1dM/hhWMEXUv0uAZuFDkepxWHOLHsIABunkz428MEsSRCTdEWOsgdFiEl+DOC5ErmorgHazUWPpSwenz13kCLhU+wT2Fsek5tGBO6GT1Mvw8qrht3LUZBaBQJfx4yhdXQKtq0Dr+gI9a3sbF/3TKV0nRvDVA+KGmMLHT+fkRrz1xkGvrLnCDfkylDZlmn/IoQUkv4JwI+lJIXfUp40pMmSlFH1WKToWSjMsPSxv02fVYzxNZoxlno+qyKk4lfdROOSSYS5LjmMd+Lrvhmx7vNMCHl57fdXdKwgyJllxT/khMZTJv5IPQih1yi3m/hDw0s59IHYd22QHFoodcdAPy2xxeVh8VhzhucpesWAvoFZfgdTmPZXAzpMR4kEaeBb5f3Z/Eg3AypDPXg67kXwFqTRL+ZqDzOFynZYJML8RbsZd/nqU5TYc0Ocmh0YMA3v0Z43wuZMshXOXujl8z3zmnwzV/QmFP0U/phOGa9SmvKtRyGQoTGtIXoPWdXrRpgm3F4=
file:
- $HOME/screenshots/screenshots.zip
on:
tags: true