Skip to content

Commit 20a8632

Browse files
Merge pull request #17 from SomeRandomiOSDev/Modernize
Modernized the project
2 parents aa0be91 + 1816868 commit 20a8632

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1707
-1039
lines changed

.github/workflows/carthage.yml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Carthage
2+
on: [push, workflow_dispatch]
3+
4+
jobs:
5+
build:
6+
name: Build
7+
runs-on: macOS-latest
8+
steps:
9+
- name: Checkout Code
10+
uses: actions/checkout@v2
11+
12+
- name: Install Carthage
13+
run: |
14+
brew update
15+
brew install carthage
16+
17+
- name: Create Cartfile
18+
run: |
19+
# Delete all of the old tags (if any) and create a new tag for building
20+
git tag | xargs git tag -d
21+
git tag 1.0
22+
23+
echo "git \"file://$(pwd)\"" > ./Cartfile
24+
25+
- name: Build
26+
run: |
27+
./scripts/carthage.sh update

.github/workflows/cocoapods.yml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Cocoapods
2+
on: [push, workflow_dispatch]
3+
4+
jobs:
5+
lint:
6+
name: Lint
7+
runs-on: macOS-11
8+
steps:
9+
- name: Checkout Code
10+
uses: actions/checkout@v2
11+
12+
- name: Setup Cocoapods
13+
uses: maxim-lobanov/setup-cocoapods@v1
14+
with:
15+
version: latest
16+
17+
- name: Lint (Dynamic Library)
18+
run: |
19+
pod lib lint
20+
21+
- name: Lint (Static Library)
22+
run: |
23+
pod lib lint --use-libraries

.github/workflows/swift-pacakge.yml

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Swift Package
2+
on: [push, workflow_dispatch]
3+
4+
jobs:
5+
build:
6+
strategy:
7+
matrix:
8+
os: [macOS-latest, ubuntu-latest]
9+
10+
name: Build
11+
runs-on: ${{ matrix.os }}
12+
13+
steps:
14+
- name: Checkout Code
15+
uses: actions/checkout@v2
16+
17+
- name: Build
18+
run: |
19+
swift --version
20+
swift build -v
21+
22+
test:
23+
strategy:
24+
matrix:
25+
os: [macOS-latest, ubuntu-latest]
26+
27+
name: Test
28+
runs-on: ${{ matrix.os }}
29+
needs: build
30+
31+
steps:
32+
- name: Checkout Code
33+
uses: actions/checkout@v2
34+
35+
- name: Test
36+
run: |
37+
swift test -v --enable-code-coverage
38+
39+
- name: Generate Code Coverage File
40+
if: ${{ runner.os == 'macOS' && github.event_name == 'push' && github.ref == 'refs/heads/main' }}
41+
run: |
42+
xcrun llvm-cov export --instr-profile=.build/x86_64-apple-macosx/debug/codecov/default.profdata .build/x86_64-apple-macosx/debug/CBORCodingPackageTests.xctest/Contents/MacOS/CBORCodingPackageTests > ./info.lcov
43+
44+
- name: Upload Code Coverage
45+
if: ${{ runner.os == 'macOS' && github.event_name == 'push' && github.ref == 'refs/heads/main' }}
46+
uses: codecov/codecov-action@v1
47+
with:
48+
token: ${{ secrets.CODECOV_TOKEN }}
49+
file: ./info.lcov
50+
verbose: true

.github/workflows/swift.yml

-38
This file was deleted.

.github/workflows/upload-assets.yml

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Upload Assets
2+
on:
3+
release:
4+
types: [published]
5+
6+
jobs:
7+
build:
8+
name: Upload Assets
9+
runs-on: macOS-latest
10+
env:
11+
TMPDIR: /tmp/.cborcoding.xcframework.build
12+
13+
steps:
14+
- name: Checkout Code
15+
uses: actions/checkout@v2
16+
17+
- name: Build
18+
run: |
19+
./scripts/xcframework.sh -output ${TMPDIR}/CBORCoding.xcframework
20+
21+
- name: Create Zip
22+
run: |
23+
cd ${TMPDIR}
24+
zip -rX CBORCoding.xcframework.zip CBORCoding.xcframework
25+
26+
- name: Upload Zip
27+
uses: actions/upload-release-asset@v1
28+
env:
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30+
with:
31+
upload_url: ${{ github.event.release.upload_url }}
32+
asset_path: ${{ env.TMPDIR }}/CBORCoding.xcframework.zip
33+
asset_name: CBORCoding.xcframework.zip
34+
asset_content_type: application/zip
35+
36+
- name: Create Tar
37+
run: |
38+
cd ${TMPDIR}
39+
tar -zcvf CBORCoding.xcframework.tar.gz CBORCoding.xcframework
40+
41+
- name: Upload Tar
42+
uses: actions/upload-release-asset@v1
43+
env:
44+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45+
with:
46+
upload_url: ${{ github.event.release.upload_url }}
47+
asset_path: ${{ env.TMPDIR }}/CBORCoding.xcframework.tar.gz
48+
asset_name: CBORCoding.xcframework.tar.gz
49+
asset_content_type: application/gzip

