Skip to content

Commit

Permalink
Merge pull request #21 from VirgilSecurity/develop
Browse files Browse the repository at this point in the history
v0.11.0
  • Loading branch information
Ogerets authored Jul 26, 2022
2 parents 1304737 + 405066b commit 4a259dd
Show file tree
Hide file tree
Showing 24 changed files with 302 additions and 110 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: deploy

on:
push:
tags:
- '*'

jobs:
Deploy:
name: Deploy
runs-on: macOS-12
env:
DEVELOPER_DIR: /Applications/Xcode_13.4.1.app/Contents/Developer
steps:
- uses: actions/checkout@v2
- name: Prepare Dependencies
env:
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -o pipefail
carthage version
carthage bootstrap --use-xcframeworks
- name: Generate Docs
run: ./CI/publish-docs.sh

- name: Publish Docs
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs

- name: Build Carthage Binary
run: |
./CI/publish-carthage.sh;
- name: Upload Carthage Binary
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: VirgilSDKPythia.xcframework.zip
tag: ${{ github.ref }}
overwrite: true
- name: Publish Cocoapods
run: ./CI/publish-cocoapods.sh
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}

79 changes: 79 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: tests

on:
push:
branches:
- develop

jobs:
Tests:
name: Tests
runs-on: macOS-12
env:
DEVELOPER_DIR: /Applications/Xcode_13.4.1.app/Contents/Developer
PROJECT: VirgilSDKPythia.xcodeproj
strategy:
matrix:
include:
- destination: "OS=15.5,name=iPhone 13 Pro"
prefix: "iOS"
test: "1"
- destination: "arch=x86_64"
prefix: "macOS"
test: "1"
- destination: "OS=15.4,name=Apple TV"
prefix: "tvOS"
test: "1"
- destination: "OS=8.5,name=Apple Watch Series 7 - 45mm"
prefix: "watchOS"
test: "0"
steps:
- uses: actions/checkout@v2
- name: Decrypt tests config
run: ./CI/decrypt-config.sh
env:
ENCRYPTION_KEY: ${{ secrets.ENCRYPTION_KEY }}
ENCRYPTION_IV: ${{ secrets.ENCRYPTION_IV }}
- name: Prepare Dependencies
env:
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
carthage version
carthage bootstrap --use-xcframeworks --platform ${{ matrix.prefix }}
- name: Run ${{ matrix.prefix }} Tests
run: |
SCHEME="VirgilSDKPythia ${{ matrix.prefix }}"
if "${{ matrix.test }}" == "1"; then
# Build Framework
xcodebuild -verbose -project "$PROJECT" -scheme "$SCHEME" -destination "${{ matrix.destination }}" -configuration Debug clean build-for-testing | xcpretty;
# Run Tests
xcodebuild -verbose -project "$PROJECT" -scheme "$SCHEME" -destination "${{ matrix.destination }}" -configuration Debug test-without-building | xcpretty;
else
xcodebuild -verbose -project "$PROJECT" -scheme "$SCHEME" -destination "${{ matrix.destination }}" -configuration Release clean build | xcpretty;
fi
SPM:
runs-on: macOS-12
steps:
- uses: actions/checkout@v2
- name: Decrypt tests config
run: ./CI/decrypt-config.sh
env:
ENCRYPTION_KEY: ${{ secrets.ENCRYPTION_KEY }}
ENCRYPTION_IV: ${{ secrets.ENCRYPTION_IV }}
- name: SPM test
run: |
brew install coreutils # install 'timeout' utility
swift --version
# fix for Swift Package Manager when it fails to download binary targets
timeout 5m bash -c 'until swift build; do rm -fr .build && sleep 10; done'
swift test
Swiftlint:
runs-on: macOS-12
steps:
- uses: actions/checkout@v2
- name: Swiftlint
run: |
brew outdated swiftlint || brew upgrade swiftlint
swiftlint
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Pods

## Build generated
build/
.build/
DerivedData/

## Various settings
Expand Down
7 changes: 7 additions & 0 deletions .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

95 changes: 0 additions & 95 deletions .travis.yml

This file was deleted.

3 changes: 3 additions & 0 deletions CI/decrypt-config.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
openssl aes-256-cbc -K $ENCRYPTION_KEY -iv $ENCRYPTION_IV -in config.tar.enc -out config.tar -d
tar xvf config.tar
mv TestConfig.plist Tests/Data/TestConfig.plist
6 changes: 3 additions & 3 deletions CI/publish-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,18 @@

# Settings
REPO_PATH=https://github.com/${REPO}.git
DOCS_DIR="${TRAVIS_BUILD_DIR}/docs"
DOCS_DIR="${GITHUB_WORKSPACE}/docs"
mkdir -p ${DOCS_DIR}
git clone -b gh-pages "${REPO_PATH}" --single-branch ${DOCS_DIR}

INFOPLIST_FILE_PATH="${TRAVIS_BUILD_DIR}/VirgilSDKPythia/Info.plist"
INFOPLIST_FILE_PATH="${GITHUB_WORKSPACE}/VirgilSDKPythia/Info.plist"

