Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
9b8dfea
let's see what claude can do
Oct 31, 2025
91c2e80
more robust
Nov 3, 2025
88817c6
clippy
Nov 3, 2025
9e54c19
remove generated mobile code
Nov 3, 2025
5669d37
use walletkit structure
Nov 3, 2025
3377b14
more like idkit-rs
Nov 3, 2025
72e04ba
doc updates
Nov 3, 2025
cc9fabe
Merge origin/main into full-implementation (accepting main as source …
Nov 4, 2025
6971569
rebase
Nov 4, 2025
be6b262
simpler
Nov 4, 2025
b933520
doc updates
Nov 4, 2025
0edef22
js wasm progress
Nov 6, 2025
9dbc79f
js impl
Nov 6, 2025
8501485
Merge remote-tracking branch 'origin/main' into language-bindings-swi…
Nov 6, 2025
806adcc
simpler
Nov 6, 2025
dbc30e4
remove deprecated cred type
Nov 6, 2025
fa0c7bc
more drop in
Nov 6, 2025
8f434a5
updates to match api
Nov 6, 2025
986e2e8
ci
Nov 6, 2025
e652b19
Potential fix for code scanning alert no. 1: Workflow does not contai…
decentralgabe Nov 6, 2025
5d96902
Potential fix for code scanning alert no. 2: Workflow does not contai…
decentralgabe Nov 6, 2025
4012ede
remove old tests
Nov 6, 2025
8906a98
formatting
Nov 6, 2025
b77b0c5
smoke tests
Nov 6, 2025
ed9803e
update
Nov 6, 2025
7e87e9e
update ci
Nov 6, 2025
17edff3
add swift
Nov 6, 2025
6198e8b
remove js
Nov 6, 2025
5cd3cc1
update ci
Nov 6, 2025
96a3c2d
fix ci; pr comments
Nov 6, 2025
284a7f4
pr feedback wip
Nov 6, 2025
79dede9
update tests'
Nov 6, 2025
995ee6f
match existing api
Nov 6, 2025
8fd01cf
Add Swift/macOS support and local development tooling
Nov 6, 2025
3586dfe
Merge branch 'main' into gabe-id-1146-add-rust-core-swift-bindings-ex…
decentralgabe Nov 6, 2025
6e94fb2
clippy
Nov 6, 2025
09817c1
fix ci
Nov 6, 2025
184ec16
ci
Nov 6, 2025
cb14a09
use bindgen properly
Nov 6, 2025
4b23865
remove dupe
Nov 6, 2025
486547f
fix swift build
Nov 6, 2025
fe7c655
use poll for status
Nov 6, 2025
f93d647
fix ci
Nov 6, 2025
58baebb
clippy
Nov 6, 2025
07311d5
more lints
Nov 6, 2025
3cf4dd6
Set macOS deployment target to match Package.swift
Nov 7, 2025
1290765
Use xcodebuild test instead of swift test in CI
Nov 7, 2025
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
111 changes: 111 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
name: CI
permissions:
contents: read

on:
push:
branches: ['main']
pull_request:

jobs:
rust-core:
name: Rust Core - Build & Test
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4

- name: Setup Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable

- name: Cache Cargo dependencies
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-

- name: Check formatting
run: cargo fmt --all -- --check

- name: Lint with Clippy
run: cargo clippy --all-targets --all-features -- -D warnings

- name: Build Rust core
run: cargo build --release --package idkit-core

- name: Run Rust tests
run: cargo test --package idkit-core

swift-bindings:
name: Swift Bindings - Build & Test
runs-on: ${{ matrix.os }}
needs: rust-core
strategy:
fail-fast: false
matrix:
include:
- os: macos-15
xcode: "16.0"
- os: macos-15
xcode: "16.1"
env:
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer
permissions:
contents: read
steps:
- uses: actions/checkout@v4

- name: Setup Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable

- name: Cache Cargo dependencies
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-


- name: Restore Swift .build cache
id: restore-swift-build
uses: actions/cache/restore@v4
with:
path: swift/.build
restore-keys: "swiftpm-build-${{ runner.os }}-${{ matrix.xcode }}-"
key: "swiftpm-build-${{ runner.os }}-${{ matrix.xcode }}-${{ hashFiles('**/Package.swift', '**/Package.resolved') }}"

- name: Build Swift artifacts (Rust + XCFramework + Bindings)
run: bash scripts/package-swift.sh

- name: Build Swift package
working-directory: swift
run: swift build

- name: Run Swift tests
working-directory: swift
run: xcodebuild test -scheme IDKit -destination "platform=macOS"

- name: Cache Swift .build
if: steps.restore-swift-build.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: swift/.build
key: "swiftpm-build-${{ runner.os }}-${{ matrix.xcode }}-${{ hashFiles('**/Package.swift', '**/Package.resolved') }}"
25 changes: 25 additions & 0 deletions .github/workflows/lint-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Validate PR conventions
permissions:
contents: read

on:
pull_request:
types:
- opened
- edited
- synchronize

jobs:
lint-pr:
name: Ensure PR follows conventional commits
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
steps:
- uses: amannn/action-semantic-pull-request@v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
validateSingleCommit: true
validateSingleCommitMatchesPrTitle: true
114 changes: 114 additions & 0 deletions .github/workflows/publish-swift.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
name: Publish Swift Release

on:
pull_request:
types: [closed]
branches:
- main

permissions:
contents: write

jobs:
publish-swift:
if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'release')
runs-on: macos-15
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable

