Skip to content
Permalink
Browse files

Add VW-JNI SNAPSHOT publishing to nightly build

  • Loading branch information...
eisber committed Aug 13, 2019
1 parent 95525d1 commit f343df75361dd9df0ba220c10cad90c3e65b128f
Showing with 46 additions and 0 deletions.
  1. +6 −0 .pipelines/build-linux.yml
  2. +28 −0 .scripts/linux/java.sh
  3. +12 −0 java/settings.xml
@@ -17,6 +17,12 @@ steps:
displayName: Test C++
- bash: ./.scripts/linux/java.sh
displayName: Build + test Java
env:
# these are credentials used to publish to oss.sonatype.org
# credentials are stored as secrets in the build definition
ossrh_gpg: $(ossrh_gpg)
ossrh_username: $(ossrh_username)
ossrh_password: $(ossrh_password)
- bash: ./.scripts/linux/python27.sh
displayName: Build + test Python 2.7
- bash: ./.scripts/linux/python36.sh
@@ -8,3 +8,31 @@ cd $REPO_DIR

# Run Java build and test
mvn clean test -f java/pom.xml

# publish snapshot jar to staging repository
if [ "$ossrh_username" = "\$(ossrh_username)" ] || [ -z "$ossrh_username" ]
then
echo "Skipping package publishing"
else
# template for username/password for sonatype repository server
cp java/settings.xml ~/.m2/settings.xml

# import signing key
# this is how to export them
# gpg --export-secret-keys 'Markus Cozowicz <marcozo@microsoft.com>' | base64 -w 0
echo $ossrh_gpg | base64 -d | gpg --import -

MAVEN_OPTS="-Dossrh.username=$ossrh_username -Dossrh.password=$ossrh_password"

# to use the snapshot from oss.sonatype.org
# * add http://oss.sonatype.org/content/repositories/snapshots
# * reference com.github.vowpalwabbit:vw-jni:8.7.0-SNAPSHORT
#
# more details at https://stackoverflow.com/questions/7715321/how-to-download-snapshot-version-from-maven-snapshot-repository

# For a proper release:
# * remove -SNAPSHOT in pom.xml
# * visit https://oss.sonatype.org/#stagingRepositories and "close & release" the staged .jar
# * see https://oss.sonatype.org/#stagingRepositories
mvn -f java/pom.xml verify gpg:sign deploy:deploy -Dmaven.test.skip=true $MAVEN_OPTS
fi
@@ -0,0 +1,12 @@
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
https://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>ossrh</id>
<username>${ossrh.username}</username>
<password>${ossrh.password}</password>
</server>
</servers>
</settings>

0 comments on commit f343df7

Please sign in to comment.
You can’t perform that action at this time.