From 23d99f1162abbdfabb7d535f9b58bcb153077b70 Mon Sep 17 00:00:00 2001 From: lalbertson Date: Fri, 14 Feb 2020 15:17:37 -0800 Subject: [PATCH 1/2] Use openJdk instead of Oracle for Travis --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 968917c..16205ac 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,3 @@ language: java jdk: - - oraclejdk8 + - openjdk8 From f1d3e9d88e919017a298c70c9da79ca0293dd484 Mon Sep 17 00:00:00 2001 From: barefootlance Date: Wed, 4 Mar 2020 13:29:40 -0800 Subject: [PATCH 2/2] Deploy (#8) Automate the release process for tagged builds. --- .gitignore | 8 +++++- .maven.xml | 24 +++++++++++++++++ .travis.yml | 53 ++++++++++++++++++++++++++++++++++++-- gettyimagesapi-sdk/pom.xml | 26 ++++++++++++++----- pom.xml | 13 +++++++++- 5 files changed, 114 insertions(+), 10 deletions(-) create mode 100644 .maven.xml diff --git a/.gitignore b/.gitignore index 6b94106..d911b2d 100644 --- a/.gitignore +++ b/.gitignore @@ -49,7 +49,13 @@ fabric.properties # Editor-based Rest Client .idea/httpRequests +# Visual studio +/.vs/* + +# Visual studio code +/.vscode/* + **/target/ **/bin/ *.iml -.project \ No newline at end of file +.project diff --git a/.maven.xml b/.maven.xml new file mode 100644 index 0000000..b5326b4 --- /dev/null +++ b/.maven.xml @@ -0,0 +1,24 @@ + + + + + + ossrh + ${env.SONATYPE_USERNAME} + ${env.SONATYPE_PASSWORD} + + + + + + ossrh + + true + + + ${env.GPG_EXECUTABLE} + ${env.GPG_PASSPHRASE} + + + + \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 16205ac..a540498 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,52 @@ language: java -jdk: - - openjdk8 +jdk: # jdk versions to test against - https://www.deps.co/guides/travis-ci-latest-java/ + # Open JDK support: https://adoptopenjdk.net/support.html +- openjdk8 # LTS through at least 2023.09 +# It would be nice to test these, but multiple tests mean that Travis will do multiple +# deploys, only one of which would succeed. +#- openjdk11 # LTS through at least 2022.09 +#- openjdk-ea # early release - allow failures, but be aware that there *are* errors + +matrix: + allow_failures: # https://docs.travis-ci.com/user/build-matrix/#rows-that-are-allowed-to-fail + - jdk: openjdk-ea # allow early access version to fail + +before_install: + ## export GPG details + - echo $GPG_SECRET_KEYS | base64 --decode | $GPG_EXECUTABLE --import + - echo $GPG_OWNERTRUST | base64 --decode | $GPG_EXECUTABLE --import-ownertrust + +install: + mvn --settings .maven.xml install -DskipTests=true -Dgpg.skip -Dmaven.javadoc.skip=true -B -V + +script: + ## Build and release to maven central + mvn clean deploy --settings .maven.xml -DskipTests=true -B -U -P prepare_release + +before_deploy: + # Begin Extract the project version + - mvn help:evaluate -N -Dexpression=project.version|grep -v '\[' + - export project_version=$(mvn help:evaluate -N -Dexpression=project.version|grep -v '\[') + # End Extract + +deploy: + draft: false # set draft to true for testing - creates a draft build accessible only by collaborators + name: $project_version # use the project version extracted in before_deploy as the name + skip_cleanup: true # don't cleanup - we need the artifacts for deploying + + on: + repo: gettyimages/gettyimages-api_java + tags: true # only build tagged commits + + file: + - gettyimagesapi-sdk/target/gettyimagesapi-sdk-$project_version.jar + + + provider: releases # https://docs.travis-ci.com/user/deployment/releases + +# GITHUB_PERSONAL_ACCESS_TOKEN is an environment variable set in Travis-CI +# https://travis-ci.org/gettyimages/gettyimages-api_java/settings +# https://stackoverflow.com/questions/33735992/travis-ci-using-repository-environment-variables-in-travis-yml +# It must be enabled for the branch you're working on. NOTE: you can't use an environment variable because they're not set here. + api_key: + secure: pJkTcxWJUO0eJK6fH5D7Vb3BEQoc9tnKGX5pTa7n6OCqJU3qQHJVVpAphoCW5BfYQl1A7svNYGNZh7l/quzznxhBLS1HoV78AJcM4PnL1L/WuSgSIHDwOUZpZ1xctqMcZFh1+oavR4tRTk/mvcjBmUrcR1nOgctdx19i5/FzN7AlVwQZDZi80pd1Q/XnK0ID71GDQ0Zrb0w3Txi4/xHgsDbkN6By0wdCKd3slnYX6Bdd3zLSSGYmqdWWHMUgWrU8yMXwAP5G0lgksNBKv71JxBx6ZJE0QOeqvbIeIn9zLbRxHQKgbw9gJBeXHmlQBcbE+yJ5SqAfuPguSWQRs9PbCEx4GiXvgnU2G45qIBDm5d+82U+Sag+fLdl1/tktnVX7Hn6rJHGWUme/91wObvQRIV52CmV2+G3e49hR5DkNN7+yd/aL6fBTmT5wLKyabI2wf3birmlRScYtKT7uhi4pbBbolDJKubizegJB/48VhKHj6s4XujTCycorE9ucHLbgaAEDQID3inMvHy/fCH0PucAsToae+Yu+MmbSqqsu/899M2jzckCB42oWwseaFmKfGWTdrIwWkz5Bjp73f9dpcD25zo3q9gIFrbuyv2+XJMkQj2OLpTXXK84RW13YsMD8DmrEQya9rFhJsnN8uujoRBk4L9yCYy/PqfST9DV56vQ= diff --git a/gettyimagesapi-sdk/pom.xml b/gettyimagesapi-sdk/pom.xml index 478ad9a..c088b60 100644 --- a/gettyimagesapi-sdk/pom.xml +++ b/gettyimagesapi-sdk/pom.xml @@ -4,7 +4,7 @@ com.gettyimages gettyimagesapi-sdk - 3.0.0 + 3.0.3 gettyimagesapi-sdk A SDK for Getty Images API http://api.gettyimages.com @@ -34,6 +34,17 @@ https://github.com/gettyimages/gettyimages-api_java + + + ossrh + https://oss.sonatype.org/content/repositories/snapshots + + + ossrh + https://oss.sonatype.org/service/local/staging/deploy/maven2/ + + + org.json @@ -106,18 +117,18 @@ org.sonatype.plugins nexus-staging-maven-plugin - 1.6.7 + 1.6.8 true ossrh https://oss.sonatype.org/ - false + true org.apache.maven.plugins maven-source-plugin - 2.2.1 + 3.0.1 attach-sources @@ -130,7 +141,10 @@ org.apache.maven.plugins maven-javadoc-plugin - 2.9.1 + 2.10.4 + + 8 + attach-javadocs @@ -143,7 +157,7 @@ org.apache.maven.plugins maven-gpg-plugin - 1.5 + 1.6 sign-artifacts diff --git a/pom.xml b/pom.xml index 85ff8f0..62ed134 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.gettyimages gettyimagesapi - 3.0.0 + 3.0.3 pom gettyimagesapi @@ -17,4 +17,15 @@ gettyimagesapi-sdk + + + + ossrh + https://oss.sonatype.org/content/repositories/snapshots + + + ossrh + https://oss.sonatype.org/service/local/staging/deploy/maven2/ + +