Various fixes to SPM logic

Improves prompt asking to force move tag (default is NO, but can be triggered after `make release`). Fixes issues with single quotes in make-release-package.sh.
This commit is contained in:
Jonas Zaugg authored and Zorg committed 2021-03-06 20:18:23 -08:00
1 parent fd940884c8
commit cd8794acce
3 files changed
+7 -3

No files matched your search

+2 -1
View File
@@ -88,6 +88,7 @@ if [ "$ACTION" = "" ] ; then
#rm -rf "$CONFIGURATION_BUILD_DIR/Sparkle.xcarchive"
zip -rqyX -9 "../Sparkle-for-Swift-Package-Manager.zip" *
# Get latest git tag
cd "$SRCROOT"
latest_git_tag=$(git describe --abbrev=0)
# Generate new Package manifest
cd "$CONFIGURATION_BUILD_DIR"
@@ -96,7 +97,7 @@ if [ "$ACTION" = "" ] ; then
# is equivalent to shasum -a 256 FILE
spm_checksum=$(swift package compute-checksum "Sparkle-for-Swift-Package-Manager.zip")
rm -rf ".build"
sed -E -i '' -e '/let tag/ s/".+"/"$latest_git_tag"/' -e '/let version/ s/".+"/"$CURRENT_PROJECT_VERSION"/' -e "/let checksum/ s/[[:xdigit:]]{64}/$spm_checksum/" "Package.swift"
sed -E -i '' -e "/let tag/ s/\".+\"/\"$latest_git_tag\"/" -e "/let version/ s/\".+\"/\"$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"
+1 -1
View File
@@ -10,7 +10,7 @@ if [ "$commits_since_tag" -gt 0 ]; then
echo "Package.swift has not been committed and tag has not been moved."
else
# TODO: add sanity check to see if version is actually being updated or not?
read -p "Do you want to commit changes to Package.swift and force move tag '$latest_git_tag'? (required for Swift Package Manager release) " -n 1 -r
read -p "Do you want to commit changes to Package.swift and force move tag '$latest_git_tag'? (required for SPM release) [y/N]" -n 1 -r
echo # (optional) move to a new line
if [[ $REPLY =~ ^[Yy]$ ]]; then
long_message=$(git tag -n99 -l $latest_git_tag) # gets corresponding message
+4 -1
View File
@@ -1,9 +1,12 @@
// swift-tools-version:5.3
import PackageDescription
// Version is technically not required here, SPM doesn't check
let version = "2.0.0"
// Tag is required to point towards the right asset. SPM requires the tag to follow semantic versioning to be able to resolve it.
let tag = "2.0.0"
let checksum = "ef0d0cc46421f8644f455b62537f4e4db2c97bdca5820641219a1836f3782878"
let url = "https://github.com/sparkle-project/Sparkle/releases/download/\(version)/Sparkle-for-Swift-Package-Manager.zip"
let url = "https://github.com/sparkle-project/Sparkle/releases/download/\(tag)/Sparkle-for-Swift-Package-Manager.zip"
let package = Package(
name: "Sparkle",