Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
aa17868
[ARK Drop] Enhancements and TUI (#106)
oluiscabral Oct 30, 2025
cd3d1cd
style: run rustfmt
oluiscabral Nov 5, 2025
ee73ac5
fix: remove blocking tests
oluiscabral Nov 6, 2025
36147cb
feat: swift bindings
oluiscabral Nov 5, 2025
8f6e50d
test: temp remove arkdrop tests
oluiscabral Nov 6, 2025
3d8d806
fix: import Profile from arkdrop-common
oluiscabral Nov 6, 2025
0c49e2c
fix: run_receive_files docs
oluiscabral Nov 6, 2025
f77590d
fix: arkdrop_common::Profile import
oluiscabral Nov 6, 2025
f3fd05d
fix: incorrect string substitution
oluiscabral Nov 6, 2025
9249c89
ci: fix compilation error
oluiscabral Nov 6, 2025
e5d7261
fix: build staticlib
oluiscabral Nov 6, 2025
b43b91e
fix: iOS target built as lib
oluiscabral Nov 6, 2025
b944a2c
fix: use workspace root dir
oluiscabral Nov 7, 2025
72678f1
ci: debugging drop.swift output path
oluiscabral Nov 7, 2025
126be80
fix: incorrect swift bindings name
oluiscabral Nov 7, 2025
834b3a1
fix(ci): Swift Package Source
oluiscabral Nov 7, 2025
75b5eb4
fix(ci): include Package.swift
oluiscabral Nov 7, 2025
65bbc78
ci: use uniffi-bindgen-swift
oluiscabral Nov 7, 2025
4531db6
ci: swift bindings with modulemap and readme
oluiscabral Nov 8, 2025
0c76293
ci: properly generate the swift bindnigs
oluiscabral Nov 8, 2025
f1cd845
ci: fix target dir
oluiscabral Nov 8, 2025
71d755d
ci: fix modulemap name
oluiscabral Nov 8, 2025
e46d8fd
Merge remote-tracking branch 'origin/main' into d/swift-bindings
oluiscabral Jan 1, 2026
2640ace
Bump version of drop-core/uniffi to 1.2.0
kirillt Jan 7, 2026
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
229 changes: 229 additions & 0 deletions .github/workflows/arkdrop-swift-bindings-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,229 @@
name: ARK Drop Swift Bindings Release

on:
push:
paths:
- "drop-core/entities/**"
- "drop-core/exchanges/**"
- "drop-core/uniffi/**"
- ".github/workflows/arkdrop-swift-bindings-release.yml"
workflow_dispatch:

jobs:
build-and-publish:
runs-on: macos-latest
permissions:
contents: write
packages: write

steps:
- uses: actions/checkout@v4

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: aarch64-apple-ios,x86_64-apple-ios,aarch64-apple-ios-sim,x86_64-apple-darwin,aarch64-apple-darwin

- name: Verify Rust targets
run: |
rustup target list --installed
echo "Verifying targets are installed..."
for target in aarch64-apple-ios x86_64-apple-ios aarch64-apple-ios-sim x86_64-apple-darwin aarch64-apple-darwin; do
if rustup target list --installed | grep -q "$target"; then
echo "✓ $target is installed"
else
echo "✗ $target is NOT installed"
rustup target add "$target"
fi
done

- uses: Swatinem/rust-cache@v2
with:
workspaces: drop-core/uniffi

- name: Install Xcode Command Line Tools
run: |
xcode-select --install 2>/dev/null || true
xcode-select -p

- name: Generate Swift Bindings
working-directory: ./drop-core/uniffi/bindings/swift
run: |
chmod +x generate-bindings.sh
./generate-bindings.sh
env:
RUST_BACKTRACE: 1

- name: Verify Generated Bindings
working-directory: ./drop-core/uniffi/bindings/swift
run: |
echo "Checking generated files..."
ls -la
echo ""
echo "Required files check:"
for file in ArkDrop.swift arkdrop_uniffiFFI.h module.modulemap; do
if [ -f "$file" ]; then
echo "✓ $file exists"
echo " Size: $(wc -c < "$file") bytes"
else
echo "✗ $file missing!"
exit 1
fi
done

- name: Build XCFramework
working-directory: ./drop-core/uniffi/bindings/swift
run: |
chmod +x build-xcframework.sh
./build-xcframework.sh
env:
RUST_BACKTRACE: 1

- name: Create Swift Package Archive
working-directory: ./drop-core/uniffi/bindings/swift
run: |
echo "Creating distributable Swift package..."

# Create package directory structure
mkdir -p ArkDrop-Swift-Package
mkdir -p ArkDrop-Swift-Package/Sources/ArkDrop

# Verify all required files exist before copying
echo "Verifying files before packaging..."
for file in arkdrop_uniffiFFI.xcframework ArkDrop.swift Package.swift arkdrop_uniffiFFI.h module.modulemap; do
if [ ! -e "$file" ]; then
echo "ERROR: Required file missing: $file"
exit 1
fi
done

# Copy XCFramework
echo "Copying XCFramework..."
cp -r arkdrop_uniffiFFI.xcframework ArkDrop-Swift-Package/

# Copy Swift source to Sources directory
echo "Copying Swift bindings..."
cp ArkDrop.swift ArkDrop-Swift-Package/Sources/ArkDrop/

# Copy Package.swift
echo "Copying Package.swift..."
cp Package.swift ArkDrop-Swift-Package/

# Copy header and modulemap for reference
echo "Copying headers and modulemap..."
cp arkdrop_uniffiFFI.h ArkDrop-Swift-Package/
cp module.modulemap ArkDrop-Swift-Package/

# Create README with usage instructions
cat > ArkDrop-Swift-Package/README.md << 'EOF'
# ArkDrop Swift Bindings

This package contains Swift bindings for ARK Drop.

## Contents

- `arkdrop_uniffiFFI.xcframework` - Pre-built XCFramework for iOS and macOS
- `Sources/ArkDrop/ArkDrop.swift` - Swift bindings generated by UniFFI
- `Package.swift` - Swift Package Manager configuration
- `arkdrop_uniffiFFI.h` - C header file (reference)
- `module.modulemap` - Module map (reference)

## Installation

### Swift Package Manager

Add to your `Package.swift`:

```swift
dependencies: [
.package(path: "path/to/ArkDrop-Swift-Package")
]
```

Or add the extracted package directory to your Xcode project via:
File → Add Package Dependencies → Add Local...

## Usage

Import the module in your Swift code:

```swift
import ArkDrop
```
EOF

# List package contents
echo ""
echo "Package contents:"
find ArkDrop-Swift-Package -type f | sort

# Create a zip archive
echo ""
echo "Creating archive..."
zip -r ArkDrop-Swift-Package.zip ArkDrop-Swift-Package/

# Create checksum
echo "Creating checksum..."
shasum -a 256 ArkDrop-Swift-Package.zip > ArkDrop-Swift-Package.zip.sha256

echo ""
echo "Package created successfully!"
cat ArkDrop-Swift-Package.zip.sha256

- name: Upload Build Artifacts
uses: actions/upload-artifact@v4
with:
name: swift-bindings
path: |
drop-core/uniffi/bindings/swift/ArkDrop-Swift-Package.zip
drop-core/uniffi/bindings/swift/ArkDrop-Swift-Package.zip.sha256
retention-days: 30

- name: Create Release
if: github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/'))
uses: softprops/action-gh-release@v2
with:
tag_name: swift-bindings-${{ github.run_id }}
name: Swift Bindings Release ${{ github.run_id }}
draft: false
prerelease: false
files: |
drop-core/uniffi/bindings/swift/ArkDrop-Swift-Package.zip
drop-core/uniffi/bindings/swift/ArkDrop-Swift-Package.zip.sha256
body: |
## Swift Bindings for ARK Drop

This release contains the Swift bindings for ARK Drop, including:
- XCFramework for iOS (device and simulator) and macOS
- Swift source files
- Swift Package Manager configuration

### Installation

#### Swift Package Manager

1. Download and extract `ArkDrop-Swift-Package.zip`
2. Add the package to your Xcode project or include it in your `Package.swift`:

```swift
dependencies: [
.package(path: "path/to/ArkDrop-Swift-Package")
]
```

#### Manual Installation

1. Download `ArkDrop-Swift-Package.zip`
2. Extract and add `arkdrop_uniffiFFI.xcframework` to your Xcode project
3. Add `drop.swift` to your project sources

### Verification

Verify the package integrity using the SHA256 checksum:
```bash
shasum -a 256 -c ArkDrop-Swift-Package.zip.sha256
```

Generated from commit: ${{ github.sha }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9 changes: 7 additions & 2 deletions drop-core/uniffi/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
[package]
name = "arkdrop-uniffi"
version = "1.1.0"
version = "1.2.0"
edition = "2024"

[lib]
name = "arkdrop_uniffi"
crate-type = ["cdylib"]
crate-type = ["staticlib", "cdylib"]
bench = false

[[bin]]
name = "uniffi-bindgen"
path = "uniffi-bindgen.rs"
bench = false

[[bin]]
name = "uniffi-bindgen-swift"
path = "uniffi-bindgen-swift.rs"
bench = false

[dependencies]
arkdropx-sender = { path = "../exchanges/sender" }
arkdropx-receiver = { path = "../exchanges/receiver" }
Expand Down
21 changes: 21 additions & 0 deletions drop-core/uniffi/bindings/swift/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Build artifacts
build/
*.xcframework

# Generated files from uniffi-bindgen
ArkDrop.swift
arkdrop_uniffiFFI.h
module.modulemap
arkdrop_uniffiFFI.modulemap

# Swift Package Manager
.build/
.swiftpm/

# Xcode
xcuserdata/
*.xcworkspace
DerivedData/

# macOS
.DS_Store
29 changes: 29 additions & 0 deletions drop-core/uniffi/bindings/swift/Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// swift-tools-version: 5.9
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "ArkDrop",
platforms: [
.iOS(.v13),
.macOS(.v10_15)
],
products: [
.library(
name: "ArkDrop",
targets: ["ArkDrop"]
),
],
targets: [
.target(
name: "ArkDrop",
dependencies: ["arkdrop_uniffiFFI"],
path: "Sources"
),
.binaryTarget(
name: "arkdrop_uniffiFFI",
path: "arkdrop_uniffiFFI.xcframework"
)
]
)
Loading
Loading