@@ -15,7 +15,24 @@ How to update to newer OpenSSL version, build, and publish a release.
1515 Increment ` PACKAGE_VERSION ` if you are repackaging the same OpenSSL version.
1616 Otherwise, update ` VERSION ` to OpenSSL version and reset ` PACKAGE_VERSION ` to ` 1 ` .
1717
18+ ```
19+ ## OpenSSL version to build
20+ VERSION ?= 1.1.1v
21+ ## Extra version of the distributed package
22+ PACKAGE_VERSION ?= 1
23+ ```
24+
1825 Also update tarball checksums in [ ` build-libssl.sh ` ] ( build-libssl.sh ) .
26+ ```
27+ # Default version in case no version is specified
28+ # Official checksums available at https://www.openssl.org/source/
29+ DEFAULTVERSION="1.1.1u"
30+ OPENSSL_CHECKSUMS="
31+ 1.1.1k 892a0875b9872acd04a9fde79b1f943075d5ea162415de3047c327df33fbaee5
32+ 1.1.1u e2f8d84b523eecd06c7be7626830370300fbcc15386bf5142d72758f6963ebc6
33+ 1.1.1v d6697e2871e77238460402e9362d47d18382b15ef9f246aba6c7bd780d38a6b0
34+ "
35+ ```
1936
20373 . ** Update platform configuration.**
2138
@@ -27,37 +44,87 @@ How to update to newer OpenSSL version, build, and publish a release.
2744 To build from scratch - remove output folder.
2845
2946 ``` shell
30- make
47+ make clean && make
3148 ```
3249
3350 This can take a while.
3451 Not only it builds the library, this also packages it,
3552 and updates the project specs.
3653
54+ Check the cocoapods/CLOpenSSL-XCF.podspec. It have to be created from podpec.template file with actual version, hash and filenames.
55+
56+ Note: semversioned number of framework is taken from ``` frameworks/MacOSX/openssl.framework ``` .
57+
58+
37595 . ** Update SPM package settings**
3860
3961 Update [`Package.swift`](Package.swift) file with the new URL of the binary framework and its checksum:
4062
4163 ``` swift
4264 .binaryTarget (name : " openssl" ,
4365 // update version in URL path
44- url :" https://github.com/cossacklabs/openssl-apple/releases/download/1.1.10701 /openssl-static-xcframework.zip" ,
66+ url :" https://github.com/cossacklabs/openssl-apple/releases/download/1.1.12201 /openssl-static-xcframework.zip" ,
4567 // Run from package directory:
4668 // swift package compute-checksum output/openssl-static-xcframework.zip
47- checksum : " 77b9a36297a2cade7bb6db5282570740a2af7b1e5083f126f46ca2671b14d73e" ),
69+ checksum : " a3363e4297428d2497c481791f6ac3c17c118b6829ee6246781efe0a3593ae16" ),
70+ ```
71+ Remember: actual version you can see in output/version file. It is created by authors of the OpenSSL library.
72+
73+ 6 . ** Update the Carthage package settings and prepare the copy of files**
74+ During the 'make' process, the scripts in the 'scripts' folder had to update the json files in the carthage folder. Check it out.
75+
76+ ` cat carthage/openssl-dynamic-framework.json `
77+ ```
78+ {
79+ "1.1.12201": "https://github.com/cossacklabs/openssl-apple/releases/download/1.1.12201/openssl-dynamic-xcframework.zip",
80+ "1.1.12101": "https://github.com/cossacklabs/openssl-apple/releases/download/1.1.12101/openssl-dynamic-xcframework.zip",
81+ "1.1.11101": "https://github.com/cossacklabs/openssl-apple/releases/download/1.1.11101/openssl-dynamic-xcframework.zip",
82+ "1.1.10803": "https://github.com/cossacklabs/openssl-apple/releases/download/1.1.10803/openssl-dynamic-xcframework.zip",
83+ }
84+ ```
85+
86+ ` cat carthage/openssl-static-framework.json `
87+ ```
88+ rad@Oleksiis-M1-2021 ~/g/p/t/openssl-apple (openssl-1.1.1v)> cat carthage/openssl-static-xcframework.json
89+ {
90+ "1.1.12201": "https://github.com/cossacklabs/openssl-apple/releases/download/1.1.12201/openssl-static-xcframework.zip",
91+ "1.1.12101": "https://github.com/cossacklabs/openssl-apple/releases/download/1.1.12101/openssl-static-xcframework.zip",
92+ "1.1.11101": "https://github.com/cossacklabs/openssl-apple/releases/download/1.1.11101/openssl-static-xcframework.zip",
93+ "1.1.10803": "https://github.com/cossacklabs/openssl-apple/releases/download/1.1.10803/openssl-static-xcframework.zip",
94+ }
95+ ```
96+
97+ Also carthage will use files with the name that contain ".xcframework". So, you need to copy files in output directory to corresponding names.
98+ ` openssl-dynamic-xcframework.zip ` to ` openssl-dynamic.xcframework.zip ` .
99+ And ` openssl-static-xcframework.zip ` to ` openssl-static.xcframework.zip `
100+ You will upload these files later into the release.
101+
102+ 7 . ** Cocoapods podspec**
103+ During the 'make' process scripts had to generate new podspec file from the template located in 'cocoapods' directory.
104+ So, you will see the new file: CLOpenSSL-XCF.podspec
105+ Check it out. You have to see newly created version and hash checksum in the body of the file.
48106 ```
107+ openssl_version = "1.1.12201"
108+ XCFramework_archive_hash = "bc9d20b7e4369b3cec2f30115e455f610c9d61aefc569676805b006d83e77944"
109+ ```
110+
111+ You can compare the hash with the result of command ` swift package compute-checksum output/openssl-dynamic-xcframework.zip `
112+ It should be equal.
113+ openssl_version have to be equal to ` cat output/version `
114+
115+ 8 . ** Commit, tag, push the release.**
49116
50- 6 . ** Commit, tag, push the release. **
117+ Commit the changes. Changes must contain new version settings, SPM, Carthage, and Cocoapods updates. Optionally, other files.
51118
52- Tag should be in a semver format.
119+ Tag should be in a semver format. Do not add cocoapods/CLOpenSSL-XCF.podspec to the git. It is generated every time.
53120
54121 ``` shell
55122 git add carthage
56123 git add Package.swift
57- git commit -S -e -m " OpenSSL 1.1.1g "
58- git tag -s -e -m " OpenSSL 1.1.1g " 1.1.10701
124+ git commit -S -e -m " OpenSSL 1.1.1v "
125+ git tag -s -e -m " OpenSSL 1.1.1v " 1.1.12201
59126 git push origin cossacklabs # Push the branch
60- git push origin 1.1.10701 # Push the tag
127+ git push origin 1.1.12201 # Push the tag
61128 ```
62129
63130 Make will remind you how to do this.
@@ -67,23 +134,24 @@ How to update to newer OpenSSL version, build, and publish a release.
67134 Congratulations!
68135 You have just published broken Carthage and SPM packages :)
69136
70- 7 . ** Publish GitHub release with binary framework files.**
137+ 9 . ** Publish GitHub release with binary framework files.**
71138
72139 Go to GitHub release page for the tag:
73140
74- https://github.com/cossacklabs/openssl-apple/releases/tag/1.1.107
141+ https://github.com/cossacklabs/openssl-apple/releases/tag/1.1.12201
75142
76- press ** Edit tag** and upload ` *.zip ` packages from ` output ` directory.
143+ press ** Edit tag** and upload ` *.zip ` packages from ` output ` directory. Do not forget to upload also .xcframework.zip files too. It is important for carthage binary prebuilt scheme.
77144
78145 Also, describe the release, press the ** Publish release** when done.
79146
80147 Congratulations!
81148 You should have fixed the Carthage and SPM packages with this.
82149
83- 8 . ** Publish podspec.**
150+ 10 . ** Publish podspec.**
84151
85152 ``` shell
86- pod trunk push cocoapods/CLOpenSSL.podspec
153+ pod spec lint
154+ pod trunk push cocoapods/CLOpenSSL-XCF.podspec
87155 ```
88156
89157 This lints the podspec before publishing it.
@@ -94,4 +162,49 @@ How to update to newer OpenSSL version, build, and publish a release.
94162
95163Actually, you have published all of the OpenSSL.
96164Now is the time to go check if it * actually* works.
165+
97166You can use [ Themis] ( https://github.com/cossacklabs/themis ) for that.
167+
168+ 11 . ** Test the CLOpenSSL-XCF release**
169+
170+ ##### SPM
171+
172+ 1 . Create a new Xcode project.
173+ 2 . Add the package from the URL: https://github.com/cossacklabs/openssl-apple
174+ 3 . Select the exact version (Which you released recently)
175+ 4 . Compile and run project (Build, Archive)
176+
177+ ##### Carthage
178+ 1 . Create a new Xcode project
179+ 2 . Create Cartfile near the .xcodeproj or .xcworkspace file
180+ 3 . Add similar content
181+ ```
182+ “github "cossacklabs/openssl-apple" ~> 1.1.12201
183+ ```
184+
185+ Run
186+
187+ ```
188+ carthage update --use-xcframeworks
189+ ```
190+
191+ 4 . Drag the downloaded ` .xcframework ` bundles from ` Carthage/Build ` into the "Frameworks and Libraries" section of your application’s Xcode project.
192+
193+ ##### Cocoapods
194+ 1 . Create new Xcode project
195+ 2 . run pod init from the root of the project
196+ 3 . Add
197+
198+ ``` bash
199+ pod ' CLOpenSSL-XCF'
200+ ```
201+
202+ 4. Run
203+
204+ ` ` ` bash
205+ pod install
206+ ` ` `
207+
208+ Open .xcworkspace file and run test the project
209+
210+
0 commit comments