From a481cf8c72831ce582fcc800ba5121ea9f981043 Mon Sep 17 00:00:00 2001 From: David Robles Date: Wed, 3 Nov 2021 16:02:20 -0700 Subject: [PATCH] Add SwiftPM and Github actions support --- .github/workflows/CI.yml | 40 +++++++++++++++++++++ .gitignore | 7 +++- Package.swift | 22 ++++++++++++ README.md | 1 + Reachability.podspec | 2 +- Sources/Reachability/Reachability.m | 1 + Sources/Reachability/include/Reachability.h | 1 + 7 files changed, 72 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/CI.yml create mode 100644 Package.swift create mode 120000 Sources/Reachability/Reachability.m create mode 120000 Sources/Reachability/include/Reachability.h diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml new file mode 100644 index 0000000..0a67840 --- /dev/null +++ b/.github/workflows/CI.yml @@ -0,0 +1,40 @@ +name: "Reachability CI" + +on: + push: + branches: + - master + pull_request: + branches: + - '*' + +jobs: + Pods: + name: Cocoapods Lint (Latest Stable Xcode) + runs-on: macOS-11 + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Setup Xcode version + uses: maxim-lobanov/setup-xcode@v1.4.0 + with: + xcode-version: latest-stable + + - name: Run pod lib lint + run: pod lib lint --fail-fast + + SwiftPM: + name: SwiftPM (Latest Stable Xcode) + runs-on: macOS-11 + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Setup Xcode version + uses: maxim-lobanov/setup-xcode@v1.4.0 + with: + xcode-version: latest-stable + + - name: Build + run: swift build diff --git a/.gitignore b/.gitignore index 9af3db5..4918a6f 100644 --- a/.gitignore +++ b/.gitignore @@ -22,4 +22,9 @@ build/ *.mode1v3 *.mode2v3 -xcuserdata \ No newline at end of file +xcuserdata + +# Swift Package Manager +.build/ +.swiftpm/ +Package.resolved diff --git a/Package.swift b/Package.swift new file mode 100644 index 0000000..ba136c0 --- /dev/null +++ b/Package.swift @@ -0,0 +1,22 @@ +// swift-tools-version:5.3 + +import PackageDescription + +let package = Package( + name: "Reachability", + platforms: [ + .iOS(.v9), + .macOS(.v10_10), + .tvOS(.v9), + ], + products: [ + .library( + name: "Reachability", + targets: ["Reachability"]), + ], + dependencies: [], + targets: [ + .target( + name: "Reachability"), + ] +) diff --git a/README.md b/README.md index 9607033..61c779c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ [![Reference Status](https://www.versioneye.com/objective-c/reachability/reference_badge.svg?style=flat)](https://www.versioneye.com/objective-c/reachability/references) +[![build-status](https://github.com/tonymillion/Reachability/actions/workflows/CI.yml/badge.svg)](https://github.com/tonymillion/Reachability/actions) # **WARNING** there have been reports of apps being rejected when Reachability is used in a framework. The only solution to this so far is to rename the class. diff --git a/Reachability.podspec b/Reachability.podspec index 8627813..59db544 100644 --- a/Reachability.podspec +++ b/Reachability.podspec @@ -13,7 +13,7 @@ EOF Pod::Spec.new do |s| s.name = 'Reachability' - s.version = '3.2' + s.version = '3.3' s.summary = 'ARC and GCD Compatible Reachability Class for iOS and OS X. Drop in replacement for Apple Reachability.' s.homepage = 'https://github.com/tonymillion/Reachability' diff --git a/Sources/Reachability/Reachability.m b/Sources/Reachability/Reachability.m new file mode 120000 index 0000000..af87d58 --- /dev/null +++ b/Sources/Reachability/Reachability.m @@ -0,0 +1 @@ +../../Reachability.m \ No newline at end of file diff --git a/Sources/Reachability/include/Reachability.h b/Sources/Reachability/include/Reachability.h new file mode 120000 index 0000000..6f25274 --- /dev/null +++ b/Sources/Reachability/include/Reachability.h @@ -0,0 +1 @@ +../../../Reachability.h \ No newline at end of file