Skip to content
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

Fix rustls transport error / use nix releases #1153

Merged
merged 24 commits into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
995e6bf
ensure openssl version
insipx Oct 18, 2024
718e400
fix the gen correctly generating
nplasterer Oct 18, 2024
d093a5f
use xmtp/rust patch
insipx Oct 18, 2024
6f425f3
Merge branch 'insipx/downgrade-ssl' of github.com:xmtp/libxmtp into i…
insipx Oct 18, 2024
ecbb94f
remove some clones
insipx Oct 20, 2024
2970db8
use install action for cross
insipx Oct 20, 2024
1c3c04a
nix flake
insipx Oct 21, 2024
500643b
add nix flake, kotlin/swift scripts+workflows
insipx Oct 21, 2024
7f2c20a
Merge branch 'main' of github.com:xmtp/libxmtp into insipx/downgrade-ssl
insipx Oct 21, 2024
2742f27
switch around swift -nix and non-nix
insipx Oct 21, 2024
12f81fa
fix lints
insipx Oct 21, 2024
a186f8b
remove extra lockfile
insipx Oct 21, 2024
0243df2
use nix flake for nix-swift release too
insipx Oct 22, 2024
438d49f
use magic nix cache in make swift
insipx Oct 22, 2024
ecfa0b8
improve dev/release-swift
insipx Oct 22, 2024
8f080f5
Update dev/release-kotlin
insipx Oct 22, 2024
2ad34a4
apply feedback
insipx Oct 22, 2024
ec7e3ca
Merge branch 'insipx/downgrade-ssl' of github.com:xmtp/libxmtp into i…
insipx Oct 22, 2024
8900aa1
simplify buildInputs
insipx Oct 22, 2024
ed1a455
Merge branch 'main' of github.com:xmtp/libxmtp into insipx/downgrade-ssl
insipx Oct 22, 2024
df9f8d8
cross unwind still not fixed
insipx Oct 22, 2024
ba99054
apply feedback to workflows
insipx Oct 22, 2024
203f11e
update workflows to use softprops
insipx Oct 22, 2024
7f89c35
Merge branch 'main' of github.com:xmtp/libxmtp into insipx/downgrade-ssl
insipx Oct 22, 2024
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
89 changes: 89 additions & 0 deletions .github/workflows/release-kotlin-bindings-nix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
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
insipx marked this conversation as resolved.
Show resolved Hide resolved
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: kotlin-bindings-${{ steps.slug.outputs.sha7 }}
release_name: Kotlin-Bindings-${{ steps.slug.outputs.sha7 }}
draft: false
prerelease: true
- name: Upload release asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./bindings_ffi/LibXMTPKotlinFFI.zip
asset_name: LibXMTPKotlinFFI.zip
asset_content_type: application/zip
insipx marked this conversation as resolved.
Show resolved Hide resolved
107 changes: 107 additions & 0 deletions .github/workflows/release-swift-bindings-nix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
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
insipx marked this conversation as resolved.
Show resolved Hide resolved
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
insipx marked this conversation as resolved.
Show resolved Hide resolved
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: swift-bindings-${{ steps.slug.outputs.sha7 }}
release_name: Swift-Bindings-${{ steps.slug.outputs.sha7 }}
body: "Checksum of LibXMTPSwiftFFI.zip: ${{ steps.checksum.outputs.checksum }}"
draft: false
prerelease: true
- name: Upload release asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./bindings_ffi/LibXMTPSwiftFFI.zip
asset_name: LibXMTPSwiftFFI.zip
asset_content_type: application/zip
7 changes: 2 additions & 5 deletions .github/workflows/release-swift-bindings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,8 @@ jobs:
workspaces: |
.
bindings_ffi
# Install latest cross to mitigate unwind linking issue on android builds.
# See https://github.com/cross-rs/cross/issues/1222
- name: Install cross
run: |
cargo install cross --git https://github.com/cross-rs/cross
- name: Install Cross
uses: taiki-e/install-action@cross
insipx marked this conversation as resolved.
Show resolved Hide resolved
- name: Build target
env:
CROSS_NO_WARNINGS: "0"
Expand Down
39 changes: 20 additions & 19 deletions Cargo.lock

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

Loading
Loading