From cb42c9d38246aabf9f9b1e8c3916a7e96dde9228 Mon Sep 17 00:00:00 2001 From: Barijaona Ramaholimihaso Date: Mon, 1 May 2023 15:46:43 +0300 Subject: [PATCH] Improve release process - Switch to default location for project's derived data, as suggested in https://developer.apple.com/forums/thread/678974 to avoid slow resolution of package graphs; - Search Sparkle binaries in ${HOME}/Library/Developer/Xcode/DerivedData - Fix unfit localization of publication date in app feed; - Remove old scripts, clarify which scripts are used in project; - Make execution of scripts in "Prepare Upload" target independent of dependency analysis. --- Makefile | 1 - Release Instructions.md | 6 ++---- Scripts/Release-for-upload.sh | 6 +++--- Scripts/generate_keys.rb | 13 ------------- Scripts/sign_update.rb | 7 ------- Vienna.xcodeproj/project.pbxproj | 10 ++++++++++ 6 files changed, 15 insertions(+), 28 deletions(-) delete mode 100755 Scripts/generate_keys.rb delete mode 100755 Scripts/sign_update.rb diff --git a/Makefile b/Makefile index 680caa364d..aa3f669a6a 100644 --- a/Makefile +++ b/Makefile @@ -18,7 +18,6 @@ clean: xcodebuild -project $(PROJECT) -scheme Vienna -configuration Development clean xcodebuild -project $(PROJECT) -scheme Vienna -configuration Deployment clean rm -fr Build - rm -fr DerivedData localize: for locale in $(LOCALES); do \ diff --git a/Release Instructions.md b/Release Instructions.md index 94af430153..7af6a21e44 100644 --- a/Release Instructions.md +++ b/Release Instructions.md @@ -5,9 +5,7 @@ Instructions for building and uploading Vienna binaries to Github and Sourceforg ### Build settings In Xcode->File->Project settingsā€¦, you should have : -- Build System : New Build System -- Derived Data : Project-relative Location - - DerivedData +- Derived Data : Default Location - Advancedā€¦ : Build Location : Custom : Relative to Workspace - Products : Build/Products - Intermediates : Build/Intermediates.noindex @@ -86,7 +84,7 @@ There are two distinct ways to get the different files needed to publish an upda - Select the latest archive, click the "Distribute App" button, - Select "Developer ID" as method of distribution, - Accept the values proposed in the following prompts, -- Wait for the upload to finish, then a mail notification from Apple informing you that the software was successfully notarized, +- Wait for the upload to finish, then the message informing you that the software was successfully notarized, - Close the organizer, select scheme "Deployment" at the top of Xcode's main window, - Run the Deployment scheme, - The Uploads window should open in the Finder after a while. diff --git a/Scripts/Release-for-upload.sh b/Scripts/Release-for-upload.sh index e7fd32b8b7..b9f21fc97c 100755 --- a/Scripts/Release-for-upload.sh +++ b/Scripts/Release-for-upload.sh @@ -36,10 +36,10 @@ tar -a -cf "${TGZ_FILENAME}" --exclude '.DS_Store' Vienna.app rm -rf Vienna.app # Output the sparkle change log -SPARKLE_BIN="${SOURCE_ROOT}/DerivedData/Vienna/SourcePackages/artifacts/Sparkle/bin" +SPARKLE_BIN=$(find "${SDK_STAT_CACHE_DIR}" -regex "${SDK_STAT_CACHE_DIR}/${PROJECT}-.*/SourcePackages/artifacts/sparkle/Sparkle/bin") if [ ! -d "$SPARKLE_BIN" ]; then - printf 'Unable to locate Sparkle binaries in the binary Swift Package. ' 1>&2 + printf 'Unable to locate Sparkle binaries in DerivedData. ' 1>&2 printf 'Resolve the Swift Packages in Xcode first.\n' 1>&2 exit 1 fi @@ -66,7 +66,7 @@ export PATH="$SPARKLE_BIN/old_dsa_scripts:$PATH" DSA_SIGNATURE="sparkle:dsaSignature=\"$(sign_update "$TGZ_FILENAME" "$PRIVATE_KEY_PATH")\"" -pubDate="$(LC_TIME=en_US TZ=GMT date -jf '%FT%TZ' "${VCS_DATE}" '+%a, %d %b %G %T %z')" +pubDate="$(LC_ALL=en_US.UTF8 TZ=GMT date -jf '%FT%TZ' "${VCS_DATE}" '+%a, %d %b %G %T %z')" cat > "${VIENNA_CHANGELOG}" << EOF diff --git a/Scripts/generate_keys.rb b/Scripts/generate_keys.rb deleted file mode 100755 index b22439c7a8..0000000000 --- a/Scripts/generate_keys.rb +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/ruby -["dsaparam.pem", "dsa_priv.pem", "dsa_pub.pem"].each do |file| - if File.exist? file - puts "There's already a #{file} here! Move it aside or be more careful!" - end -end -`openssl dsaparam 2048 < /dev/urandom > dsaparam.pem` -`openssl gendsa dsaparam.pem -out dsa_priv.pem` -`openssl dsa -in dsa_priv.pem -pubout -out dsa_pub.pem` -`rm dsaparam.pem` -puts "\nGenerated private and public keys: dsa_priv.pem and dsa_pub.pem.\n -BACK UP YOUR PRIVATE KEY AND KEEP IT SAFE!\n -If you lose it, your users will be unable to upgrade!\n" \ No newline at end of file diff --git a/Scripts/sign_update.rb b/Scripts/sign_update.rb deleted file mode 100755 index 6d03e2ef0c..0000000000 --- a/Scripts/sign_update.rb +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/ruby -if ARGV.length < 2 - puts "Usage: ruby sign_update.rb update_archive private_key" - exit -end - -puts `openssl dgst -sha1 -binary < "#{ARGV[0]}" | openssl dgst -dss1 -sign "#{ARGV[1]}" | openssl enc -base64` \ No newline at end of file diff --git a/Vienna.xcodeproj/project.pbxproj b/Vienna.xcodeproj/project.pbxproj index 4b8c44e88d..a41b681306 100644 --- a/Vienna.xcodeproj/project.pbxproj +++ b/Vienna.xcodeproj/project.pbxproj @@ -98,6 +98,8 @@ 3A500129259A640D00AA6AAD /* ArticleStyleLoader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F2280372271B18A005D1023 /* ArticleStyleLoader.swift */; }; 3A50014E259AA2BE00AA6AAD /* WebKitArticleConverter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2FC4A18F257CF775005FF227 /* WebKitArticleConverter.swift */; }; 3A60E60B2114AD740004D81D /* URLRequestExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = 3A60E60A2114AD740004D81D /* URLRequestExtensions.m */; }; + 3A78208729FF534100570771 /* ArchivalChecks.sh in Resources */ = {isa = PBXBuildFile; fileRef = 3A78208629FF534100570771 /* ArchivalChecks.sh */; }; + 3A78208929FF536400570771 /* PostArchive.sh in Resources */ = {isa = PBXBuildFile; fileRef = 3A78208829FF536400570771 /* PostArchive.sh */; }; 3A7BD0DD1989AC7700E9444B /* VNAVerticallyCenteredTextFieldCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 3A7BD0DC1989AC7700E9444B /* VNAVerticallyCenteredTextFieldCell.m */; }; 3A8D9AE325A9DA4B0016F30F /* ArticleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A8D9AE225A9DA4B0016F30F /* ArticleTests.swift */; }; 3AB95743258DBC5A00C54E83 /* Browser.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2FDF6FC5218A26B0002F77E9 /* Browser.swift */; }; @@ -357,6 +359,8 @@ 3A60E6092114AD740004D81D /* URLRequestExtensions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = URLRequestExtensions.h; sourceTree = ""; }; 3A60E60A2114AD740004D81D /* URLRequestExtensions.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = URLRequestExtensions.m; sourceTree = ""; }; 3A6CC18623BBA49D0084ABEE /* Codesigning.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Codesigning.xcconfig; sourceTree = ""; }; + 3A78208629FF534100570771 /* ArchivalChecks.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = ArchivalChecks.sh; sourceTree = ""; }; + 3A78208829FF536400570771 /* PostArchive.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = PostArchive.sh; sourceTree = ""; }; 3A7BD0DB1989AC7700E9444B /* VNAVerticallyCenteredTextFieldCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VNAVerticallyCenteredTextFieldCell.h; sourceTree = ""; }; 3A7BD0DC1989AC7700E9444B /* VNAVerticallyCenteredTextFieldCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VNAVerticallyCenteredTextFieldCell.m; sourceTree = ""; }; 3A8D9AE225A9DA4B0016F30F /* ArticleTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ArticleTests.swift; sourceTree = ""; }; @@ -1207,7 +1211,9 @@ children = ( 2FE5DE71294641550089490B /* CombinePredicateTranslations */, 439824191666B37000FFE219 /* autorevision.sh */, + 3A78208629FF534100570771 /* ArchivalChecks.sh */, 3A5482F7168F5F4800887F91 /* Sparkle-setup.sh */, + 3A78208829FF536400570771 /* PostArchive.sh */, 4398241A1666B37000FFE219 /* Changes-and-Notes.sh */, 3ADBA70C23DDAFCA00156722 /* Notarize.sh */, 4398241C1666B37000FFE219 /* Release-for-upload.sh */, @@ -1874,12 +1880,14 @@ F6D572B41E26AA9900CDA909 /* InfoWindow.xib in Resources */, F6832F681F10F5DA007920D4 /* MainWindowController.xib in Resources */, 3A0F2A55258FBB8B0036397F /* TabbedBrowserViewController.xib in Resources */, + 3A78208729FF534100570771 /* ArchivalChecks.sh in Resources */, 3A0F2A9E258FCB780036397F /* BrowserTab.xib in Resources */, F6D572BA1E26AAA900CDA909 /* SearchFolder.xib in Resources */, F626F5F424A76B9100D3AAD8 /* Preferences.storyboard in Resources */, 3AEE7DE91695FC570018A17D /* SparkleDSAPublicKey.pem in Resources */, F6209C5A23D3FFA700D5537D /* Vienna.sdef in Resources */, F62580E71E286CEC0035E43C /* RSSSources.plist in Resources */, + 3A78208929FF536400570771 /* PostArchive.sh in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1982,6 +1990,7 @@ }; EAAF336614BEF4DF002A8837 /* Release For Upload */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); @@ -1997,6 +2006,7 @@ }; F6743B10224BB6980054FE1E /* Build Release Notes */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( );