remove the default New Group (#818) #1017
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
name: Build | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
target: [ | |
# aarch64-unknown-linux-gnu, | |
# x86_64-linux-android, | |
i686-linux-android, | |
armv7-linux-androideabi, | |
aarch64-linux-android, | |
] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v1 | |
- name: "Cache" | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
./target/${{ matrix.target }} | |
key: ${{ matrix.target }}-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }} | |
- name: Install rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
profile: minimal | |
override: true | |
target: ${{ matrix.target }} | |
# Install latest cross to mitigate unwind linking issue on android builds. | |
# See https://github.com/cross-rs/cross/issues/1222 | |
- name: Install rust cross | |
run: | | |
cargo install cross --git https://github.com/cross-rs/cross | |
- name: Build target | |
uses: actions-rs/cargo@v1 | |
with: | |
use-cross: true | |
command: build | |
args: --release --target ${{ matrix.target }} --manifest-path bindings_ffi/Cargo.toml --target-dir bindings_ffi/target | |
- name: Upload binary | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ matrix.target }} | |
path: bindings_ffi/target/${{ matrix.target }}/release/libxmtpv3.so | |
retention-days: 1 | |
build-macos: | |
runs-on: warp-macos-13-arm64-6x | |
strategy: | |
fail-fast: false | |
matrix: | |
target: [aarch64-apple-darwin, aarch64-apple-ios, aarch64-apple-ios-sim] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v1 | |
- name: "Cache" | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
./target/${{ matrix.target }} | |
key: ${{ matrix.target }}-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }} | |
- name: Install rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
profile: minimal | |
override: true | |
target: ${{ matrix.target }} | |
# Install latest cross to mitigate unwind linking issue on android builds. | |
# See https://github.com/cross-rs/cross/issues/1222 | |
- name: Install rust cross | |
run: | | |
cargo install cross --git https://github.com/cross-rs/cross | |
- name: Build target | |
uses: actions-rs/cargo@v1 | |
env: | |
CROSS_NO_WARNINGS: "0" | |
with: | |
use-cross: true | |
command: build | |
args: --release --target ${{ matrix.target }} --manifest-path bindings_ffi/Cargo.toml --target-dir bindings_ffi/target | |
- name: Upload binary | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ matrix.target }} | |
path: bindings_ffi/target/${{ matrix.target }}/release/libxmtpv3.a | |
retention-days: 1 | |
kotlin: | |
runs-on: warp-macos-13-arm64-6x | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v1 | |
- name: Cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
./target/release | |
key: ${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }} | |
- name: Install rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
profile: minimal | |
override: true | |
target: x86_64-apple-darwin | |
- name: Install kotlin | |
run: brew install ktlint | |
- name: Generate Bindings | |
working-directory: bindings_ffi | |
run: ./gen_kotlin.sh | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: kotlin | |
path: bindings_ffi/src/uniffi/xmtpv3/xmtpv3.kt | |
retention-days: 1 | |
swift: | |
runs-on: warp-macos-13-arm64-6x | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v1 | |
- name: Cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
./target/release | |
key: ${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }} | |
- name: Install rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
profile: minimal | |
override: true | |
target: x86_64-apple-darwin | |
- name: Install swift | |
run: brew install swiftformat | |
- name: Generate bindings | |
working-directory: bindings_ffi | |
run: | | |
make swift | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: swift | |
path: bindings_ffi/build/swift/ | |
retention-days: 1 | |
package-android: | |
needs: [build, kotlin] | |
runs-on: warp-ubuntu-latest-x64-4x | |
steps: | |
- name: Download artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
path: . | |
- name: Build archive | |
run: | | |
mkdir -p jniLibs/x86 | |
mv i686-linux-android/libxmtpv3.so jniLibs/x86/ | |
mkdir -p jniLibs/armeabi-v7a | |
mv armv7-linux-androideabi/libxmtpv3.so jniLibs/armeabi-v7a/ | |
mkdir -p jniLibs/arm64-v8a | |
mv aarch64-linux-android/libxmtpv3.so jniLibs/arm64-v8a/ | |
mkdir -p java | |
mv kotlin/xmtpv3.kt java/ | |
zip -r libxmtp-android.zip jniLibs java | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: libxmtp-android.zip | |
path: libxmtp-android.zip | |
package-swift: | |
needs: [build-macos, swift] | |
runs-on: warp-macos-13-arm64-6x | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v1 | |
- name: Download artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
path: bindings_ffi/build | |
- name: Build archive | |
working-directory: bindings_ffi | |
run: | | |
find . | |
mkdir -p Sources/LibXMTP | |
mv build/swift/xmtpv3.swift Sources/LibXMTP/ | |
make framework | |
zip -r libxmtp-swift.zip Sources LibXMTPSwiftFFI.xcframework | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: libxmtp-swift.zip | |
path: bindings_ffi/libxmtp-swift.zip |