From e76e34ead89145d0d35e4fe6b18d71cc9c9a2fdc Mon Sep 17 00:00:00 2001 From: Zorg Date: Sat, 6 Mar 2021 20:16:06 -0800 Subject: [PATCH 1/9] Rename SPM zip https://github.com/sparkle-project/Sparkle/commit/891afd44c7075e699924ed9b81d8dc94a5111dfd#diff-507d750ad623604486faa5c9772800e8a019c7675a08688e94bde91872c0f1d8 --- Configurations/make-release-package.sh | 6 +++--- Package.swift | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Configurations/make-release-package.sh b/Configurations/make-release-package.sh index 5e3b1539..608b1164 100755 --- a/Configurations/make-release-package.sh +++ b/Configurations/make-release-package.sh @@ -15,7 +15,7 @@ if [ "$ACTION" = "" ] ; then rm -rf "$CONFIGURATION_BUILD_DIR/staging-spm" rm -f "Sparkle-$CURRENT_PROJECT_VERSION.tar.xz" rm -f "Sparkle-$CURRENT_PROJECT_VERSION.tar.bz2" - rm -f "Sparkle-SPM-$CURRENT_PROJECT_VERSION.zip" + rm -f "Sparkle-for-Swift-Package-Manager.zip" mkdir -p "$CONFIGURATION_BUILD_DIR/staging" mkdir -p "$CONFIGURATION_BUILD_DIR/staging-spm" @@ -86,13 +86,13 @@ if [ "$ACTION" = "" ] ; then # Generate zip containing the xcframework for SPM cd "$CONFIGURATION_BUILD_DIR/staging-spm" #rm -rf "$CONFIGURATION_BUILD_DIR/Sparkle.xcarchive" - zip -rqyX -9 "../Sparkle-SPM-$CURRENT_PROJECT_VERSION.zip" * + zip -rqyX -9 "../Sparkle-for-Swift-Package-Manager.zip" * # Generate new Package manifest cd "$CONFIGURATION_BUILD_DIR" cp "$SRCROOT/Package.swift" "$CONFIGURATION_BUILD_DIR" 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") + spm_checksum=$(swift package compute-checksum "Sparkle-for-Swift-Package-Manager.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" diff --git a/Package.swift b/Package.swift index f66aa2bf..1fc70f01 100644 --- a/Package.swift +++ b/Package.swift @@ -2,8 +2,8 @@ import PackageDescription let version = "2.0.0" -let checksum = "760a229721e04427783f9c43f67a0257722173c8db7e7f7df2d1387d8a3f6dbf" -let url = "https://github.com/sparkle-project/Sparkle/releases/download/\(version)/Sparkle-SPM-\(version).zip" +let checksum = "ef0d0cc46421f8644f455b62537f4e4db2c97bdca5820641219a1836f3782878" +let url = "https://github.com/sparkle-project/Sparkle/releases/download/\(version)/Sparkle-for-Swift-Package-Manager.zip" let package = Package( name: "Sparkle", From fd940884c8c8a0eaf09e1f09a8ad479c5fc067cf Mon Sep 17 00:00:00 2001 From: Jonas Zaugg Date: Thu, 4 Feb 2021 13:13:31 +0100 Subject: [PATCH 2/9] Include tag instead of version in Package.swift --- Configurations/make-release-package.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Configurations/make-release-package.sh b/Configurations/make-release-package.sh index 608b1164..b666fc81 100755 --- a/Configurations/make-release-package.sh +++ b/Configurations/make-release-package.sh @@ -87,6 +87,8 @@ if [ "$ACTION" = "" ] ; then cd "$CONFIGURATION_BUILD_DIR/staging-spm" #rm -rf "$CONFIGURATION_BUILD_DIR/Sparkle.xcarchive" zip -rqyX -9 "../Sparkle-for-Swift-Package-Manager.zip" * + # Get latest git tag + latest_git_tag=$(git describe --abbrev=0) # Generate new Package manifest cd "$CONFIGURATION_BUILD_DIR" cp "$SRCROOT/Package.swift" "$CONFIGURATION_BUILD_DIR" @@ -94,10 +96,11 @@ 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 version/ s/[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+/$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" + echo "Tag: $latest_git_tag" echo "Checksum: $spm_checksum" else echo "warning: Xcode version $XCODE_VERSION_ACTUAL does not support computing checksums for Swift Packages. Please update the Package manifest manually." From cd8794acce89f075e3a910f1dd83661c6efd63bd Mon Sep 17 00:00:00 2001 From: Jonas Zaugg Date: Thu, 4 Feb 2021 13:36:51 +0100 Subject: [PATCH 3/9] 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. --- Configurations/make-release-package.sh | 3 ++- Configurations/release-move-tag.sh | 2 +- Package.swift | 5 ++++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Configurations/make-release-package.sh b/Configurations/make-release-package.sh index b666fc81..c32059eb 100755 --- a/Configurations/make-release-package.sh +++ b/Configurations/make-release-package.sh @@ -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" diff --git a/Configurations/release-move-tag.sh b/Configurations/release-move-tag.sh index 29c7b681..5f3e029e 100755 --- a/Configurations/release-move-tag.sh +++ b/Configurations/release-move-tag.sh @@ -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 diff --git a/Package.swift b/Package.swift index 1fc70f01..bf974d1a 100644 --- a/Package.swift +++ b/Package.swift @@ -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", From 78a0d4e4e7313b737824ddd40769f2791c4060d7 Mon Sep 17 00:00:00 2001 From: Jonas Zaugg Date: Thu, 4 Feb 2021 14:29:03 +0100 Subject: [PATCH 4/9] Checks SemVer and default to force tagging --- Configurations/make-release-package.sh | 2 ++ Configurations/release-move-tag.sh | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Configurations/make-release-package.sh b/Configurations/make-release-package.sh index c32059eb..f9348007 100755 --- a/Configurations/make-release-package.sh +++ b/Configurations/make-release-package.sh @@ -90,6 +90,8 @@ if [ "$ACTION" = "" ] ; then # Get latest git tag cd "$SRCROOT" latest_git_tag=$(git describe --abbrev=0) + # Check semantic versioning + [[ $latest_git_tag =~ ^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-((0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*)(\.(0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*))*))?(\\+([0-9a-zA-Z-]+(\.[0-9a-zA-Z-]+)*))?$ ]] && echo "Tag $latest_git_tag follows semantic versioning" || echo "WARNING: Tag $latest_git_tag does not follow semantic versioning! SPM will not be able to resolve the repository" # Generate new Package manifest cd "$CONFIGURATION_BUILD_DIR" cp "$SRCROOT/Package.swift" "$CONFIGURATION_BUILD_DIR" diff --git a/Configurations/release-move-tag.sh b/Configurations/release-move-tag.sh index 5f3e029e..7a5edbcb 100755 --- a/Configurations/release-move-tag.sh +++ b/Configurations/release-move-tag.sh @@ -10,9 +10,11 @@ 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 SPM release) [y/N]" -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 + if [[ $REPLY =~ ^[Nn]$ ]]; then + echo "Package.swift has not been committed and tag has not been moved." + else long_message=$(git tag -n99 -l $latest_git_tag) # gets corresponding message long_message=${long_message/$latest_git_tag} # trims tag name long_message="$(echo -e "${long_message}" | sed -e 's/^[[:space:]]*//')" # trim leading whitespace @@ -20,7 +22,5 @@ else git commit -m "Update Package.swift" git tag -fa $latest_git_tag -m "${long_message}" echo "Package.swift committed and tag '$latest_git_tag' moved." - else - echo "Package.swift has not been committed and tag has not been moved." fi fi From dc7b2f20305a19c898182556609b6b7686f867a5 Mon Sep 17 00:00:00 2001 From: Jonas Zaugg Date: Fri, 5 Feb 2021 00:15:18 +0100 Subject: [PATCH 5/9] Update make-release-package.sh Only check and update tag in Package.swift when not running a CI build. As long as GitHub actions are reserved for tests, this should be ok as this is a "fake" update of Package.swift anyway. If you ever use GitHub actions for releases, you'll probably have to rethink the tagging logic once again --- Configurations/make-release-package.sh | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/Configurations/make-release-package.sh b/Configurations/make-release-package.sh index f9348007..4db37e74 100755 --- a/Configurations/make-release-package.sh +++ b/Configurations/make-release-package.sh @@ -87,11 +87,18 @@ if [ "$ACTION" = "" ] ; then cd "$CONFIGURATION_BUILD_DIR/staging-spm" #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) - # Check semantic versioning - [[ $latest_git_tag =~ ^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-((0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*)(\.(0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*))*))?(\\+([0-9a-zA-Z-]+(\.[0-9a-zA-Z-]+)*))?$ ]] && echo "Tag $latest_git_tag follows semantic versioning" || echo "WARNING: Tag $latest_git_tag does not follow semantic versioning! SPM will not be able to resolve the repository" + + # GitHub actions set the CI environment variable to true + if [ "$CI" != true ]; then + # Get latest git tag + cd "$SRCROOT" + latest_git_tag=$(git describe --abbrev=0) + # Check semantic versioning + [[ $latest_git_tag =~ ^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-((0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*)(\.(0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*))*))?(\\+([0-9a-zA-Z-]+(\.[0-9a-zA-Z-]+)*))?$ ]] && echo "Tag $latest_git_tag follows semantic versioning" || echo "WARNING: Tag $latest_git_tag does not follow semantic versioning! SPM will not be able to resolve the repository" + else + # Dummy placeholder for CI test builds as we don't really need to update Package.swift for building and testing purposes + latest_git_tag="CI_BUILD" + fi # Generate new Package manifest cd "$CONFIGURATION_BUILD_DIR" cp "$SRCROOT/Package.swift" "$CONFIGURATION_BUILD_DIR" From 59c2c7358fac91821cc48e5b567d54d70226f53b Mon Sep 17 00:00:00 2001 From: Jonas Zaugg Date: Fri, 5 Feb 2021 21:05:14 +0100 Subject: [PATCH 6/9] Update make-release-package.sh Now provides an error and exits when not complying with SemVer --- Configurations/make-release-package.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Configurations/make-release-package.sh b/Configurations/make-release-package.sh index 4db37e74..3ef00951 100755 --- a/Configurations/make-release-package.sh +++ b/Configurations/make-release-package.sh @@ -94,7 +94,12 @@ if [ "$ACTION" = "" ] ; then cd "$SRCROOT" latest_git_tag=$(git describe --abbrev=0) # Check semantic versioning - [[ $latest_git_tag =~ ^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-((0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*)(\.(0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*))*))?(\\+([0-9a-zA-Z-]+(\.[0-9a-zA-Z-]+)*))?$ ]] && echo "Tag $latest_git_tag follows semantic versioning" || echo "WARNING: Tag $latest_git_tag does not follow semantic versioning! SPM will not be able to resolve the repository" + if [[ $latest_git_tag =~ ^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-((0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*)(\.(0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*))*))?(\\+([0-9a-zA-Z-]+(\.[0-9a-zA-Z-]+)*))?$ ]]; then + echo "Tag $latest_git_tag follows semantic versioning" + else + echo "ERROR: Tag $latest_git_tag does not follow semantic versioning! SPM will not be able to resolve the repository" >&2 + exit 1 + fi else # Dummy placeholder for CI test builds as we don't really need to update Package.swift for building and testing purposes latest_git_tag="CI_BUILD" From 724e9eb79e0bb58ff6aec9813cd79da41715c290 Mon Sep 17 00:00:00 2001 From: Zorg Date: Sat, 6 Mar 2021 20:20:08 -0800 Subject: [PATCH 7/9] Fight SPM retagging https://github.com/sparkle-project/Sparkle/commit/b5c9539f16de5b8647418fc467c6ca8fd5c8d22c --- Configurations/make-release-package.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Configurations/make-release-package.sh b/Configurations/make-release-package.sh index 3ef00951..de5551fd 100755 --- a/Configurations/make-release-package.sh +++ b/Configurations/make-release-package.sh @@ -92,7 +92,7 @@ if [ "$ACTION" = "" ] ; then if [ "$CI" != true ]; then # Get latest git tag cd "$SRCROOT" - latest_git_tag=$(git describe --abbrev=0) + latest_git_tag=$(git describe --tags --abbrev=0) # Check semantic versioning if [[ $latest_git_tag =~ ^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-((0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*)(\.(0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*))*))?(\\+([0-9a-zA-Z-]+(\.[0-9a-zA-Z-]+)*))?$ ]]; then echo "Tag $latest_git_tag follows semantic versioning" From 7c223ef0d1ed21ef11ba4a1058bf549167039de6 Mon Sep 17 00:00:00 2001 From: Kornel Date: Wed, 3 Feb 2021 12:11:16 +0000 Subject: [PATCH 8/9] Changelog --- CHANGELOG | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 4b2b5142..4a6de4df 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -18,7 +18,35 @@ Please visit [Sparkle's website](http://sparkle-project.org) for more information on documentation and migration. -# 1.24.0 +# 1.25.0 + + * Raise minimum system version to 10.9 (Kornel) + * Allow an appcast to prevent the new version from being installed automatically (#1688) (pierswalter) + * UI fixes + * Show check for updates button only when automatic updates are enabled (Lorena Rangel) + * Don't initialize the webview if we don't show release notes (Tobias Fonfara) + * Keep skip button available if there is a minimum autoupdate version (Zorg) + * Fix automatic updates checkbox state when not showing release notes (Zorg) + * Fix edge cases with hiding alert buttons and using "Install Later" (Zorg) + * Re-add setting WebUIDelegate fix for legacy web view (Zorg) + * Adopt WKWebView for 1.x (Zorg) + * Add auto layout constraints to SUAutomaticUpdateAlert window (Zorg) + * Made buttons wide enough to display the full text. Made window wide enough to display the widened buttons (el, fi, ru, uk) (Piers Uso Walter) + * Remove max size from update alert. (George Nachman) + * Integrate generate_keys export/import options changes from #1730 (Zorg) + * Add `—release-notes-url-prefix` support to localized release notes (Adam Tharani) + * Translations + * Enable base internalization for alert xibs (Zorg) + * Capitalizes french translation of "Vous utilisez actuellement..." ("You are currently running...") (Micah Moore) + * Fix and cleanup Hebrew, Catalan, Finnish localizations (Zorg) + * Remove non-english localizations from TestApplication (Zorg) + * Fix catch-22 Swift Package Manager binary target (Jonas Zaugg) + * Add explicit dependencies to fix Xcode linking errors (Kornel) + * Add phased rollouts feature to automatic update driver too (Zorg) + * Remove hiding skip button and retitling later button (Zorg) + * Deprecate installUpdatesIfAvailable (Zorg) + + # 1.24.0 * Prioritize UserDefaults when fetching value for EnableAutomaticChecks (Nicolas Bosi) * Improve best appcast item selection handling (Ian Bytchek) From aeffb2710a80baf2124130f43e7431a49764cec7 Mon Sep 17 00:00:00 2001 From: Kornel Date: Sun, 21 Feb 2021 17:26:25 +0000 Subject: [PATCH 9/9] Changelog --- CHANGELOG | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 4a6de4df..25b70d54 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -18,6 +18,16 @@ Please visit [Sparkle's website](http://sparkle-project.org) for more information on documentation and migration. +# 1.26.0 + + * Flat package support from #1745 (Zorg) + * Correct generate_appcast -s command line argument usage help (Lance Lovette) + * Fix -f command line argument handling (Lance Lovette) + * Fix progress for guided pkg install (Zorg) + * Fix XQuartz update failing because NSLog caused issues (Zorg) + * Update localization (Vojtěch Koňařík) + * Various fixes to SPM logic (Jonas Zaugg) + # 1.25.0 * Raise minimum system version to 10.9 (Kornel) @@ -45,6 +55,7 @@ Please visit [Sparkle's website](http://sparkle-project.org) for more informatio * Add phased rollouts feature to automatic update driver too (Zorg) * Remove hiding skip button and retitling later button (Zorg) * Deprecate installUpdatesIfAvailable (Zorg) + * Apply custom headers to app download (Geraint White) # 1.24.0