Skip to content

Commit

Permalink
Merge pull request #74 from VirgilSecurity/develop
Browse files Browse the repository at this point in the history
v3.0.1
  • Loading branch information
Ogerets authored Jul 28, 2022
2 parents 404cdb7 + 8dbed7f commit bae4fda
Show file tree
Hide file tree
Showing 72 changed files with 400 additions and 146 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
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: VirgilSDKE3Kit.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: VirgilE3Kit.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="VirgilE3Kit ${{ 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 @@ -4,6 +4,7 @@

## Build generated
build/
.build/
DerivedData/

## Various settings
Expand Down
5 changes: 4 additions & 1 deletion .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,10 @@ opt_in_rules:
- void_return
- weak_delegate

excluded:
excluded:
- .build
- .swiftpm
- Package.swift
- Carthage
- Tests
- E3Kit TestApp iOS
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.

97 changes: 0 additions & 97 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/Swift/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 @@ -36,19 +36,19 @@
#

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

INFOPLIST_FILE_PATH="${TRAVIS_BUILD_DIR}/VirgilE3Kit/Info.plist"
INFOPLIST_FILE_PATH="${GITHUB_WORKSPACE}/VirgilE3Kit/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-ratchet-x" "0.8.0"
github "VirgilSecurity/virgil-pythia-x" "0.10.0"
github "VirgilSecurity/virgil-ratchet-x" "0.9.0"
github "VirgilSecurity/virgil-pythia-x" "0.11.0"
15 changes: 9 additions & 6 deletions Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
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-pythia-x" "0.10.0"
github "VirgilSecurity/virgil-ratchet-x" "0.8.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-pythia-x" "0.11.0"
github "VirgilSecurity/virgil-ratchet-x" "0.9.0"
github "VirgilSecurity/virgil-sdk-x" "8.1.0"
50 changes: 50 additions & 0 deletions Package.resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"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-pythia-x",
"kind" : "remoteSourceControl",
"location" : "https://github.com/VirgilSecurity/virgil-pythia-x.git",
"state" : {
"revision" : "4a259dd70fa3ae27ad65054d54c617a870de53e5",
"version" : "0.11.0"
}
},
{
"identity" : "virgil-ratchet-x",
"kind" : "remoteSourceControl",
"location" : "https://github.com/VirgilSecurity/virgil-ratchet-x.git",
"state" : {
"revision" : "16f7669ea056b411cc11a13118b4354d0bef18fe",
"version" : "0.9.0"
}
},
{
"identity" : "virgil-sdk-x",
"kind" : "remoteSourceControl",
"location" : "https://github.com/VirgilSecurity/virgil-sdk-x.git",
"state" : {
"revision" : "4ea08d9ad458c9197961d88dbc163ee1a608fa84",
"version" : "8.1.0"
}
}
],
"version" : 2
}
43 changes: 43 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// 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: "VirgilE3Kit",
platforms: [
.macOS(.v10_11), .iOS(.v9), .tvOS(.v9), .watchOS(.v2)
],
products: [
.library(
name: "VirgilE3Kit",
targets: ["VirgilE3Kit"]),
],

dependencies: [
.package(url: "https://github.com/VirgilSecurity/virgil-pythia-x.git", exact: .init(0, 11, 0)),
.package(url: "https://github.com/VirgilSecurity/virgil-ratchet-x.git", exact: .init(0, 9, 0))
],

targets: [
.target(
name: "VirgilE3Kit",
dependencies: [
.product(name: "VirgilSDKRatchet", package: "virgil-ratchet-x"),
.product(name: "VirgilSDKPythia", package: "virgil-pythia-x"),
],
path: "Source"
),
.testTarget(
name: "VirgilE3KitTests",
dependencies: ["VirgilE3Kit"],
path: "Tests/Swift",
resources: [
.process("Data")
],
swiftSettings: [
.define("SPM_BUILD")
]
)
]
)
Loading

0 comments on commit bae4fda

Please sign in to comment.