forked from xmtp/libxmtp
-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (80 loc) · 2.66 KB
/
release-kotlin-bindings-nix.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
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@v30
with:
# Mostly to avoid GitHub rate limiting
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- uses: DeterminateSystems/magic-nix-cache-action@v9
- 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@v2
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 }}