-
Notifications
You must be signed in to change notification settings - Fork 3
swift and kotlin credential storage tests #162
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
Changes from 4 commits
f6965a9
a90ab7f
bb52966
a73f73a
8909ee7
0ad9782
c3ed2a4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,7 +18,7 @@ jobs: | |
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| uses: actions/checkout@v6 | ||
|
|
||
| - name: Get new version | ||
| id: version | ||
|
|
@@ -56,7 +56,7 @@ jobs: | |
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| uses: actions/checkout@v6 | ||
| with: | ||
| ref: ${{ needs.pre-release-checks.outputs.commit_sha }} # to ensure all builds are consistent | ||
|
|
||
|
|
@@ -67,15 +67,17 @@ jobs: | |
| targets: aarch64-apple-ios-sim,aarch64-apple-ios,x86_64-apple-ios | ||
| components: rustfmt | ||
|
|
||
| - name: Build the project (iOS) | ||
| run: ./build_swift.sh | ||
| # Includes temporary downstream UniFFI callback vtable patch: | ||
| # https://github.com/mozilla/uniffi-rs/pull/2821 | ||
| - name: Build the project (iOS, with temporary UniFFI ASan workaround) | ||
| run: ./swift/build_swift.sh | ||
|
|
||
| - name: Compress XCFramework binary | ||
| run: | | ||
| zip -r WalletKit.xcframework.zip WalletKit.xcframework | ||
| zip -r WalletKit.xcframework.zip swift/WalletKit.xcframework | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Zip embeds XCFramework under nested path breaking SPMHigh Severity The |
||
|
|
||
| - name: Checkout swift repo | ||
| uses: actions/checkout@v4 | ||
| uses: actions/checkout@v6 | ||
| with: | ||
| repository: worldcoin/walletkit-swift | ||
| token: ${{ secrets.WALLETKIT_BOT_TOKEN }} | ||
|
|
@@ -112,11 +114,11 @@ jobs: | |
|
|
||
| run: | | ||
| # Copy non-binary source files | ||
| cp -r Sources/ target-repo/Sources | ||
| cp -r swift/Sources/ target-repo/Sources | ||
|
|
||
| # Prepare Package.swift | ||
| brew install swiftlint | ||
| ./archive_swift.sh --asset-url "$ASSET_URL" --checksum "$CHECKSUM" --release-version "$NEW_VERSION" | ||
| ./swift/archive_swift.sh --asset-url "$ASSET_URL" --checksum "$CHECKSUM" --release-version "$NEW_VERSION" | ||
| cp Package.swift target-repo/ | ||
|
|
||
| # Commit changes | ||
|
|
@@ -133,8 +135,11 @@ jobs: | |
|
|
||
| prepare-kotlin: | ||
| name: Prepare Kotlin | ||
| runs-on: ubuntu-22.04-32core | ||
| runs-on: arc-public-8xlarge-amd64-runner | ||
| needs: [pre-release-checks] | ||
| env: | ||
| CARGO_HOME: /home/runner/_work/_cargo | ||
| RUSTUP_HOME: /home/runner/_work/_rustup | ||
| permissions: | ||
| contents: write # to upload artifacts | ||
|
|
||
|
|
@@ -149,8 +154,11 @@ jobs: | |
| - target: i686-linux-android | ||
|
|
||
| steps: | ||
| - name: Add Cargo to PATH | ||
| run: echo "$CARGO_HOME/bin" >> $GITHUB_PATH | ||
|
|
||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| uses: actions/checkout@v6 | ||
| with: | ||
| ref: ${{ needs.pre-release-checks.outputs.commit_sha }} # to ensure all builds are consistent | ||
|
|
||
|
|
@@ -167,7 +175,7 @@ jobs: | |
|
|
||
| - name: Build for target | ||
| run: | | ||
| CROSS_NO_WARNINGS=0 cross build -p walletkit --target ${{ matrix.settings.target }} --release --locked | ||
| CROSS_NO_WARNINGS=0 cross build -p walletkit --target ${{ matrix.settings.target }} --release --locked --features compress-zkeys | ||
|
|
||
| - name: Upload artifact | ||
| uses: actions/upload-artifact@v4 | ||
|
|
@@ -186,7 +194,7 @@ jobs: | |
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| uses: actions/checkout@v6 | ||
| with: | ||
| ref: ${{ needs.pre-release-checks.outputs.commit_sha }} # to ensure all builds are consistent | ||
|
|
||
|
|
@@ -210,7 +218,7 @@ jobs: | |
|
|
||
| - name: Move artifacts | ||
| run: | | ||
| mkdir -p kotlin/lib/src/main/jniLibs && cd kotlin/lib/src/main/jniLibs | ||
| mkdir -p kotlin/walletkit/src/main/jniLibs && cd kotlin/walletkit/src/main/jniLibs | ||
| mkdir armeabi-v7a arm64-v8a x86 x86_64 | ||
| mv /home/runner/work/walletkit/walletkit/android-armv7-linux-androideabi/libwalletkit.so ./armeabi-v7a/libwalletkit.so | ||
| mv /home/runner/work/walletkit/walletkit/android-aarch64-linux-android/libwalletkit.so ./arm64-v8a/libwalletkit.so | ||
|
|
@@ -219,11 +227,11 @@ jobs: | |
|
|
||
| - name: Generate bindings | ||
| working-directory: kotlin | ||
| run: cargo run -p uniffi-bindgen generate ./lib/src/main/jniLibs/arm64-v8a/libwalletkit.so --library --language kotlin --no-format --out-dir lib/src/main/java | ||
| run: cargo run -p uniffi-bindgen generate ./walletkit/src/main/jniLibs/arm64-v8a/libwalletkit.so --library --language kotlin --no-format --out-dir walletkit/src/main/java | ||
|
|
||
| - name: Publish | ||
| working-directory: kotlin | ||
| run: ./gradlew lib:publish -PversionName=${{ needs.pre-release-checks.outputs.new_version }} | ||
| run: ./gradlew walletkit:publish | ||
| env: | ||
| GITHUB_ACTOR: wld-walletkit-bot | ||
| GITHUB_TOKEN: ${{ github.token }} | ||
|
|
@@ -243,16 +251,13 @@ jobs: | |
| make_latest: true | ||
|
|
||
| - name: Create Release in swift repo | ||
| uses: softprops/action-gh-release@v2 | ||
| with: | ||
| repository: worldcoin/walletkit-swift | ||
| token: ${{ secrets.WALLETKIT_BOT_TOKEN }} | ||
| name: ${{ needs.pre-release-checks.outputs.new_version }} | ||
| tag_name: ${{ needs.pre-release-checks.outputs.new_version }} | ||
| body: | | ||
| ## Version ${{ needs.pre-release-checks.outputs.new_version }} | ||
| For full release notes, see the [main repo release](https://github.com/worldcoin/walletkit/releases/tag/${{ needs.pre-release-checks.outputs.new_version }}). | ||
| make_latest: true | ||
| env: | ||
| GH_TOKEN: ${{ secrets.WALLETKIT_BOT_TOKEN }} | ||
| run: | | ||
| gh release edit ${{ needs.pre-release-checks.outputs.new_version }} \ | ||
| --repo worldcoin/walletkit-swift \ | ||
| --draft=false \ | ||
| --latest | ||
|
|
||
| publish-to-crates-io: | ||
| needs: [pre-release-checks, create-github-release] | ||
|
|
@@ -264,7 +269,7 @@ jobs: | |
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| uses: actions/checkout@v6 | ||
| with: | ||
| ref: ${{ needs.pre-release-checks.outputs.commit_sha }} # to ensure all builds are consistent | ||
|
|
||
|
|
@@ -275,7 +280,7 @@ jobs: | |
|
|
||
| - uses: rust-lang/crates-io-auth-action@v1 | ||
| id: auth | ||
|
|
||
| - name: Publish to crates.io | ||
| env: | ||
| CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }} | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # WalletKit Agent Guidelines | ||
|
|
||
| ## UniFFI Naming | ||
|
|
||
| Never name a UniFFI-exported method `to_string`. UniFFI maps Rust's `to_string` to Kotlin's `toString`, which conflicts with `Any.toString()` and causes a compilation error (`'toString' hides member of supertype 'Any' and needs 'override' modifier`). Use a descriptive name instead (e.g., `to_hex_string`, `to_decimal_string`, `to_json`). |


There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Debug cargo metadata print left in release workflow
Low Severity
The line
cargo metadata --no-deps --format-version 1 | jq -r '.workspace_members'prints workspace members to stdout without storing or using the result. This looks like a leftover debug statement that was not removed before committing.