# Define SDK versions
VIRGIL_SDK_VERSION="v"$(/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" "${INFOPLIST_FILE_PATH}")
CURRENT_VERSION_DIR="${DOCS_DIR}/${VIRGIL_SDK_VERSION}"

# Generate the HTML documentation.
OUTPUT=${CURRENT_VERSION_DIR} ${TRAVIS_BUILD_DIR}/CI/generate-docs.sh
OUTPUT=${CURRENT_VERSION_DIR} ${GITHUB_WORKSPACE}/CI/generate-docs.sh

# Generate root HTML file
function get_dir_names {
Expand Down
4 changes: 2 additions & 2 deletions Cartfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
github "VirgilSecurity/virgil-sdk-x" ~> 8.0.0
github "VirgilSecurity/virgil-cryptowrapper-x" ~> 0.16.0
github "VirgilSecurity/virgil-sdk-x" ~> 8.1.0
github "VirgilSecurity/virgil-cryptowrapper-x" ~> 0.16.1
11 changes: 7 additions & 4 deletions Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
github "VirgilSecurity/virgil-crypto-c" "v0.16.0"
github "VirgilSecurity/virgil-crypto-x" "6.0.0"
github "VirgilSecurity/virgil-cryptowrapper-x" "0.16.0"
github "VirgilSecurity/virgil-sdk-x" "8.0.0"
binary "https://raw.githubusercontent.com/VirgilSecurity/virgil-crypto-c/v0.16.1/carthage-specs/VSCCommon.json" "0.16.1"
binary "https://raw.githubusercontent.com/VirgilSecurity/virgil-crypto-c/v0.16.1/carthage-specs/VSCFoundation.json" "0.16.1"
binary "https://raw.githubusercontent.com/VirgilSecurity/virgil-crypto-c/v0.16.1/carthage-specs/VSCPythia.json" "0.16.1"
binary "https://raw.githubusercontent.com/VirgilSecurity/virgil-crypto-c/v0.16.1/carthage-specs/VSCRatchet.json" "0.16.1"
github "VirgilSecurity/virgil-crypto-x" "6.0.1"
github "VirgilSecurity/virgil-cryptowrapper-x" "0.16.1"
github "VirgilSecurity/virgil-sdk-x" "8.1.0"
32 changes: 32 additions & 0 deletions Package.resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"pins" : [
{
"identity" : "virgil-crypto-x",
"kind" : "remoteSourceControl",
"location" : "https://github.com/VirgilSecurity/virgil-crypto-x.git",
"state" : {
"revision" : "eee53f493c6dcdefe49378d2967b7fe750ad18e0",
"version" : "6.0.1"
}
},
{
"identity" : "virgil-cryptowrapper-x",
"kind" : "remoteSourceControl",
"location" : "https://github.com/VirgilSecurity/virgil-cryptowrapper-x.git",
"state" : {
"revision" : "957bf2113ea570f1b934ffab5bbfbc8e12c7e6a3",
"version" : "0.16.1"
}
},
{
"identity" : "virgil-sdk-x",
"kind" : "remoteSourceControl",
"location" : "https://github.com/VirgilSecurity/virgil-sdk-x.git",
"state" : {
"revision" : "4ea08d9ad458c9197961d88dbc163ee1a608fa84",
"version" : "8.1.0"
}
}
],
"version" : 2
}
44 changes: 44 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// swift-tools-version: 5.6
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "VirgilSDKPythia",
platforms: [
.macOS(.v10_11), .iOS(.v9), .tvOS(.v9), .watchOS(.v2)
],
products: [
.library(
name: "VirgilSDKPythia",
targets: ["VirgilSDKPythia"]),
],

dependencies: [
.package(url: "https://github.com/VirgilSecurity/virgil-sdk-x.git",
Range(uncheckedBounds: (lower: Version(8, 1, 0), upper: Version(8, 2, 0)))),
.package(url: "https://github.com/VirgilSecurity/virgil-cryptowrapper-x.git", exact: .init(0, 16, 1))
],

targets: [
.target(
name: "VirgilSDKPythia",
dependencies: [
.product(name: "VirgilSDK", package: "virgil-sdk-x"),
.product(name: "VirgilCryptoPythia", package: "virgil-cryptowrapper-x")
],
path: "Source"
),
.testTarget(
name: "VirgilSDKPythiaTests",
dependencies: ["VirgilSDKPythia"],
path: "Tests",
resources: [
.process("Data/TestConfig.plist")
],
swiftSettings: [
.define("SPM_BUILD")
]
)
]
)
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,12 @@ Additionally, you'll need to copy debug symbols for debugging and crash reportin
On your application target’s “Build Phases” settings tab, click the “+” icon and choose “New Copy Files Phase”.
Click the “Destination” drop-down menu and select “Products Directory”. For each framework, drag and drop corresponding dSYM file.

### Swift Package Manager

[Swift Package Manager](https://www.swift.org/package-manager) is an official Apple tool for managing the distribution of Swift code.

[The Apple documentation](https://developer.apple.com/documentation/swift_packages/adding_package_dependencies_to_your_app) can be used to add frameworks to an Xcode project.

## Usage Examples

### BrainKey
Expand Down
1 change: 1 addition & 0 deletions Source/BrainKey/BrainKey.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
// Lead Maintainer: Virgil Security Inc. <support@virgilsecurity.com>
//

import Foundation
import VirgilSDK
import VirgilCrypto

Expand Down
1 change: 1 addition & 0 deletions Source/BrainKey/BrainKeyContext.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
// Lead Maintainer: Virgil Security Inc. <support@virgilsecurity.com>
//

import Foundation
import VirgilSDK
import VirgilCrypto

Expand Down
1 change: 1 addition & 0 deletions Source/Client/PythiaClient+Queries.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
// Lead Maintainer: Virgil Security Inc. <support@virgilsecurity.com>
//

import Foundation
import VirgilSDK

// MARK: - PythiaClientProtocol implementation
Expand Down
Loading

0 comments on commit 4a259dd

Please # to comment.