You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+24-26Lines changed: 24 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,18 @@ a format understood by the Swift package manager, and depends on a pre-compiled
6
6
binary release of the underlying Rust code published from [mozilla/application-services](
7
7
https://github.com/mozilla/application-service).
8
8
9
+
**This repository is mostly updated by automation, all the logic is copied from [mozilla/application-services](
10
+
https://github.com/mozilla/application-service)**
11
+
12
+
## Overview
13
+
14
+
* The `application-services` repo publishes two binary artifacts `MozillaRustComponents.xcframework.zip` and `FocusRustComponents.xcframework.zip` containing
15
+
the Rust code and FFI definitions for all components, compiled together into a single library.
16
+
* The `Package.swift` file refrences the xcframeworks as Swift binary targets.
17
+
* The `Package.swift` file defines a library per target (one for all the components used by `firefox-ios` and one for `focus-ios`)
18
+
* Each library references its Swift source code directly as files in the repo. All components used by a target are copied into the same directory. For example, all the `firefox-ios` files are in the `swift-source/all` directory.
19
+
* Each library depends on wrapper which wraps the binary to provide the pre-compiled Rust code. For example, [`FocusRustComponentWrapper`](./FocusRustComponentsWrapper/) wraps the Focus xcframework.
@@ -15,43 +27,29 @@ For more information, please consult:
15
27
* The [`ios-rust` crate](https://github.com/mozilla/application-services/tree/main/megazords/ios-rust) which is currently
16
28
responsible for publishing the pre-built `MozillaRustComponents.xcframework.zip` and `FocusRustComponents.xcframework.zip` bundles on which this repository depends.
17
29
18
-
## Overview
19
-
20
-
Here's a diagram of how this repository relates to the application-services repository
21
-
and its release artifacts:
22
-
23
-
<!--
24
-
N.B. you can edit this image in Google Docs and changes will be reflected automatically:
<imgsrc="https://docs.google.com/drawings/d/e/2PACX-1vRnyxy7VjdD3bYTso8V3AL5FpIQ4_S54dOCDI6fxfZEbG3_CVBwZZP1uLYbUVE9M54GSXUkNgewzOQm/pub?w=720&h=540"width="720"height="540"alt="A box diagram describing how the rust-components-swift repo, applicaiton-services repo, and MozillaRustComponents XCFramework interact">
31
+
## Releases
32
+
### Nightly
29
33
30
-
Key points:
34
+
Nightly releases are automated and run every night as a cron job that pushes directly to the main branch. Nightly releases are tagged with three components (i.e `X.0.Y`) where the first component is the current Firefox release (i.e `117`, etc) and the last component is a timestamp.
31
35
32
-
* The `application-services` repo publishes two binary artifacts `MozillaRustComponents.xcframework.zip` and `FocusRustComponents.xcframework.zip` containing
33
-
the Rust code and FFI definitions for all components, compiled together into a single library.
34
-
* The `Package.swift` file refrences the xcframeworks as Swift binary targets.
35
-
* The `Package.swift` file defines a library per target (one for all the components used by `firefox-ios` and one for `focus-ios`)
36
-
* Each library references its Swift source code directly as files in the repo. All components used by a target are copied into the same directory. For example, all the `firefox-ios` files are in the `swift-source/all` directory.
37
-
* Each library depends on wrapper which wraps the binary to provide the pre-compiled Rust code. For example, [`FocusRustComponentWrapper`](./FocusRustComponentsWrapper/) wraps the Focus xcframework.
36
+
Note that we need three components because that's a Swift Package manager requirement.
38
37
39
-
## Cutting a new release
38
+
###Cutting a Release
40
39
41
-
Whenever a new release of the underlying components is availble, we need to tag a new release
42
-
in this repo to make them available to Swift components. To do so:
40
+
To cut a release of `rust-components-swift`, you will need to do the following:
41
+
- Run `./automation/update-from-application-services.py <X.Y>`, where `X.Y` is the version of application services.
42
+
- Open a pull request with the resulting changes
43
+
- Once landed on the main branch, cut a release using the GitHub UI and tag it
44
+
-**IMPORTANT**: The release tag must be in the form `X.0.Y`, where `X.Y` is the version of application services
43
45
44
-
* Edit `Package.swift` to update the URL and checksum of `MozillaRustComponents.xcframework.zip`.
45
-
* Run `./make_tag.sh --as-version {APP_SERVICES_VERSION} X.Y.Z` to create the new tag.
46
-
* Run `git push origin X.Y.Z` to publish it to GitHub.
46
+
## Testing and Local development
47
+
To enable local development of `rust-component-swift` read the instructions [documented in application services](https://mozilla.github.io/application-services/book/howtos/locally-published-components-in-firefox-ios.html)
47
48
48
49
## Adding a new component
49
50
50
51
Check out the instructions in the [docs in `application-services` for adding a new component and publishing it for iOS](https://github.com/mozilla/application-services/blob/main/docs/howtos/adding-a-new-component.md#distribute-your-component-with-rust-components-swift). The docs are also published for convenience in <https://mozilla.github.io/application-services/book/index.html>.
51
52
52
53
53
-
## Testing
54
-
For testing instructions, you can checkout the [docs in the `application-services`](https://github.com/mozilla/application-services/tree/main/docs/howtos) which are published for convenience in <https://mozilla.github.io/application-services/book/index.html>
55
-
56
54
## Filing issues with rust-components-swift
57
55
Please open a ticket in https://github.com/mozilla/application-services/issues for any rust-component-swift related issues.
0 commit comments