Skip to content

Commit

Permalink
Add make archive to create a Carthage prebuild binary
Browse files Browse the repository at this point in the history
  • Loading branch information
freak4pc committed Jun 14, 2019
1 parent 289586b commit e96ccab
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ DerivedData/
*.perspectivev3
!default.perspectivev3
xcuserdata/
RxCombine.xcodeproj
Package.resolved

## Other
*.moved-aside
Expand Down
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
archive:
scripts/carthage-archive.sh
30 changes: 30 additions & 0 deletions scripts/carthage-archive.sh
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit e96ccab

Please sign in to comment.