forked from ElementsProject/libwally-core
-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add gitlab builder for creating releases, update build to include pyt…
…hon wheels Initial changes by Lawrence Nahum <lawrence@greenaddress.it> and Jeremy Kauffman <jeremy@blockstream.io>.
- Loading branch information
1 parent
0297e77
commit 262c9a9
Showing
12 changed files
with
148 additions
and
20 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 |
---|---|---|
|
@@ -66,3 +66,4 @@ wallycore.egg-info/ | |
wally*.gz | ||
wally*.sha256 | ||
wally*.asc | ||
wally*.whl |
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,28 @@ | ||
build_tag_release: | ||
image: greenaddress/wallycore:fc18366c4da94ea7fe328650709e39a1133595f4b998b9c992f700c4f392c1e7 | ||
artifacts: | ||
name: wallycore-android-jni | ||
when: on_success | ||
paths: | ||
- wallycore-android-jni.tar.gz | ||
- wallycore-android-jni.tar.gz.sha256 | ||
- wallycore-0.2.0-py27-none-linux_x86_64.whl | ||
- wallycore-0.2.0-py27-none-linux_x86_64.whl.sha256 | ||
- wallycore-0.2.0-py35-none-linux_x86_64.whl | ||
- wallycore-0.2.0-py35-none-linux_x86_64.whl.sha256 | ||
- wallycore-linux_x86_64-python2.tar.gz | ||
- wallycore-linux_x86_64-python2.tar.gz.sha256 | ||
- wallycore-linux_x86_64-python3.tar.gz | ||
- wallycore-linux_x86_64-python3.tar.gz.sha256 | ||
tags: | ||
- ga | ||
script: | ||
- cd $CI_PROJECT_DIR | ||
- ./tools/build_python_eggs.sh | ||
- ./tools/build_android_libraries.sh | ||
- mv release wallycore-android-jni | ||
- tar cvf wallycore-android-jni.tar wallycore-android-jni | ||
- gzip -9 wallycore-android-jni.tar | ||
- sha256sum wallycore-android-jni.tar.gz > wallycore-android-jni.tar.gz.sha256 | ||
only: | ||
- tag |
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
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,6 @@ | ||
FROM debian:stretch | ||
COPY stretch_deps.sh /deps.sh | ||
RUN /deps.sh && rm /deps.sh | ||
VOLUME /wallycore | ||
ENV JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64 | ||
ENV ANDROID_NDK=/opt/android-ndk-r14b |
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,19 @@ | ||
#! /usr/bin/env bash | ||
set -e | ||
|
||
export NDK_FILENAME=android-ndk-r14b-linux-x86_64.zip | ||
|
||
dpkg --add-architecture i386 | ||
sed -i 's/deb.debian.org/httpredir.debian.org/g' /etc/apt/sources.list | ||
|
||
apt-get update -qq | ||
apt-get upgrade -yqq | ||
apt-get install python{,3}-distutils-extra python{,3}-dev build-essential libffi-dev swig autoconf libtool pkg-config lib32z1 openjdk-8-jdk ca-certificates-java unzip curl libc6:i386 libc6-dev:i386 libncurses5:i386 libstdc++6:i386 lib32z1 virtualenv python{,3}-setuptools -yqq | ||
update-java-alternatives -s java-1.8.0-openjdk-amd64 | ||
|
||
cd /opt && curl -sSO https://dl.google.com/android/repository/${NDK_FILENAME} && unzip -qq ${NDK_FILENAME} && rm ${NDK_FILENAME} | ||
|
||
apt-get remove --purge curl unzip -yqq | ||
apt-get -yqq autoremove | ||
apt-get -yqq clean | ||
rm -rf /var/lib/apt/lists/* /var/cache/* /tmp/* /usr/share/locale/* /usr/share/man /usr/share/doc /lib/xtables/libip6* |
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,50 @@ | ||
#! /usr/bin/env bash | ||
# | ||
# Build native android libraries with JNI bindings, for use with C or Java. | ||
# Requires JAVA_HOME and ANDROID_NDK to be set. | ||
# | ||
set -e | ||
|
||
if [ -z "$ANDROID_NDK" ]; then | ||
export ANDROID_NDK=$(dirname `which ndk-build 2>/dev/null`) | ||
fi | ||
echo ${ANDROID_NDK:?} | ||
if [ -z "$JAVA_HOME" ]; then | ||
export JAVA_HOME=$JAVA7_HOME | ||
fi | ||
echo ${JAVA_HOME:?} | ||
|
||
source $PWD/tools/android_helpers.sh | ||
|
||
$PWD/tools/cleanup.sh && $PWD/tools/autogen.sh | ||
|
||
# Build everything unless the user passed a single target name | ||
ARCH_LIST=$(android_get_arch_list) | ||
if [ -n "$1" ]; then | ||
ARCH_LIST="$1" | ||
fi | ||
|
||
for arch in $ARCH_LIST; do | ||
# Use API level 14 for non-64 bit targets for better device coverage | ||
api="14" | ||
if [[ $arch == *"64"* ]]; then | ||
api="21" | ||
fi | ||
|
||
# Location of the NDK tools to build with | ||
toolsdir="$PWD/toolchain-$arch" | ||
|
||
# What we want built | ||
useropts="--enable-swig-java" | ||
|
||
# Configure and build with the above options | ||
android_build_wally $arch $toolsdir $api $useropts | ||
|
||
# Copy the build result | ||
mkdir -p $PWD/release/lib/$arch | ||
$toolsdir/bin/*-strip -o $PWD/release/lib/$arch/libwallycore.so $PWD/src/.libs/libwallycore.so | ||
done | ||
|
||
mkdir -p $PWD/release/include $PWD/release/src/swig_java/src/com/blockstream/libwally | ||
cp $PWD/include/*.h $PWD/release/include | ||
cp $PWD/src/swig_java/src/com/blockstream/libwally/Wally.java $PWD/release/src/swig_java/src/com/blockstream/libwally |
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
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/bin/sh | ||
#! /usr/bin/env bash | ||
|
||
# Clean up all generated files | ||
make -o configure distclean >/dev/null 2>&1 | ||
|
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
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/bin/sh | ||
#! /usr/bin/env bash | ||
|
||
sed_exe=$1 | ||
|
||
|
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/bin/sh | ||
#! /usr/bin/env bash | ||
|
||
ENABLE_SWIG_PYTHON="--enable-swig-python" | ||
ENABLE_SWIG_JAVA="--enable-swig-java" | ||
|
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/bin/sh | ||
#! /usr/bin/env bash | ||
|
||
if [ "$TRAVIS_OS_NAME" = "osx" ]; then | ||
brew update | ||
|