.github/workflows/xcframework.yml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: XCFramework
2+
on: [push, workflow_dispatch]
3+
4+
jobs:
5+
build:
6+
name: Build
7+
runs-on: macOS-latest
8+
env:
9+
TMPDIR: /tmp/.cborcoding.xcframework.build
10+
11+
steps:
12+
- name: Checkout Code
13+
uses: actions/checkout@v2
14+
15+
- name: Build
16+
run: |
17+
./scripts/xcframework.sh -output ${TMPDIR}/CBORCoding.xcframework

.github/workflows/xcodebuild.yml

+110
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
name: Xcode Project
2+
on: [push, workflow_dispatch]
3+
4+
jobs:
5+
ios:
6+
name: iOS
7+
runs-on: macOS-latest
8+
9+
steps:
10+
- name: Checkout Code
11+
uses: actions/checkout@v2
12+
13+
- name: Build iOS
14+
run: |
15+
xcodebuild -project CBORCoding.xcodeproj -scheme "CBORCoding" -destination "generic/platform=iOS" -configuration Debug
16+
17+
- name: Build iOS Simulator
18+
run: |
19+
xcodebuild -project CBORCoding.xcodeproj -scheme "CBORCoding" -destination "generic/platform=iOS Simulator" -configuration Debug
20+
21+
- name: Test
22+
run: |
23+
IOS_SIM="$(xcrun simctl list devices available | grep "iPhone [0-9]" | sort -rV | head -n 1 | sed -E 's/(.+)[ ]*\([^)]*\)[ ]*\([^)]*\)/\1/' | awk '{$1=$1};1')"
24+
if [ "${#IOS_SIM}" == "0" ]; then
25+
IOS_SIM = "iPhone 12 Pro" # Fallback Simulator
26+
fi
27+
28+
xcodebuild -project CBORCoding.xcodeproj -scheme "CBORCoding" -testPlan "CBORCodingTests" -destination "platform=iOS Simulator,name=$IOS_SIM" -configuration Debug ONLY_ACTIVE_ARCH=YES test
29+
30+
maccatalyst:
31+
name: Mac Catalyst
32+
runs-on: macOS-latest
33+
34+
steps:
35+
- name: Checkout Code
36+
uses: actions/checkout@v2
37+
38+
- name: Build
39+
run: |
40+
xcodebuild -project CBORCoding.xcodeproj -scheme "CBORCoding" -destination "generic/platform=macOS,variant=Mac Catalyst" -configuration Debug
41+
42+
- name: Test
43+
run: |
44+
xcodebuild -project CBORCoding.xcodeproj -scheme "CBORCoding" -testPlan "CBORCodingTests" -destination "platform=macOS,variant=Mac Catalyst" -configuration Debug ONLY_ACTIVE_ARCH=YES test
45+
46+
macos:
47+
name: macOS
48+
runs-on: macOS-latest
49+
50+
steps:
51+
- name: Checkout Code
52+
uses: actions/checkout@v2
53+
54+
- name: Build
55+
run: |
56+
xcodebuild -project CBORCoding.xcodeproj -scheme "CBORCoding macOS" -destination "generic/platform=macOS" -configuration Debug
57+
58+
- name: Test
59+
run: |
60+
xcodebuild -project CBORCoding.xcodeproj -scheme "CBORCoding macOS" -testPlan "CBORCoding macOS Tests" -configuration Debug ONLY_ACTIVE_ARCH=YES test
61+
62+
tvos:
63+
name: tvOS
64+
runs-on: macOS-latest
65+
66+
steps:
67+
- name: Checkout Code
68+
uses: actions/checkout@v2
69+
70+
- name: Build tvOS
71+
run: |
72+
xcodebuild -project CBORCoding.xcodeproj -scheme "CBORCoding tvOS" -destination "generic/platform=tvOS" -configuration Debug
73+
74+
- name: Build tvOS Simulator
75+
run: |
76+
xcodebuild -project CBORCoding.xcodeproj -scheme "CBORCoding tvOS" -destination "generic/platform=tvOS Simulator" -configuration Debug
77+
78+
- name: Test
79+
run: |
80+
TVOS_SIM="$(xcrun simctl list devices available | grep "Apple TV" | sort -V | head -n 1 | sed -E 's/(.+)[ ]*\([^)]*\)[ ]*\([^)]*\)/\1/' | awk '{$1=$1};1')"
81+
if [ "${#TVOS_SIM}" == "0" ]; then
82+
TVOS_SIM = "Apple TV" # Fallback Simulator
83+
fi
84+
85+
xcodebuild -project CBORCoding.xcodeproj -scheme "CBORCoding tvOS" -testPlan "CBORCoding tvOS Tests" -destination "platform=tvOS Simulator,name=$TVOS_SIM" -configuration Debug ONLY_ACTIVE_ARCH=YES test
86+
87+
watchos:
88+
name: watchOS
89+
runs-on: macOS-11
90+
91+
steps:
92+
- name: Checkout Code
93+
uses: actions/checkout@v2
94+
95+
- name: Build watchOS
96+
run: |
97+
xcodebuild -project CBORCoding.xcodeproj -scheme "CBORCoding watchOS" -destination "generic/platform=watchOS" -configuration Debug
98+
99+
- name: Build watchOS Simulator
100+
run: |
101+
xcodebuild -project CBORCoding.xcodeproj -scheme "CBORCoding watchOS" -destination "generic/platform=watchOS Simulator" -configuration Debug
102+
103+
- name: Test
104+
run: |
105+
WATCHOS_SIM="$(xcrun simctl list devices available | grep "Apple Watch" | sort -rV | head -n 1 | sed -E 's/(.+)[ ]*\([^)]*\)[ ]*\([^)]*\)/\1/' | awk '{$1=$1};1')"
106+
if [ "${#WATCHOS_SIM}" == "0" ]; then
107+
WATCHOS_SIM = "Apple Watch Series 6 - 44mm" # Fallback Simulator
108+
fi
109+
110+
xcodebuild -project CBORCoding.xcodeproj -scheme "CBORCoding watchOS" -testPlan "CBORCoding watchOS Tests" -destination "platform=watchOS Simulator,name=$WATCHOS_SIM" -configuration Debug ONLY_ACTIVE_ARCH=YES test