- name: Install uniffi-bindgen
run: cargo install uniffi_bindgen --version 0.30.0

- name: Build Swift artifacts
run: scripts/package-swift.sh

- name: Zip XCFramework
run: zip -r IDKitFFI.xcframework.zip IDKitFFI.xcframework

- name: Compute checksum
id: checksum
run: |
CHECKSUM=$(swift package compute-checksum IDKitFFI.xcframework.zip)
echo "checksum=$CHECKSUM" >> "$GITHUB_OUTPUT"

- name: Determine release version
id: version
run: |
VERSION=$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[] | select(.name=="idkit-uniffi") | .version')
echo "version=$VERSION" >> "$GITHUB_OUTPUT"

- name: Create draft release in idkit-swift
id: release
uses: softprops/action-gh-release@v2
with:
repository: worldcoin/idkit-swift
name: ${{ steps.version.outputs.version }}
tag_name: ${{ steps.version.outputs.version }}
make_latest: false
draft: true
fail_on_unmatched_files: true
files: IDKitFFI.xcframework.zip
token: ${{ secrets.GIT_HUB_TOKEN }}
body: |
Please review https://github.com/worldcoin/idkit/releases/tag/${{ steps.version.outputs.version }} for release notes.

- name: Checkout idkit-swift repository
uses: actions/checkout@v4
with:
repository: worldcoin/idkit-swift
token: ${{ secrets.GIT_HUB_TOKEN }}
path: idkit-swift

- name: Sync generated Swift sources
run: |
rm -rf idkit-swift/Sources
mkdir -p idkit-swift/Sources
cp -R swift/Sources/IDKit idkit-swift/Sources/
rm -f idkit-swift/Package.resolved

- name: Update Package.swift metadata
run: |
ASSET_URL=$(echo '${{ steps.release.outputs.assets }}' | jq -r '.[0].browser_download_url')
VERSION=${{ steps.version.outputs.version }}
CHECKSUM=${{ steps.checksum.outputs.checksum }}

python <<PY
import pathlib
import re

package = pathlib.Path('idkit-swift/Package.swift')
text = package.read_text()
text = re.sub(r'url: "[^"]+"', f'url: "{ASSET_URL}"', text)
text = re.sub(r'checksum: "[^"]+"', f'checksum: "{CHECKSUM}"', text)
text = re.sub(r'// Release version: .*', f'// Release version: {VERSION}', text)
package.write_text(text)
PY

- name: Commit and tag release
working-directory: idkit-swift
env:
VERSION: ${{ steps.version.outputs.version }}
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add Package.swift Sources
git commit -m "Release ${VERSION}"
git tag "${VERSION}"
git push origin HEAD
git push origin "${VERSION}"

- name: Publish release notes
uses: softprops/action-gh-release@v2
with:
repository: worldcoin/idkit-swift
name: ${{ steps.version.outputs.version }}
tag_name: ${{ steps.version.outputs.version }}
draft: false
prerelease: false
token: ${{ secrets.GIT_HUB_TOKEN }}
18 changes: 11 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
*.pdb

# Build outputs (following walletkit model)
# Swift build outputs are not committed to this repo
/swift/Sources/IDKit/
/swift/IDKitFFI.xcframework/
# Swift generated bindings are not committed to this repo (regenerate with scripts/package-swift.sh)
/swift/Sources/IDKit/Generated/
/swift/Sources/idkitFFI/
/swift/IDKitFFI.xcframework
/IDKitFFI.xcframework/
/ios_build/

# Kotlin build outputs are not committed to this repo
Expand Down Expand Up @@ -64,7 +66,9 @@ coverage/
*.profraw
*.profdata

.idea
.claude
.cursor
.DS_Store
/.idea/
/.claude/
/.cursor/

# Backup files
*.bak
61 changes: 61 additions & 0 deletions Cargo.lock

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

Loading