-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
98 lines (83 loc) · 3.68 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
language: objective-c
osx_image: xcode10.2
env:
global:
- LC_CTYPE=en_US.UTF-8
- PROJECT=VirgilSDKKeyknox.xcodeproj
- IOS_SDK=iphonesimulator12.2
- MACOS_SDK=macosx10.14
- TVOS_SDK=appletvsimulator12.2
- WATCHOS_SDK=watchsimulator5.2
- FRAMEWORK_NAME=VirgilSDKKeyknox
- REPO=VirgilSecurity/virgil-keyknox-x
matrix:
- DESTINATION="" PREFIX="" SDK="" BUILD="0" PUBLISH_CARTHAGE="YES" CARTHAGE_PLATFORM_NAME="Mac" PUBLISH_POD="YES" PUBLISH_DOCS="YES" SWIFT_LINT="YES"
- DESTINATION="OS=12.2,name=iPhone SE" PREFIX="iOS" SDK="$IOS_SDK" BUILD="2" PUBLISH_CARTHAGE="NO" CARTHAGE_PLATFORM_NAME="iOS" PUBLISH_POD="NO" PUBLISH_DOCS="NO" SWIFT_LINT="NO"
- DESTINATION="arch=x86_64" PREFIX="macOS" SDK="$MACOS_SDK" BUILD="2" PUBLISH_CARTHAGE="NO" CARTHAGE_PLATFORM_NAME="Mac" PUBLISH_POD="NO" PUBLISH_DOCS="NO" SWIFT_LINT="NO"
- DESTINATION="OS=12.2,name=Apple TV 4K" PREFIX="tvOS" SDK="$TVOS_SDK" BUILD="2" PUBLISH_CARTHAGE="NO" CARTHAGE_PLATFORM_NAME="tvOS" PUBLISH_POD="NO" PUBLISH_DOCS="NO" SWIFT_LINT="NO"
- DESTINATION="OS=5.2,name=Apple Watch Series 4 - 44mm" PREFIX="watchOS" SDK="$WATCHOS_SDK" BUILD="1" PUBLISH_CARTHAGE="NO" CARTHAGE_PLATFORM_NAME="watchOS" PUBLISH_POD="NO" PUBLISH_DOCS="NO" SWIFT_LINT="NO"
before_install:
- set -e
- set -o pipefail
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 --platform ${CARTHAGE_PLATFORM_NAME}
- |
if [ $SWIFT_LINT == "YES" ]; then
brew outdated swiftlint || brew upgrade swiftlint
swiftlint
fi
- SCHEME="VirgilSDKKeyknox ${PREFIX}"
- |
if [ $BUILD == "2" ]; then
# Build Framework
xcodebuild -verbose -project "$PROJECT" -scheme "$SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Debug clean build-for-testing | xcpretty;
# Run Tests
xcodebuild -verbose -project "$PROJECT" -scheme "$SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Debug test-without-building | xcpretty;
elif [ $BUILD == "1" ]; then
# Build Framework
xcodebuild -verbose -project "$PROJECT" -scheme "$SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Release clean build | xcpretty;
fi
# Build with carthage
- if [ $PUBLISH_CARTHAGE == "YES" ]; then
brew outdated || brew upgrade carthage;
carthage build --no-skip-current;
carthage archive;
fi
# Generate and publish docs
- if [[ $PUBLISH_DOCS = "YES" && $TRAVIS_TAG =~ ^[0-9]+\.[0-9]+\.[0-9]+ ]]; then
./CI/publish-docs.sh;
fi
deploy:
# Upload framework to gh-releases for carthage
- provider: releases
api_key: $GITHUB_ACCESS_TOKEN
file: "$FRAMEWORK_NAME.framework.zip"
skip_cleanup: true
on:
repo: $REPO
tags: true
condition: $PUBLISH_CARTHAGE = "YES"
- provider: script
script: bash CI/publish-cocoapods.sh
on:
repo: $REPO
tags: true
condition: $PUBLISH_POD == "YES" && $TRAVIS_TAG =~ ^[0-9]+\.[0-9]+\.[0-9]+
# Upload docs to gh-pages
- provider: pages
skip_cleanup: true
github-token: $GITHUB_ACCESS_TOKEN
local_dir: "docs"
on:
repo: $REPO
tags: true
condition: $PUBLISH_DOCS == "YES" && $TRAVIS_TAG =~ ^[0-9]+\.[0-9]+\.[0-9]+