forked from bytedeco/javacpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
191 lines (183 loc) · 10.2 KB
/
.travis.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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
dist: xenial
cache:
directories:
- $HOME/.m2/repository
before_install:
- >
echo '<settings>
<localRepository>${env.HOME}/.m2/repository</localRepository>
<servers>
<server>
<id>sonatype-nexus-snapshots</id>
<username>${env.CI_DEPLOY_USERNAME}</username>
<password>${env.CI_DEPLOY_PASSWORD}</password>
</server>
<server>
<id>sonatype-nexus-staging</id>
<username>${env.CI_DEPLOY_USERNAME}</username>
<password>${env.CI_DEPLOY_PASSWORD}</password>
</server>
</servers>
</settings>' > $HOME/settings.xml
- >
if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then
export MAVEN_PHASE="install";
elif [[ "$TRAVIS_BRANCH" != "release" ]]; then
export MAVEN_PHASE="deploy";
else
curl -L "https://drive.google.com/uc?export=download&id=$GDOWNLOAD_ID" -o $HOME/settings.tar.gz;
tar -xzf $HOME/settings.tar.gz -C $HOME;
export GNUPGHOME="$HOME/.gnupg/";
export MAVEN_PHASE="deploy -DperformRelease -DstagingRepositoryId=$STAGING_REPOSITORY";
fi
jobs:
include:
- stage: Deploy
os: linux
arch: arm64
language: java
addons:
apt:
packages: openjdk-8-jdk-headless maven
env: PLATFORMS="linux-arm64"
install:
- export JAVA_HOME="/usr/lib/jvm/java-8-openjdk-arm64"
script:
- mvn clean $MAVEN_PHASE -B -V -U -s $HOME/settings.xml -Djavacpp.platform=linux-arm64
- os: linux
arch: ppc64le
language: java
addons:
apt:
packages: openjdk-8-jdk-headless maven
env: PLATFORMS="linux-ppc64le"
install:
- export JAVA_HOME="/usr/lib/jvm/java-8-openjdk-ppc64el"
script:
- mvn clean $MAVEN_PHASE -B -V -U -s $HOME/settings.xml -Djavacpp.platform=linux-ppc64le
- os: linux
arch: amd64
language: java
jdk: openjdk8
env: PLATFORMS="android-arm android-arm64 android-x86 android-x86_64 linux-armhf linux-x86 linux-x86_64"
services:
- docker
install:
- curl -L https://dl.google.com/android/repository/android-ndk-r18b-linux-x86_64.zip -o $HOME/android-ndk-r18b.zip
- curl -L https://github.com/raspberrypi/tools/archive/master.tar.gz -o $HOME/tools-master.tar.gz
- unzip -q $HOME/android-ndk-r18b.zip -d $HOME
- tar xzf $HOME/tools-master.tar.gz -C $HOME
- export ANDROID_NDK="$HOME/android-ndk-r18b"
- export ANDROID_OPTIONS="-Djavacpp.platform.root=$ANDROID_NDK -Djava.library.path= -Djavacpp.platform.suffix=-clang"
- export TOOLS_PATH="$HOME/tools-master/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf"
- export TOOLS_OPTIONS="-Djavacpp.platform.compiler=$TOOLS_PATH/bin/arm-linux-gnueabihf-g++ -Djava.library.path=$TOOLS_PATH/arm-linux-gnueabihf/lib/"
script:
- mvn clean $MAVEN_PHASE -B -V -U -s $HOME/settings.xml -Djavacpp.platform=android-arm $ANDROID_OPTIONS -Dmaven.javadoc.skip -Dmaven.test.skip -Dinvoker.skip
- mvn clean $MAVEN_PHASE -B -V -U -s $HOME/settings.xml -Djavacpp.platform=android-arm64 $ANDROID_OPTIONS -Dmaven.javadoc.skip -Dmaven.test.skip -Dinvoker.skip
- mvn clean $MAVEN_PHASE -B -V -U -s $HOME/settings.xml -Djavacpp.platform=android-x86 $ANDROID_OPTIONS -Dmaven.javadoc.skip -Dmaven.test.skip -Dinvoker.skip
- mvn clean $MAVEN_PHASE -B -V -U -s $HOME/settings.xml -Djavacpp.platform=android-x86_64 $ANDROID_OPTIONS -Dmaven.javadoc.skip -Dmaven.test.skip -Dinvoker.skip
- mvn clean $MAVEN_PHASE -B -V -U -s $HOME/settings.xml -Djavacpp.platform=linux-armhf $TOOLS_OPTIONS -Dmaven.javadoc.skip -Dmaven.test.skip -Dinvoker.skip
- >
docker run -e CI_DEPLOY_USERNAME -e CI_DEPLOY_PASSWORD -e GPG_PASSPHRASE -e STAGING_REPOSITORY -v $HOME:$HOME -v $TRAVIS_BUILD_DIR:$TRAVIS_BUILD_DIR centos:6 /bin/sh -c "
export HOME=$HOME;
cd $TRAVIS_BUILD_DIR;
find /etc/yum.repos.d/ -name *.repo | xargs -i sed -i 's/mirror\.centos\.org\/centos/vault.centos.org/g;s/\$releasever/6.10/g;s/mirrorlist/#mirrorlist/g;s/#baseurl/baseurl/g' {};
yum -q -y install centos-release-scl-rh epel-release;
sed -i 's/mirror\.centos\.org\/centos/vault.centos.org/g;s/6\/sclo/6.10\/sclo/g;s/mirrorlist/#mirrorlist/g;s/#baseurl/baseurl/g' /etc/yum.repos.d/CentOS-SCLo-scl-rh.repo;
yum -q -y install devtoolset-7 java-1.8.0-openjdk-devel wget unzip tar bzip2 gzip xz;
rpm -qa | sed s/.x86_64$/.i686/ | xargs yum -q -y install
find /var/cache/yum/ -name *.rpm | xargs rpm -i --force
wget --no-directories --no-parent --no-verbose -r https://www.repo.cloudlinux.com/cloudlinux/6/sclo/devtoolset-7/i386/ -P $HOME;
rpm -i --force --nodeps $HOME/*.rpm;
source scl_source enable devtoolset-7;
curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz -o $HOME/apache-maven-3.6.3-bin.tar.gz;
tar -xzf $HOME/apache-maven-3.6.3-bin.tar.gz -C /opt/;
ln -sf /opt/apache-maven-3.6.3/bin/mvn /usr/bin/mvn;
gcc --version;
gpg --version;
mvn clean $MAVEN_PHASE -B -V -U -s $HOME/settings.xml -Djavacpp.platform=linux-x86 -Dmaven.javadoc.skip -Dmaven.test.skip -Dinvoker.skip;
mvn clean $MAVEN_PHASE -B -V -U -s $HOME/settings.xml -Djavacpp.platform=linux-x86_64;
mvn clean $MAVEN_PHASE -B -V -U -s $HOME/settings.xml -f platform/pom.xml -Djavacpp.platform.host;
"
- os: osx
osx_image: xcode12.2
language: java
env: PLATFORMS="ios-arm64 ios-x86_64 macosx-arm64 macosx-x86_64"
install:
- brew update
- brew install gpg1
- brew tap AdoptOpenJDK/openjdk
- brew install --cask adoptopenjdk8
- export JAVA_HOME=$(/usr/libexec/java_home -v1.8)
- export MACOSX_DEPLOYMENT_TARGET=10.13
- export PATH="/usr/local/opt/gpg1/libexec/gpgbin/:$PATH"
- sudo rm -Rf /Library/Developer/CommandLineTools/SDKs/* # Remove SDKs without ARM support
script:
- mvn clean $MAVEN_PHASE -B -V -U -s $HOME/settings.xml -Djavacpp.platform=ios-arm64 -Dmaven.javadoc.skip -Dmaven.test.skip -Dinvoker.skip
- mvn clean $MAVEN_PHASE -B -V -U -s $HOME/settings.xml -Djavacpp.platform=ios-x86_64 -Dmaven.javadoc.skip -Dmaven.test.skip -Dinvoker.skip
- mvn clean $MAVEN_PHASE -B -V -U -s $HOME/settings.xml -Djavacpp.platform=macosx-arm64 -Dmaven.javadoc.skip -Dmaven.test.skip -Dinvoker.skip
- mvn clean $MAVEN_PHASE -B -V -U -s $HOME/settings.xml -Djavacpp.platform=macosx-x86_64
- os: windows
language: bash
env: PLATFORMS="windows-x86 windows-x86_64"
install:
- choco install jdk8 --params 'installdir=c:\\jdk8'
- choco install gnupg --version=2.2.20
- choco install maven --version=3.6.3
- export JAVA_HOME="/c/jdk8/"
- export PATH="/c/Program Files (x86)/gnupg/bin/:/c/ProgramData/chocolatey/lib/maven/apache-maven-3.6.3/bin/:/c/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/VC/Auxiliary/Build/:$PATH"
script:
- cmd.exe //C 'vcvarsall.bat x86 && mvn clean %MAVEN_PHASE% -B -V -U -s %HOME%/settings.xml -Djavacpp.platform=windows-x86 -Dmaven.javadoc.skip -Dmaven.test.skip -Dinvoker.skip'
- cmd.exe //C 'vcvarsall.bat amd64 && mvn clean %MAVEN_PHASE% -B -V -U -s %HOME%/settings.xml -Djavacpp.platform=windows-x86_64'
- stage: Redeploy
arch: amd64
language: java
jdk: openjdk8
install: true
script:
- |
# Redeploys in one shot main and secondary artifacts to get consistent timestamps among them as required by Gradle, sbt, etc
if [[ "$TRAVIS_PULL_REQUEST" != "false" ]] || [[ "$TRAVIS_BRANCH" == "release" ]]; then
# We are not deploying snapshots
exit 0
fi
git --version
mvn -version
df -h
GROUP="org.bytedeco"
REPOSITORY_ID="sonatype-nexus-snapshots"
REPOSITORY_URL="https://oss.sonatype.org/content/repositories/snapshots/"
MAVEN_OPTIONS="-N -B -V -U -e -s $HOME/settings.xml -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.count=3"
rm -f dependencies.txt
for POM in $(find ./platform/ -iname pom.xml); do
mvn dependency:list $MAVEN_OPTIONS -DexcludeTransitive -DappendOutput -DoutputFile=$(pwd)/dependencies.txt -f $POM
done
for LINE in $(sort -u dependencies.txt); do
if [[ $LINE =~ $GROUP:([^:]*):jar:([^:]*):compile ]]; then
ARTIFACT=${BASH_REMATCH[1]}
VERSION=${BASH_REMATCH[2]}
FILES=
TYPES=
CLASSIFIERS=
for LINE2 in $(sort -u dependencies.txt); do
if [[ $LINE2 =~ $GROUP:$ARTIFACT:jar:([^:]*):$VERSION:compile ]]; then
CLASSIFIER=${BASH_REMATCH[1]}
FILE=$ARTIFACT-$VERSION-$CLASSIFIER.jar
cp -v $HOME/.m2/repository/${GROUP//.//}/$ARTIFACT/$VERSION/$FILE .
[[ -n $FILES ]] && FILES=$FILES,$FILE || FILES=$FILE
[[ -n $TYPES ]] && TYPES=$TYPES,jar || TYPES=jar
[[ -n $CLASSIFIERS ]] && CLASSIFIERS=$CLASSIFIERS,$CLASSIFIER || CLASSIFIERS=$CLASSIFIER
fi
done
if [[ -n $FILES ]]; then
FILE=$ARTIFACT-$VERSION.jar
cp -v $HOME/.m2/repository/${GROUP//.//}/$ARTIFACT/$VERSION/$FILE .
unzip -o $FILE META-INF/maven/$GROUP/$ARTIFACT/pom.xml
mvn deploy:deploy-file $MAVEN_OPTIONS -DrepositoryId=$REPOSITORY_ID -Durl=$REPOSITORY_URL -DpomFile=META-INF/maven/$GROUP/$ARTIFACT/pom.xml \
-Dfile=$FILE -DgroupId=$GROUP -DartifactId=$ARTIFACT -Dversion=$VERSION -Dfiles=$FILES -Dtypes=$TYPES -Dclassifiers=$CLASSIFIERS
fi
fi
done
df -h
# Prevent all this from getting cached by the CI server
rm -Rf $(find $HOME/.m2/repository -name '*SNAPSHOT*')