Skip to content

Commit

Permalink
Fix CI and update cargo lock
Browse files Browse the repository at this point in the history
  • Loading branch information
sbihel committed Aug 1, 2024
1 parent ae15c25 commit d5f8277
Show file tree
Hide file tree
Showing 4 changed files with 289 additions and 256 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,6 @@ jobs:
tool: cargo-swift

- name: Generate Swift package
run: cargo swift package -p ios -n WalletSdkRs
run: cargo swift package -p ios -n MobileSdkRs
- name: Fail if generated swift code needs update
run: git diff --exit-code WalletSdkRs/Sources/WalletSdkRs/wallet_sdk_rs.swift
run: git diff --exit-code MobileSdkRs/Sources/MobileSdkRs/mobile_sdk_rs.swift
16 changes: 8 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,25 +35,25 @@ jobs:
tool: cargo-swift

- name: Generate Swift package
run: cargo swift package -p ios -n WalletSdkRs --release
run: cargo swift package -p ios -n MobileSdkRs --release

- name: Compress XCFramework
run: |
zip -9 -r RustFramework.xcframework.zip WalletSdkRs/RustFramework.xcframework
zip -9 -r RustFramework.xcframework.zip MobileSdkRs/RustFramework.xcframework
echo "XCF_CHECKSUM=`swift package compute-checksum RustFramework.xcframework.zip`" >> $GITHUB_ENV
- name: Update Swift Package definition
run: |
sed -i '' 's/.binaryTarget.*/.binaryTarget(name: "RustFramework", url: "https:\/\/github.com\/spruceid\/wallet-sdk-rs\/releases\/download\/${{ github.event.inputs.version }}\/RustFramework.xcframework.zip", checksum: "${{ env.XCF_CHECKSUM }}"),/' Package.swift
sed -i '' 's/.binaryTarget.*/.binaryTarget(name: "RustFramework", url: "https:\/\/github.com\/spruceid\/mobile-sdk-rs\/releases\/download\/${{ github.event.inputs.version }}\/RustFramework.xcframework.zip", checksum: "${{ env.XCF_CHECKSUM }}"),/' Package.swift
- name: Update Cocoapods definitions
run: |
sed -i '' -r 's/[0-9]+.[0-9]+.[0-9]+/${{ github.event.inputs.version }}/' SpruceIDWalletSdkRsRustFramework.podspec
sed -i '' -r 's/[0-9]+.[0-9]+.[0-9]+/${{ github.event.inputs.version }}/' SpruceIDWalletSdkRs.podspec
sed -i '' -r 's/[0-9]+.[0-9]+.[0-9]+/${{ github.event.inputs.version }}/' SpruceIDMobileSdkRsRustFramework.podspec
sed -i '' -r 's/[0-9]+.[0-9]+.[0-9]+/${{ github.event.inputs.version }}/' SpruceIDMobileSdkRs.podspec
- name: Push changes and tag
run: |
git config user.name github-actions
git config user.email github-actions@github.com
git add Package.swift SpruceIDWalletSdkRs.podspec SpruceIDWalletSdkRsRustFramework.podspec
git add Package.swift SpruceIDMobileSdkRs.podspec SpruceIDMobileSdkRsRustFramework.podspec
git commit -m "Release ${{ github.event.inputs.version }}"
git push
git tag ${{ github.event.inputs.version }} -m "${{ github.event.inputs.version }}"
Expand All @@ -70,8 +70,8 @@ jobs:
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
run: |
pod trunk push SpruceIDWalletSdkRsRustFramework.podspec
pod trunk push SpruceIDWalletSdkRs.podspec --synchronous
pod trunk push SpruceIDMobileSdkRsRustFramework.podspec
pod trunk push SpruceIDMobileSdkRs.podspec --synchronous
kotlin:
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ MobileSdkRs/RustFramework*
.swiftpm
jna-*.jar
*~
kotlin/mobilesdkrs/src/main/java/com/spruceid/mobile/sdk/rs/mobile_sdk_rs.kt
Loading

0 comments on commit d5f8277

Please sign in to comment.