forked from VirgilSecurity/virgil-keyknox-x
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
116 lines (101 loc) · 5.42 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: swift
osx_image: xcode10
env:
global:
- LC_CTYPE=en_US.UTF-8
- PROJECT=VirgilSDKKeyknox.xcodeproj
- IOS_FRAMEWORK_SCHEME="VirgilSDKKeyknox iOS"
- MACOS_FRAMEWORK_SCHEME="VirgilSDKKeyknox macOS"
- TVOS_FRAMEWORK_SCHEME="VirgilSDKKeyknox tvOS"
- WATCHOS_FRAMEWORK_SCHEME="VirgilSDKKeyknox watchOS"
- IOS_TEST_SCHEME="KeyknoxTestApp iOS"
- TVOS_TEST_SCHEME="KeyknoxTestApp tvOS"
- IOS_SDK=iphonesimulator12.0
- MACOS_SDK=macosx10.14
- TVOS_SDK=appletvsimulator12.0
- WATCHOS_SDK=watchsimulator5.0
- FRAMEWORK_NAME=VirgilSDKKeyknox
matrix:
- DESTINATION="OS=12.0,name=iPhone SE" ENABLE_BUILD="YES" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK" TWO_STEP_BUILD_ENABLED="YES" RUN_TESTS="YES" ADDITIONAL_TESTS_SCHEME="$IOS_TEST_SCHEME" PUBLISH_DOCS="NO" PUBLISH_CARTHAGE="NO" POD_LIB_LINT="NO" SWIFT_LINT="NO"
- DESTINATION="arch=x86_64" ENABLE_BUILD="YES" SCHEME="$MACOS_FRAMEWORK_SCHEME" SDK="$MACOS_SDK" TWO_STEP_BUILD_ENABLED="YES" RUN_TESTS="YES" ADDITIONAL_TESTS_SCHEME="" PUBLISH_DOCS="NO" PUBLISH_CARTHAGE="NO" POD_LIB_LINT="NO" SWIFT_LINT="NO"
- DESTINATION="OS=12.0,name=Apple TV 4K" ENABLE_BUILD="YES" SCHEME="$TVOS_FRAMEWORK_SCHEME" SDK="$TVOS_SDK" TWO_STEP_BUILD_ENABLED="YES" RUN_TESTS="YES" ADDITIONAL_TESTS_SCHEME="$TVOS_TEST_SCHEME" PUBLISH_DOCS="NO" PUBLISH_CARTHAGE="NO" POD_LIB_LINT="NO" SWIFT_LINT="NO"
- DESTINATION="OS=5.0,name=Apple Watch Series 4 - 44mm" ENABLE_BUILD="YES" SCHEME="$WATCHOS_FRAMEWORK_SCHEME" SDK="$WATCHOS_SDK" TWO_STEP_BUILD_ENABLED="NO" RUN_TESTS="NO" ADDITIONAL_TESTS_SCHEME="" PUBLISH_DOCS="NO" PUBLISH_CARTHAGE="NO" POD_LIB_LINT="NO" SWIFT_LINT="NO"
- DESTINATION="" ENABLE_BUILD="NO" SCHEME="" SDK="" TWO_STEP_BUILD_ENABLED="" RUN_TESTS="YES" ADDITIONAL_TESTS_SCHEME="" PUBLISH_DOCS="YES" PUBLISH_CARTHAGE="YES" POD_LIB_LINT="YES" SWIFT_LINT="YES"
before_install:
- set -e
- set -o pipefail
- brew update
- brew outdated carthage || brew upgrade carthage
- xcodebuild -version
- xcodebuild -showsdks
script:
- openssl aes-256-cbc -K $encrypted_25e20d2dd9dd_key -iv $encrypted_25e20d2dd9dd_iv -in config.tar.enc -out config.tar -d
- tar xvf config.tar
- |
if [ -n "$TRAVIS_TAG" ]; then
cp TestConfig_prod.plist Tests/Data/TestConfig.plist
else
cp TestConfig_stg.plist Tests/Data/TestConfig.plist
fi
- carthage version
- carthage bootstrap --no-build
- |
if [ $SWIFT_LINT == "YES" ]; then
brew outdated swiftlint || brew upgrade swiftlint
swiftlint
fi
- |
if [ $ENABLE_BUILD == "YES" ]; then
if [ $TWO_STEP_BUILD_ENABLED == "YES" ]; then
# Build Framework
xcodebuild -verbose -project "$PROJECT" -scheme "$SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Release clean build | xcpretty;
# Build Framework in Release and Run Tests if specified
if [ $RUN_TESTS == "YES" ]; then
if [ -n "$ADDITIONAL_TESTS_SCHEME" ]; then
xcodebuild -verbose -project "$PROJECT" -scheme "$ADDITIONAL_TESTS_SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Debug clean test;
else
xcodebuild -verbose -project "$PROJECT" -scheme "$SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Debug clean test;
fi
fi
else
# Build Framework
xcodebuild -verbose -project "$PROJECT" -scheme "$SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Release clean build | xcpretty;
fi
fi
# Build with carthage
- if [ $PUBLISH_CARTHAGE == "YES" ]; then
carthage build --no-skip-current --no-use-binaries;
fi
# Check pod lib
- if [ $POD_LIB_LINT == "YES" ]; then
gem install cocoapods --pre;
pod repo update;
pod lib lint;
fi
before_deploy:
- carthage archive
after_success:
# Generate and publish docs
# - if [ -n "${TRAVIS_TAG}" ] && [ $PUBLISH_DOCS == "YES" ]; then
- if [ $PUBLISH_DOCS == "YES" ]; then
./CI/publish-docs.sh;
fi
deploy:
# Upload framework to gh-releases for carthage
- provider: releases
api_key:
secure: MtYW/tOeS1BfnOVRfC3GEixTdFdA5DFxbf+1rLtjj1BthS5EifiYEcYSRDAi7mt+XDidEPI8tdIlKLq+UfwUk4gopH7DzlpCzpzo0TPQH3n5p6sm4EyaKyqSrgAnEDudcgaWiwrOE+j0BxbgWwxQbke05XaieyI9U/EmyHfLIIKU89gug98/eHrJ3AWioXvks/tJRPdlIzAZNs7DbKmlOA5uGoPVQrDQZDkaTM+2LlJq6fLXNMDQxbTAsiI9JdpjAkO2P/zrE2TDM+Fs+u5lZ5W3hIA7XGDjwcb3yekHr8rVS2cEcPm9mV61luUjLYmVGnttGJEheJmt3EBRtEUDxzFdb7WPUR3B/PBTFiWbwj4SK80Lflh/OptMUUFEy7f3N9o/gYC3ELuwHJr/O62H1AXQemYXV/Zu9xOXuWJcpmO8AHgJ7Ig3tRVKXaUeTHaHnONiMY79l3BmAPpqMfXaCrLpWW82/+lxZJc6zRAigEKdEsiePPjrZWTtZjMl93nUZBO/nFPEbv9yniHiAPXljoHMsAXUiITXU4huybb9nk3lf7gOyl+AbT/5O7M2PfhdWND6rhDmnUVW87qUiAjUykNAYAJ/Crbjf5lcR/1qscQuP7aPw/HSQpRjGJ5AkPnQKcrT0LsIqbTE14dXbkzAUvfRCIw7Mt7jAN/ibpfL6Cs=
file: $FRAMEWORK_NAME.framework.zip
skip_cleanup: true
on:
repo: VirgilSecurity/keyknox-x
tags: true
condition: $PUBLISH_CARTHAGE = "YES"
# Upload docs to gh-pages
- provider: pages
skip_cleanup: true
github-token: $GITHUB_TOKEN
local_dir: "docs"
on:
tags: true
condition: $PUBLISH_DOCS = "YES"