Skip to content

Commit 5efca9f

Browse files
authored
Merge pull request #22 from julepka/spm-xcf-support
Swift Package Manager support with xcframework
2 parents 0674511 + 70cbfcf commit 5efca9f

File tree

4 files changed

+49
-9
lines changed

4 files changed

+49
-9
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ include/openssl
1414
*.xcodeproj/project.xcworkspace
1515
*.xcodeproj/xcuserdata
1616
Pods
17+
.swiftpm/
1718

1819
# Cossack Labs packaging
1920
output

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ ifeq ($(GOAL),specs)
120120
@echo
121121
@echo " # The tag must contain the 'semversified' version of OpenSSL"
122122
@echo " # (e.g., $$(cat "$(OUTPUT)/version") instead of $(VERSION))"
123-
@echo " git tag -sem \"OpenSSL $(VERSION)\" v$$(cat "$(OUTPUT)/version")"
123+
@echo " git tag -sem \"OpenSSL $(VERSION)\" $$(cat "$(OUTPUT)/version")"
124124
@echo " git push --tags"
125125
@echo
126126
@echo "Finally, create a pre-release on GitHub from this tag:"

Package.swift

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// swift-tools-version:5.3
2+
// The swift-tools-version declares the minimum version of Swift required to build this package.
3+
4+
import PackageDescription
5+
6+
let package = Package(
7+
name: "cl-openssl",
8+
products: [
9+
.library(
10+
name: "cl-openssl",
11+
targets: ["openssl"]),
12+
],
13+
dependencies: [],
14+
targets: [
15+
.binaryTarget(name: "openssl",
16+
// update version in URL path
17+
url:"https://github.com/cossacklabs/openssl-apple/releases/download/1.1.10803/openssl-static-xcframework.zip",
18+
// Run from package directory:
19+
// swift package compute-checksum output/openssl-static-xcframework.zip
20+
checksum: "dd884d18e49fd46a4df2757b57b3862003b8bf12bd792459bef20e68ccacb9d5"),
21+
]
22+
)

RELEASING.md

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ How to update to newer OpenSSL version, build, and publish a release.
2424

2525
4. **Build OpenSSL.**
2626

27+
To build from scratch - remove output folder.
28+
2729
```shell
2830
make
2931
```
@@ -32,37 +34,52 @@ How to update to newer OpenSSL version, build, and publish a release.
3234
Not only it builds the library, this also packages it,
3335
and updates the project specs.
3436

35-
5. **Commit, tag, push the release.**
37+
5. **Update SPM package settings**
38+
39+
In the [`Package.swift`](Package.swift) file
40+
update binary framework link with the upcoming version (semver format)
41+
https://github.com/cossacklabs/openssl-apple/releases/download/1.1.10701/openssl-static-xcframework.zip
42+
43+
Also, update xcframework checksum.
44+
45+
```shell
46+
swift package compute-checksum output/openssl-static-xcframework.zip
47+
```
48+
49+
6. **Commit, tag, push the release.**
50+
51+
Tag should be in a semver format.
3652

3753
```shell
3854
git add carthage
55+
git add Package.swift
3956
git commit -S -e -m "OpenSSL 1.1.1g"
40-
git tag -s -e -m "OpenSSL 1.1.1g" v1.1.10701
57+
git tag -s -e -m "OpenSSL 1.1.1g" 1.1.10701
4158
git push origin cossacklabs # Push the branch
42-
git push origin v1.1.10701 # Push the tag
59+
git push origin 1.1.10701 # Push the tag
4360
```
4461

4562
Make will remind you how to do this.
4663
(Use the correct versions there.)
4764
Take care to make signed commits and tags, this is important for vanity.
4865

4966
Congratulations!
50-
You have just published a broken Carthage package.
67+
You have just published broken Carthage and SPM packages :)
5168

52-
6. **Publish GitHub release with binary framework files.**
69+
7. **Publish GitHub release with binary framework files.**
5370

5471
Go to GitHub release page for the tag:
5572

56-
https://github.com/cossacklabs/openssl-apple/releases/tag/v1.1.107
73+
https://github.com/cossacklabs/openssl-apple/releases/tag/1.1.107
5774

5875
press **Edit tag** and upload `*.zip` packages from `output` directory.
5976

6077
Also, describe the release, press the **Publish release** when done.
6178

6279
Congratulations!
63-
You should have fixed the Carthage package with this.
80+
You should have fixed the Carthage and SPM packages with this.
6481

65-
7. **Publish podspec.**
82+
8. **Publish podspec.**
6683

6784
```shell
6885
pod trunk push cocoapods/CLOpenSSL.podspec

0 commit comments

Comments
 (0)