From e96ccab0b248d9c7fbe994bb6878b5b968c7db40 Mon Sep 17 00:00:00 2001 From: freak4pc Date: Sat, 15 Jun 2019 01:23:57 +0300 Subject: [PATCH] Add `make archive` to create a Carthage prebuild binary --- .gitignore | 2 ++ Makefile | 2 ++ scripts/carthage-archive.sh | 30 ++++++++++++++++++++++++++++++ 3 files changed, 34 insertions(+) create mode 100644 Makefile create mode 100755 scripts/carthage-archive.sh diff --git a/.gitignore b/.gitignore index b408584..cb785bb 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,8 @@ DerivedData/ *.perspectivev3 !default.perspectivev3 xcuserdata/ +RxCombine.xcodeproj +Package.resolved ## Other *.moved-aside diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..5a20331 --- /dev/null +++ b/Makefile @@ -0,0 +1,2 @@ +archive: + scripts/carthage-archive.sh \ No newline at end of file diff --git a/scripts/carthage-archive.sh b/scripts/carthage-archive.sh new file mode 100755 index 0000000..30fd7bf --- /dev/null +++ b/scripts/carthage-archive.sh @@ -0,0 +1,30 @@ +#!/bin/sh + +if ! which carthage > /dev/null; then + echo 'Error: Carthage is not installed' >&2 + exit 1 +fi + +if [ ! -f Package.swift ]; then + echo "Package.swift can't be found, please make sure you run scripts/carthage-archive.sh from the root folder" >&2 + exit 1 +fi + +if ! which swift > /dev/null; then + echo 'Swift is not installed' >&2 + exit 1 +fi + +REQUIRED_SWIFT_TOOLING="5.1.0" +TOOLS_VERSION=`swift package tools-version` + +if [ ! "$(printf '%s\n' "$REQUIRED_SWIFT_TOOLING" "$TOOLS_VERSION" | sort -V | head -n1)" = "$REQUIRED_SWIFT_TOOLING" ]; then + echo 'You must have Swift Package Manager 5.1.0 or later.' + exit 1 +fi + +swift package generate-xcodeproj +carthage build --no-skip-current +carthage archive + +echo "Upload RxCombine.framework.zip to the latest release" \ No newline at end of file