Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ rust/crates/truapi-server/src/wasm/generated_bridge.rs linguist-generated=true
ios/truapi-host/Sources/TrUAPIHost/truapi*.swift linguist-generated=true
ios/truapi-host/Sources/TrUAPIHost/Resources/truapi-container.js linguist-generated=true
ios/truapi-host/Sources/truapi*FFI/include/** linguist-generated=true
ios/truapi-host/Sources/TrUAPIHost/pvm_runtime.swift linguist-generated=true
ios/truapi-host/Sources/pvm_runtimeFFI/include/** linguist-generated=true

ios/truapi-provider/Sources/TrUAPIProvider/truapi_provider.swift linguist-generated=true
ios/*-provider/Sources/*FFI/include/** linguist-generated=true
3 changes: 2 additions & 1 deletion .github/PULL_REQUEST_TEMPLATE/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

> [!IMPORTANT]
> The PR title must start with `release:` for the publish workflow to fire.
> Example: `release: @parity/truapi 0.5.0, @parity/truapi-host 0.2.0, @parity/ios-host 0.2.0, @parity/android-host 0.1.0`.
> Example: `release: @parity/truapi 0.5.0, @parity/truapi-host 0.2.0, @parity/pvm-browser-runtime 0.1.0, @parity/ios-host 0.2.0, @parity/android-host 0.1.0`.
> Don't rewrite the squash commit subject in the merge dialog — the
> `release:` prefix has to land on `main`.

Expand All @@ -16,6 +16,7 @@
- [ ] Ran `npm run version-packages` to consume the changeset
- [ ] `js/packages/truapi/package.json` version is bumped
- [ ] `js/packages/truapi-host/package.json` version is bumped when releasing the host
- [ ] `js/packages/pvm-browser-runtime/package.json` declares the requested browser-runtime version
- [ ] The PR title includes `@parity/ios-host <version>` when publishing the iOS host
- [ ] Regenerated iOS bindings and container outputs are committed; CI builds and simulator-tests the XCFramework, publishes it, then commits `Package.swift`
- [ ] The PR title includes `@parity/android-host <version>` when publishing the Android host AAR; nothing in the tree records that version, so there is no manifest to bump
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
# Trim whitespace around comma-separated targets.
target="${target#"${target%%[![:space:]]*}"}"
target="${target%"${target##*[![:space:]]}"}"
if [[ ! "${target}" =~ ^(@parity/truapi|@parity/truapi-host|@parity/ios-host|@parity/android-host)[[:space:]]+([^[:space:]]+)$ ]]; then
if [[ ! "${target}" =~ ^(@parity/truapi|@parity/truapi-host|@parity/pvm-browser-runtime|@parity/ios-host|@parity/android-host)[[:space:]]+([^[:space:]]+)$ ]]; then
echo "::error::Unsupported release target '${target}' in subject: ${subject}"
exit 1
fi
Expand All @@ -93,6 +93,7 @@ jobs:
cli_version="${declared_version}"
;;
@parity/truapi-host) path="js/packages/truapi-host" ;;
@parity/pvm-browser-runtime) path="js/packages/pvm-browser-runtime" ;;
@parity/ios-host)
if [[ ! "${declared_version}" =~ ^[0-9]+\.[0-9]+\.[0-9]+([+-][0-9A-Za-z.-]+)?$ ]]; then
echo "::error::Invalid iOS host version '${declared_version}'."
Expand Down Expand Up @@ -167,6 +168,7 @@ jobs:
uses: dtolnay/rust-toolchain@5b842231ba77f5c045dba54ac5560fed2db780e2 # stable
with:
toolchain: stable
targets: wasm32-unknown-unknown

- if: steps.version.outputs.proceed == 'true'
uses: Swatinem/rust-cache@f0d9c3887740aee45f6153b24b3a6b815192ec16 # v2
Expand All @@ -188,6 +190,9 @@ jobs:
npm run build --prefix js/packages/truapi-host
npm run build:wasm --prefix js/packages/truapi-host
fi
if grep -q '^@parity/pvm-browser-runtime|' <<< "${STEPS_VERSION_OUTPUTS_PACKAGES}"; then
npm run build --prefix js/packages/pvm-browser-runtime
fi
env:
STEPS_VERSION_OUTPUTS_PACKAGES: ${{ steps.version.outputs.packages }}

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,4 @@ js/packages/truapi/dist/generated/
js/packages/truapi-host/src/generated/
js/packages/truapi-host/dist/generated/
js/packages/truapi-host/dist/wasm/
js/packages/pvm-browser-runtime/dist/
160 changes: 156 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,9 @@ uniffi-kotlin: ## Regenerate Kotlin UniFFI bindings from the truapi-server cdyli
--language kotlin \
--out-dir $(UNIFFI_KOTLIN_OUT)

# Android ABIs to cross-compile the cdylib for. arm64 + armv7 cover physical
# devices; x86_64 covers the emulator on Intel/Apple-silicon hosts.
ANDROID_ABIS ?= arm64-v8a armeabi-v7a x86_64
# Android ABIs supported by both TrUAPI and PolkaVM. arm64 covers physical
# devices; x86_64 covers emulators. PolkaVM does not support 32-bit armv7.
ANDROID_ABIS ?= arm64-v8a x86_64
ANDROID_JNILIBS := android/truapi-host/src/main/jniLibs

android-jni: ## Cross-compile libtruapi_server.so for Android ABIs into jniLibs (needs cargo-ndk + NDK).
Expand Down Expand Up @@ -444,7 +444,8 @@ xcframework: uniffi ## Build truapi_server.xcframework for iOS device + simulato
rm -rf $(XCFRAMEWORK_OUT) $(XCFRAMEWORK_HEADERS)
mkdir -p $(XCFRAMEWORK_HEADERS)
cp $(UNIFFI_SWIFT_TMP)/truapiFFI.h $(UNIFFI_SWIFT_TMP)/truapi_platformFFI.h \
$(UNIFFI_SWIFT_TMP)/truapi_serverFFI.h $(XCFRAMEWORK_HEADERS)/
$(UNIFFI_SWIFT_TMP)/truapi_serverFFI.h $(UNIFFI_SWIFT_TMP)/pvm_runtimeFFI.h \
$(XCFRAMEWORK_HEADERS)/
cp $(UNIFFI_SWIFT_TMP)/truapi_serverFFI.modulemap $(XCFRAMEWORK_HEADERS)/module.modulemap
slices=""; \
for target in $(XCFRAMEWORK_TARGETS); do \
Expand Down
9 changes: 8 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,18 @@ let package = Package(
pkgConfig: nil,
providers: []
),
.systemLibrary(
name: "pvm_runtimeFFI",
path: "ios/truapi-host/Sources/pvm_runtimeFFI/include",
pkgConfig: nil,
providers: []
),
binaryTarget,
.target(
name: "TrUAPIHost",
dependencies: [
"truapiFFI", "truapi_platformFFI", "truapi_serverFFI", "truapi_serverFFI_binary",
"truapiFFI", "truapi_platformFFI", "truapi_serverFFI",
"pvm_runtimeFFI", "truapi_serverFFI_binary",
],
path: "ios/truapi-host/Sources/TrUAPIHost",
resources: [.copy("Resources/truapi-container.js")]
Expand Down
Loading