Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release swift bindings #460

Merged
merged 9 commits into from
Jan 29, 2024
Merged

Conversation

cameronvoell
Copy link
Contributor

@cameronvoell cameronvoell commented Jan 26, 2024

Added a GH action for adding swift bindings to a GH Release.

Adding the binary artifacts to a release would allow xmtp-ios to reference our libxmtp FFI bindings without needing to use libxmtp-swift as a "middle man" repo (release artifacts can be referenced directly from Swift Package Manager). It turned out that we can not get rid of the libxmtp-swift repo because we still need the Source folder which is generated from libxmtp, and it is not possible to access that remotely from Swift Package Manager. However, if we hold on to libxmtp-swift, publishing the XCFramework as a release artifact in libxmtp does get us around having to use git-lfs in our libxmtp-swift which is important because it turns out Swift Package Manager does not work with git-lfs (although Cocoa Pods does fine with git-lfs, go figure!).

A "pre-release" will be generated from this branch that will be tested against xmtp-ios in order to validate that this strategy works for getting our static binary libxmtp FFI into xmtp-ios.

The checksum in the Release description is used for specifying a binary target in our libxmtp-swift Package.swift file (for Swift Package Manager). See: https://github.com/xmtp/libxmtp-swift/pull/4/files#diff-f913940c58e8744a2af1c68b909bb6383e49007e6c5a12fb03104a9006ae677e

See Related PRs:

@neekolas
Copy link
Contributor

neekolas commented Jan 26, 2024

How would this work with react-native's weird dependence on CocoaPods. My understanding is that libxmtp-swift is required for us to use libxmtp as a CocoaPod, and CocoaPods are required to use xmtp-ios as a dependency in RN projects.

@cameronvoell
Copy link
Contributor Author

How would this work with react-native's weird dependence on CocoaPods. My understanding is that libxmtp-swift is required for us to use libxmtp as a CocoaPod, and CocoaPods are required to use xmtp-ios as a dependency in RN projects.

@neekolas This is no longer relevant because we can not get rid of libxmtp-swift after all (see description update). Publishing the XCFramework binaries as a release artifact in libxmtp does get us around a constraint of git-lfs not working with Swift Package Manager though.

name: Release Swift Bindings

on:
workflow_dispatch:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the release swift bindings to just go on manual triggers for now.

*Note this can be triggered before this PR is merged to main using the gh cli:

gh workflow run workflow-name --ref branch-name

@cameronvoell cameronvoell merged commit 526cfc1 into nm/staticlib Jan 29, 2024
6 checks passed
@cameronvoell cameronvoell deleted the cv/release-swift-bindings branch January 29, 2024 16:15
cameronvoell added a commit that referenced this pull request Jan 29, 2024
* chore: gen protos

* refactor: rename mls publish to send and installation_id to installation_key

* chore: gen protos

* wip

* Add more query methods

* Add support for cursor based refresh state

* Make compiler happy

* Allow for different types of refresh_state

* Streaming support

* Add send trait

* Fix docker-compose file

* Remove comment

* Fmt

* Fix incorrect query

* Remove log statements

* Sleep longer to better handle races

* Update gen-protos

* Make flakey test less flakey

* Add more streaming tests

* Disable flakey test

* Use latest uniffi

* Switch to latest uniffi

* Merge in latest changes

* Move everything back to lib.rs

* Move back to separate files

* Try building in CI

* Fix reference to dylib

* Release swift bindings (#460)

* Correct order in swiftlocal makefile

* Added github action for adding zipped xcframework to github release on tag action

* Run on branch commits instead of tags

* Updated tag name to not begin with refs

* Run swift local only needs to copy over source now

* fix tag name, add license to release zip artifact

* Add step for calculating checksum for release description

* Fix SHA command and check LICENSE is copied as expected

* Updated to only fire from manual workflow dispatch for now

* Remove test branch from build action

---------

Co-authored-by: Steven Normore <[email protected]>
Co-authored-by: Cameron Voell <[email protected]>
Co-authored-by: cameronvoell <[email protected]>
@cameronvoell cameronvoell restored the cv/release-swift-bindings branch January 30, 2024 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants