From d6e70542dae89e5b5fd42e344bdc897b57be34e9 Mon Sep 17 00:00:00 2001 From: Miguel Molina Date: Thu, 7 Sep 2017 12:44:06 +0200 Subject: [PATCH] test Signed-off-by: Miguel Molina --- .travis.yml | 36 +++++++++++++++++++++++++++++++++++ java/.gitignore | 4 ++++ java/build.sbt | 40 ++++++++++++++++++++++++++++++++++++++- java/key.asc.enc | Bin 0 -> 5280 bytes java/project/plugins.sbt | 4 +++- 5 files changed, 82 insertions(+), 2 deletions(-) create mode 100644 java/key.asc.enc diff --git a/.travis.yml b/.travis.yml index 572dbae..06eaa34 100644 --- a/.travis.yml +++ b/.travis.yml @@ -113,3 +113,39 @@ jobs: skip_cleanup: true on: tags: true + + - stage: Publish Maven + language: scala + jdk: oraclejdk8 + + before_script: + - if [[ -z "$TRAVIS_TAG" ]]; then echo "Skipping this build for non-tag builds."; exit 0; fi + - cd java + - make + - curl -o ./shared/linux-x86-64/libenry.so -sL "https://github.com/$TRAVIS_REPO_SLUG/releases/download/$TRAVIS_TAG/libenry.so" + - mkdir -p ./shared/darwin + - curl -o ./shared/darwin/libenry.dylib -sL "https://github.com/$TRAVIS_REPO_SLUG/releases/download/$TRAVIS_TAG/libenry.dylib" + - openssl aes-256-cbc -K $encrypted_58e1643233d2_key -iv $encrypted_58e1643233d2_iv -in key.asc.enc -out key.asc -d + - gpg --no-default-keyring --primary-keyring ./project/.gnupg/pubring.gpg --secret-keyring ./project/.gnupg/secring.gpg --keyring ./project/.gnupg/pubring.gpg --fingerprint --import key.asc + + script: + - make test # ensure the shared objects are functional + - ./sbt publishLocal + - ./sbt publishSigned + - ./sbt sonatypeRelease + + before_deploy: + - rm ./target/enry-java-*-javadoc.jar + - rm ./target/enry-java-*-sources.jar + - rm ./target/enry-java-*-tests.jar + - rm ./target/enry-java-assembly-*.jar + + deploy: + provider: releases + api_key: + secure: $GITHUB_TOKEN + file_glob: true + file: ./target/enry-java*.jar + skip_cleanup: true + on: + tags: true diff --git a/java/.gitignore b/java/.gitignore index bbf3ec5..2e1635a 100644 --- a/java/.gitignore +++ b/java/.gitignore @@ -25,3 +25,7 @@ target .jnaerator shared *.jar +*.gpg +key.asc +project/.gnupg + diff --git a/java/build.sbt b/java/build.sbt index b281d73..4142091 100644 --- a/java/build.sbt +++ b/java/build.sbt @@ -1,12 +1,41 @@ name := "enry-java" organization := "tech.sourced" -version := "1.0" +version := "1.0.0" + +sonatypeProfileName := "tech.sourced" + +// pom settings for sonatype +homepage := Some(url("https://github.com/src-d/enry")) +scmInfo := Some(ScmInfo(url("https://github.com/src-d/enry"), + "git@github.com:src-d/enry.git")) +developers += Developer("abeaumont", + "Alfredo Beaumont", + "alfredo@sourced.tech", + url("https://github.com/abeaumont")) +licenses += ("Apache-2.0", url("http://www.apache.org/licenses/LICENSE-2.0")) +pomIncludeRepository := (_ => false) crossPaths := false autoScalaLibrary := false publishMavenStyle := true exportJars := true +val SONATYPE_USERNAME = scala.util.Properties.envOrElse("SONATYPE_USERNAME", "NOT_SET") +val SONATYPE_PASSWORD = scala.util.Properties.envOrElse("SONATYPE_PASSWORD", "NOT_SET") +credentials += Credentials( + "Sonatype Nexus Repository Manager", + "oss.sonatype.org", + SONATYPE_USERNAME, + SONATYPE_PASSWORD) + +val SONATYPE_PASSPHRASE = scala.util.Properties.envOrElse("SONATYPE_PASSPHRASE", "not set") + +useGpg := false +usePgpKeyHex("F75439CAE8DDB254") +pgpSecretRing := baseDirectory.value / "project" / ".gnupg" / "secring.gpg" +pgpPublicRing := baseDirectory.value / "project" / ".gnupg" / "pubring.gpg" +pgpPassphrase := Some(SONATYPE_PASSPHRASE.toArray) + libraryDependencies += "com.novocode" % "junit-interface" % "0.11" % Test unmanagedBase := baseDirectory.value / "lib" @@ -23,3 +52,12 @@ artifact in (Compile, assembly) := { } addArtifact(artifact in (Compile, assembly), assembly) + +isSnapshot := version.value endsWith "SNAPSHOT" + +publishTo := Some( + if (isSnapshot.value) + "snapshots" at nexus + "content/repositories/snapshots" + else + "releases" at nexus + "service/local/staging/deploy/maven2" +) diff --git a/java/key.asc.enc b/java/key.asc.enc new file mode 100644 index 0000000000000000000000000000000000000000..3fa49b30ba23da243c9a072ba1070febd142551f GIT binary patch literal 5280 zcmV;R6kqE{X%{HbOK{GdHj3ro-b&(r=9rnij$idBU)jwv=R@H{RKqpn^H6_JDAiqy z4hiY2%}?zh1_!t+!%mYYU=GJ-S)nuITjpckj&ce1n$rX7wbi)1s1=y#pn2NH&4&C1 zIX9+MOto`)XQSes)z2VEW*I|%BolPE45te+6!^?tT}=+2 z7B=A?CNK>;v#*nB_Dp-s%=MUtmgo%U7Qpo}m$= z`qkfdRO61s+a2X&h#16Ijo}$?U3uGAFYuNQ6@*y+7*-ui<>!uO7+dzQ>-GQEv8@j<19dEWn?wx%(UGJBr+eH3UzZWXqfzL z-!e_x5fh%@l)?YH zK{n~plsYvvKx=Z&lBSyok84(!HaXg%^Iv0F*wuZjY*Sn6G6x6pnCUNi7d>xjg8{Gp z5ca?c2ywTOnhuz$vcZqGL$_FzAqY~}EtR?!a$9-vzDE5$^Imml12oy`!F@yYP_ywrCZ!N7B61I(q7v}PT{|haMiA?tn z1M0?X`98A<4+v3H21Z>vLCUriKVWo^Uf|plDUHtTTJW`5V;$ls-5Fr%B}PH`2FfCE zq&^P5W^sG$$C)>DGrgTdCsdZ<3;gFuM|r+KM>>4PY1oaJ3dJkfGFWI((T%n#9G+)9 zbOH@9tNL5%I!<+;{>LaXpi7>gubeV4eq@n3lSIB1_~n{6OUYcAj{^J%I5m0+)z-=gJqF!$8?)~>iRd%Cz3(9P8gwq?PS6M{WKIOo z7~qnb8E1w*9_@;l8&?Yq(^59Sn{4H+j>LYM?s{+YA?jYDo9^o))75)_jo1NK-$<>^ zz~&91bxr&=Cy}D*jeqpuY#8iSoP7eRD9f6EdU1CgqL^H~T3 zP>0=4~epXGWxLVt)2?3l>rJX7l{(hhafU)%+t1*sZxs0svXDEvg*=dxp z(cbpH>aHKe__>lBa{y>yb*2vf>mZFRB(F^r|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