-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix rustls transport error / use nix releases (#1153)
* ensure openssl version * fix the gen correctly generating * use xmtp/rust patch * remove some clones * use install action for cross * nix flake * add nix flake, kotlin/swift scripts+workflows * switch around swift -nix and non-nix * fix lints * remove extra lockfile * use nix flake for nix-swift release too * use magic nix cache in make swift * improve dev/release-swift * Update dev/release-kotlin Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * apply feedback * simplify buildInputs * cross unwind still not fixed * apply feedback to workflows * update workflows to use softprops --------- Co-authored-by: Naomi Plasterer <naomi@xmtp.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
- Loading branch information
1 parent
3a0129c
commit 7e51928
Showing
23 changed files
with
511 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
name: Release Kotlin Bindings | ||
on: | ||
workflow_dispatch: | ||
jobs: | ||
build-linux: | ||
runs-on: warp-ubuntu-latest-x64-16x | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
target: | ||
- x86_64-linux-android | ||
- i686-linux-android | ||
- armv7-linux-androideabi | ||
- aarch64-linux-android | ||
include: | ||
- target: x86_64-linux-android | ||
output_target: x86_64 | ||
- target: i686-linux-android | ||
output_target: x86 | ||
- target: armv7-linux-androideabi | ||
output_target: armeabi-v7a | ||
- target: aarch64-linux-android | ||
output_target: arm64-v8a | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Cache | ||
uses: Swatinem/rust-cache@v2 | ||
with: | ||
workspaces: | | ||
. | ||
bindings_ffi | ||
- name: Install Nix | ||
uses: cachix/install-nix-action@v17 | ||
with: | ||
# Mostly to avoid GitHub rate limiting | ||
extra_nix_config: | | ||
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} | ||
- uses: DeterminateSystems/magic-nix-cache-action@v2 | ||
- name: Build jniLibs | ||
run: | | ||
nix develop --command \ | ||
cargo ndk -o bindings_ffi/jniLibs --manifest-path ./bindings_ffi/Cargo.toml \ | ||
-t ${{ matrix.target }} -- build --release | ||
- name: Prepare JNI libs | ||
run: | | ||
cp bindings_ffi/jniLibs/${{ matrix.output_target }}/libxmtpv3.so bindings_ffi/jniLibs/${{ matrix.output_target }}/libuniffi_xmtpv3.so | ||
- name: Upload binary | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ matrix.output_target }} | ||
path: bindings_ffi/jniLibs/${{ matrix.output_target }}/libuniffi_xmtpv3.so | ||
retention-days: 1 | ||
package-kotlin: | ||
needs: [build-linux] | ||
runs-on: warp-ubuntu-latest-x64-16x | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Download artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
path: bindings_ffi/jniLibs | ||
- name: Build archive | ||
working-directory: bindings_ffi | ||
run: | | ||
zip -r LibXMTPKotlinFFI.zip jniLibs | ||
- name: Get short SHA | ||
id: slug | ||
run: echo "sha7=$(echo "${GITHUB_SHA}" | cut -c1-7)" >> "$GITHUB_OUTPUT" | ||
- name: Create release and upload asset | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: ./bindings_ffi/LibXMTPKotlinFFI.zip | ||
tag_name: kotlin-bindings-${{ steps.slug.outputs.sha7 }} | ||
name: Kotlin-Bindings-${{ steps.slug.outputs.sha7 }} | ||
draft: false | ||
prerelease: true | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
name: Release Swift Bindings | ||
on: | ||
workflow_dispatch: | ||
jobs: | ||
build-macos: | ||
runs-on: warp-macos-13-arm64-6x | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
target: | ||
- aarch64-apple-ios | ||
- x86_64-apple-ios | ||
- aarch64-apple-ios-sim | ||
- x86_64-apple-darwin | ||
- aarch64-apple-darwin | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Install Nix | ||
uses: cachix/install-nix-action@v17 | ||
with: | ||
# Mostly to avoid GitHub rate limiting | ||
extra_nix_config: | | ||
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} | ||
- uses: DeterminateSystems/magic-nix-cache-action@v2 | ||
- name: Cache | ||
uses: Swatinem/rust-cache@v2 | ||
with: | ||
workspaces: | | ||
. | ||
- name: Build target | ||
run: | | ||
nix develop --command \ | ||
cargo build --release --target ${{ matrix.target }} --manifest-path bindings_ffi/Cargo.toml | ||
- name: Upload binary | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ matrix.target }} | ||
path: target/${{ matrix.target }}/release/libxmtpv3.a | ||
retention-days: 1 | ||
swift: | ||
runs-on: warp-macos-13-arm64-6x | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- uses: DeterminateSystems/magic-nix-cache-action@v2 | ||
- name: Cache | ||
uses: Swatinem/rust-cache@v2 | ||
with: | ||
workspaces: | | ||
. | ||
- name: Generate bindings | ||
working-directory: bindings_ffi | ||
run: | | ||
nix develop ./../ --command make swift | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: swift | ||
path: bindings_ffi/build/swift/ | ||
retention-days: 1 | ||
package-swift: | ||
needs: [build-macos, swift] | ||
runs-on: warp-macos-13-arm64-6x | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Download artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
path: bindings_ffi/build | ||
- name: Build archive | ||
working-directory: bindings_ffi | ||
run: | | ||
mkdir -p Sources/LibXMTP | ||
mv build/swift/xmtpv3.swift Sources/LibXMTP/ | ||
make framework | ||
cp ../LICENSE ./LICENSE | ||
zip -r LibXMTPSwiftFFI.zip Sources LibXMTPSwiftFFI.xcframework LICENSE | ||
- name: Calculate checksum | ||
id: checksum | ||
working-directory: bindings_ffi | ||
run: | | ||
echo "checksum=$(shasum -a 256 "LibXMTPSwiftFFI.zip" | awk '{ print $1 }')" >> "$GITHUB_OUTPUT" | ||
- name: Get short SHA | ||
id: slug | ||
run: echo "sha7=$(echo "$GITHUB_SHA" | cut -c1-7)" >> "$GITHUB_OUTPUT" | ||
- name: Create release and upload asset | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: ./bindings_ffi/LibXMTPSwiftFFI.zip | ||
tag_name: swift-bindings-${{ steps.slug.outputs.sha7 }} | ||
name: Swift-Bindings-${{ steps.slug.outputs.sha7 }} | ||
draft: false | ||
prerelease: true | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.