.gitignore

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
CBORCoding.xcodeproj/project.xcworkspace/xcuserdata
22
CBORCoding.xcodeproj/xcuserdata
3-
CBORCoding.xcworkspace/xcuserdata
3+
44
.build
55
.swiftpm
66
IDEWorkspaceChecks.plist
7-
Pods
8-
Carthage
7+
scripts/build

.travis.yml

-10
This file was deleted.

CBORCoding.podspec

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Pod::Spec.new do |s|
22

33
s.name = "CBORCoding"
4-
s.version = "1.2.0"
4+
s.version = "1.3.0"
55
s.summary = "A CBOR Encoder and Decoder"
66
s.description = <<-DESC
77
A lightweight framework containing a coder pair for encoding and decoding `Codable` conforming types to and from CBOR document format for iOS, macOS, tvOS, and watchOS.
@@ -11,7 +11,7 @@ Pod::Spec.new do |s|
1111
s.license = "MIT"
1212
s.author = { "Joseph Newton" => "[email protected]" }
1313

14-
s.ios.deployment_target = '8.0'
14+
s.ios.deployment_target = '9.0'
1515
s.macos.deployment_target = '10.10'
1616
s.tvos.deployment_target = '9.0'
1717
s.watchos.deployment_target = '2.0'
@@ -24,11 +24,12 @@ Pod::Spec.new do |s|
2424
s.dependency 'Half', '~> 1.2'
2525

2626
s.test_spec 'Tests' do |ts|
27-
ts.ios.deployment_target = '8.0'
28-
ts.macos.deployment_target = '10.10'
29-
ts.tvos.deployment_target = '9.0'
27+
ts.ios.deployment_target = '9.0'
28+
ts.macos.deployment_target = '10.10'
29+
ts.tvos.deployment_target = '9.0'
30+
ts.watchos.deployment_target = '2.0'
3031

31-
ts.source_files = 'Tests/CBORCodingTests/*Tests.swift'
32+
ts.source_files = 'Tests/CBORCodingTests/*Tests.swift'
3233
end
3334

3435
end

0 commit comments

Comments
 (0)