2021-10-15 07:26:35 +00:00
|
|
|
stages:
|
2021-10-24 19:47:40 +00:00
|
|
|
- native library
|
2021-10-15 07:26:35 +00:00
|
|
|
- bindings
|
|
|
|
|
|
|
|
variables:
|
2021-10-24 20:02:35 +00:00
|
|
|
libsignal_version: "v0.9.4"
|
2021-10-15 07:26:35 +00:00
|
|
|
GRADLE_OPTS: -Dorg.gradle.daemon=false
|
|
|
|
|
|
|
|
.multitarget:
|
|
|
|
parallel:
|
|
|
|
matrix:
|
|
|
|
- TARGET:
|
|
|
|
- aarch64-unknown-linux-gnu
|
|
|
|
- arm-unknown-linux-gnueabi
|
|
|
|
- arm-unknown-linux-gnueabihf
|
|
|
|
- armv7-unknown-linux-gnueabihf
|
|
|
|
- x86_64-unknown-linux-gnu
|
|
|
|
|
|
|
|
compile:
|
|
|
|
extends: .multitarget
|
2021-10-24 20:02:35 +00:00
|
|
|
image: rust:slim-bullseye
|
2021-10-24 19:47:40 +00:00
|
|
|
stage: native library
|
2021-10-15 07:26:35 +00:00
|
|
|
before_script:
|
|
|
|
- ./prepare-env.sh
|
|
|
|
script:
|
|
|
|
- git clone https://github.com/signalapp/libsignal-client
|
|
|
|
- cd libsignal-client && git checkout "$libsignal_version"
|
|
|
|
- rustup target add "${TARGET}"
|
|
|
|
- RUSTFLAGS='-C link-arg=-s' cargo build -p libsignal-jni --target "${TARGET}" --release --verbose
|
|
|
|
- cp -v target/${TARGET}/release/libsignal_jni.so ../libsignal_jni-${TARGET}.so
|
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- libsignal_jni-$TARGET.so
|
|
|
|
|
|
|
|
compile x86_64-apple-darwin:
|
2021-10-24 19:47:40 +00:00
|
|
|
stage: native library
|
2021-10-15 07:26:35 +00:00
|
|
|
tags: [darwin-builder]
|
|
|
|
script:
|
|
|
|
- git clone https://github.com/signalapp/libsignal-client
|
|
|
|
- cd libsignal-client && git checkout "$libsignal_version"
|
|
|
|
- RUSTFLAGS='-C link-arg=-s' cargo build -p libsignal-jni --release --verbose
|
|
|
|
- cp -v target/release/libsignal_jni.dylib ../libsignal_jni-x86_64-apple-darwin.dylib
|
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- libsignal_jni-x86_64-apple-darwin.dylib
|
|
|
|
variables:
|
|
|
|
TARGET: x86_64-apple-darwin
|
2021-11-15 18:24:13 +00:00
|
|
|
rules:
|
|
|
|
- if: '$CI_PROJECT_ROOT_NAMESPACE == "signald"'
|
|
|
|
when: on_success
|
|
|
|
- when: manual
|
|
|
|
allow_failure: true
|
2021-10-15 07:26:35 +00:00
|
|
|
|
|
|
|
jar:
|
|
|
|
extends: .multitarget
|
2021-10-24 20:02:35 +00:00
|
|
|
image: gradle:7
|
2021-10-15 07:26:35 +00:00
|
|
|
stage: bindings
|
2021-10-15 07:28:01 +00:00
|
|
|
needs: ["compile"]
|
2021-10-15 07:26:35 +00:00
|
|
|
script:
|
|
|
|
- git clone https://github.com/signalapp/libsignal-client
|
|
|
|
- cd libsignal-client && git checkout "$libsignal_version"
|
|
|
|
- git config user.email nobody@signald.org && git config user.name signald
|
|
|
|
- git am ../libsignal.patch
|
|
|
|
- mkdir -p java/java/src/main/resources
|
|
|
|
- cp "../libsignal_jni-${TARGET}.so" java/java/src/main/resources/libsignal_jni.so
|
|
|
|
- cd java
|
|
|
|
- gradle assemble publish
|
|
|
|
|
|
|
|
jar x86_64-apple-darwin:
|
2021-10-24 20:02:35 +00:00
|
|
|
image: gradle:7
|
2021-10-15 07:26:35 +00:00
|
|
|
stage: bindings
|
|
|
|
tags: [darwin-builder]
|
2021-10-15 07:28:01 +00:00
|
|
|
needs: ["compile x86_64-apple-darwin"]
|
2021-10-15 07:26:35 +00:00
|
|
|
script:
|
|
|
|
- git clone https://github.com/signalapp/libsignal-client
|
|
|
|
- cd libsignal-client && git checkout "$libsignal_version"
|
|
|
|
- git config user.email nobody@signald.org && git config user.name signald
|
|
|
|
- git am ../libsignal.patch
|
|
|
|
- mkdir -p java/java/src/main/resources
|
|
|
|
- cp "../libsignal_jni-${TARGET}.dylib" java/java/src/main/resources/libsignal_jni.dylib
|
|
|
|
- cd java
|
|
|
|
- gradle assemble publish
|
|
|
|
variables:
|
2021-11-15 18:24:13 +00:00
|
|
|
TARGET: x86_64-apple-darwin
|
|
|
|
rules:
|
|
|
|
- if: '$CI_PROJECT_ROOT_NAMESPACE == "signald"'
|
|
|
|
when: on_success
|
|
|
|
- when: manual
|
|
|
|
allow_failure: true
|