Finalize Travis integration

This commit is contained in:
Jonas Zaugg committed 2020-08-02 16:17:03 +02:00
1 parent 1ac42dcd5b
commit 23a24f17ec
2 files changed
+13 -12

No files matched your search

+1 -1
View File
@@ -6,4 +6,4 @@ osx_image:
script:
- set -o pipefail && xcodebuild -scheme Sparkle -configuration Debug -derivedDataPath build -archivePath build/Build/Products/Debug/Sparkle.xcarchive BUILD_LIBRARY_FOR_DISTRIBUTION=YES SKIP_INSTALL=NO archive | xcpretty
- set -o pipefail && xcodebuild -create-xcframework -framework build/Build/Products/Debug/Sparkle.xcarchive/Products/Library/Frameworks/Sparkle.framework -output build/Build/Products/Debug/Sparkle.xcframework
- set -o pipefail && xcodebuild test -project Sparkle.xcodeproj -scheme Distribution -derivedDataPath build -enableCodeCoverage YES
- set -o pipefail && xcodebuild test -project Sparkle.xcodeproj -scheme Distribution -derivedDataPath build -enableCodeCoverage YES | xcpretty
+12 -11
View File
@@ -1,6 +1,5 @@
#!/bin/bash
set -e
pwd
if [ "$ACTION" = "" ] ; then
# If using cocoapods, sanity check that the Podspec version matches the Sparkle version
@@ -51,20 +50,22 @@ if [ "$ACTION" = "" ] ; then
# Generate zip containing the xcframework for SPM
cd "$CONFIGURATION_BUILD_DIR/staging-spm"
pwd
ls ../..
#rm -rf "$CONFIGURATION_BUILD_DIR/Sparkle.xcarchive"
zip -rqyX -9 "../Sparkle-SPM-$CURRENT_PROJECT_VERSION.zip" *
# Generate new Package manifest
cd "$CONFIGURATION_BUILD_DIR"
cp "$SRCROOT/Package.swift" "$CONFIGURATION_BUILD_DIR"
# is equivalent to shasum -a 256 FILE
spm_checksum=$(swift package compute-checksum "Sparkle-SPM-$CURRENT_PROJECT_VERSION.zip")
rm -rf ".build"
sed -E -i '' -e "/let version/ s/[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+/$CURRENT_PROJECT_VERSION/" -e "/let checksum/ s/[[:xdigit:]]{64}/$spm_checksum/" "Package.swift"
cp "Package.swift" "$SRCROOT"
echo "Package.swift updated with the following values:"
echo "Version: $CURRENT_PROJECT_VERSION"
echo "Checksum: $spm_checksum"
if [ "$XCODE_VERSION_MAJOR" -ge "1200" ]; then
# is equivalent to shasum -a 256 FILE
spm_checksum=$(swift package compute-checksum "Sparkle-SPM-$CURRENT_PROJECT_VERSION.zip")
rm -rf ".build"
sed -E -i '' -e "/let version/ s/[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+/$CURRENT_PROJECT_VERSION/" -e "/let checksum/ s/[[:xdigit:]]{64}/$spm_checksum/" "Package.swift"
cp "Package.swift" "$SRCROOT"
echo "Package.swift updated with the following values:"
echo "Version: $CURRENT_PROJECT_VERSION"
echo "Checksum: $spm_checksum"
else
echo "Xcode version $XCODE_VERSION_ACTUAL does not support computing checksums for Swift Packages. Please update the Package manifest manually."
fi
rm -rf "$CONFIGURATION_BUILD_DIR/staging-spm"
fi