Skip to content

Commit

Permalink
Merge pull request #22 from julepka/spm-xcf-support
Browse files Browse the repository at this point in the history
Swift Package Manager support with xcframework
  • Loading branch information
julepka authored Apr 27, 2021
2 parents 0674511 + 70cbfcf commit 5efca9f
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ include/openssl
*.xcodeproj/project.xcworkspace
*.xcodeproj/xcuserdata
Pods
.swiftpm/

# Cossack Labs packaging
output
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ ifeq ($(GOAL),specs)
@echo
@echo " # The tag must contain the 'semversified' version of OpenSSL"
@echo " # (e.g., $$(cat "$(OUTPUT)/version") instead of $(VERSION))"
@echo " git tag -sem \"OpenSSL $(VERSION)\" v$$(cat "$(OUTPUT)/version")"
@echo " git tag -sem \"OpenSSL $(VERSION)\" $$(cat "$(OUTPUT)/version")"
@echo " git push --tags"
@echo
@echo "Finally, create a pre-release on GitHub from this tag:"
Expand Down
22 changes: 22 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// swift-tools-version:5.3
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "cl-openssl",
products: [
.library(
name: "cl-openssl",
targets: ["openssl"]),
],
dependencies: [],
targets: [
.binaryTarget(name: "openssl",
// update version in URL path
url:"https://github.com/cossacklabs/openssl-apple/releases/download/1.1.10803/openssl-static-xcframework.zip",
// Run from package directory:
// swift package compute-checksum output/openssl-static-xcframework.zip
checksum: "dd884d18e49fd46a4df2757b57b3862003b8bf12bd792459bef20e68ccacb9d5"),
]
)
33 changes: 25 additions & 8 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ How to update to newer OpenSSL version, build, and publish a release.
4. **Build OpenSSL.**
To build from scratch - remove output folder.
```shell
make
```
Expand All @@ -32,37 +34,52 @@ How to update to newer OpenSSL version, build, and publish a release.
Not only it builds the library, this also packages it,
and updates the project specs.
5. **Commit, tag, push the release.**
5. **Update SPM package settings**
In the [`Package.swift`](Package.swift) file
update binary framework link with the upcoming version (semver format)
https://github.com/cossacklabs/openssl-apple/releases/download/1.1.10701/openssl-static-xcframework.zip
Also, update xcframework checksum.
```shell
swift package compute-checksum output/openssl-static-xcframework.zip
```
6. **Commit, tag, push the release.**
Tag should be in a semver format.
```shell
git add carthage
git add Package.swift
git commit -S -e -m "OpenSSL 1.1.1g"
git tag -s -e -m "OpenSSL 1.1.1g" v1.1.10701
git tag -s -e -m "OpenSSL 1.1.1g" 1.1.10701
git push origin cossacklabs # Push the branch
git push origin v1.1.10701 # Push the tag
git push origin 1.1.10701 # Push the tag
```
Make will remind you how to do this.
(Use the correct versions there.)
Take care to make signed commits and tags, this is important for vanity.
Congratulations!
You have just published a broken Carthage package.
You have just published broken Carthage and SPM packages :)
6. **Publish GitHub release with binary framework files.**
7. **Publish GitHub release with binary framework files.**
Go to GitHub release page for the tag:
https://github.com/cossacklabs/openssl-apple/releases/tag/v1.1.107
https://github.com/cossacklabs/openssl-apple/releases/tag/1.1.107
press **Edit tag** and upload `*.zip` packages from `output` directory.
Also, describe the release, press the **Publish release** when done.
Congratulations!
You should have fixed the Carthage package with this.
You should have fixed the Carthage and SPM packages with this.
7. **Publish podspec.**
8. **Publish podspec.**
```shell
pod trunk push cocoapods/CLOpenSSL.podspec
Expand Down

0 comments on commit 5efca9f

Please sign in to comment.