From 23a24f17ecb1e70a2a062611599bebb47823fa75 Mon Sep 17 00:00:00 2001 From: Jonas Zaugg Date: Sun, 2 Aug 2020 16:17:03 +0200 Subject: [PATCH] Finalize Travis integration --- .travis.yml | 2 +- Configurations/make-release-package.sh | 23 ++++++++++++----------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/.travis.yml b/.travis.yml index c34adc00..d6938001 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/Configurations/make-release-package.sh b/Configurations/make-release-package.sh index bccec945..dc67c22e 100755 --- a/Configurations/make-release-package.sh +++ b/Configurations/make-release-package.sh @@ -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