From ff5de30e25b565411f029543d263130d5985e85f Mon Sep 17 00:00:00 2001 From: Henrique Truta Date: Tue, 21 Apr 2020 10:44:50 +0200 Subject: [PATCH 1/5] Add maven deploy step --- .github/workflows/maven.yml | 8 ++ pom.xml | 165 ++++++++++++++++++++++++++---------- 2 files changed, 129 insertions(+), 44 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 91bc2721..bcb9ebaa 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -33,3 +33,11 @@ jobs: run: | mvn clean verify -Pcoverage -Ppack --file pom.xml --batch-mode -Dsytle.colors=always --errors bash <(curl -s https://codecov.io/bash) -t $CODECOV_TOKEN -F unittests -f ./target/site/jacoco/jacoco.xml -n codecov-umbrella + - name: Release + # if: github.event_name == 'push' && github.ref == 'refs/heads/master' + uses: samuelmeuli/action-maven-publish@v1 + with: + gpg_private_key: ${{ secrets.gpg_private_key }} + gpg_passphrase: ${{ secrets.gpg_passphrase }} + nexus_username: ${{ secrets.nexus_username }} + nexus_password: ${{ secrets.nexus_password }} \ No newline at end of file diff --git a/pom.xml b/pom.xml index 114bd36d..fd2ec3fc 100644 --- a/pom.xml +++ b/pom.xml @@ -247,7 +247,7 @@ - + coverage @@ -302,8 +302,119 @@ - - + + + + pack + + + + + org.apache.maven.plugins + maven-shade-plugin + 3.2.0 + + + package + + shade + + + + + ${project.groupId}:${project.artifactId} + com.squareup.okhttp3 + com.squareup.okio + + + + + okhttp3 + ${shade.id}.okhttp3 + + + okio + ${shade.id}.okio + + + + + + + + + + + + deploy + + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.6 + + + sign-artifacts + verify + + sign + + + + --batch + --pinentry-mode + loopback + + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + attach-sources + + jar-no-fork + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.2.0 + + + attach-javadocs + + jar + + + + + 8 + + + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6.8 + true + + ossrh + https://oss.sonatype.org/ + true + + + + + + @@ -328,49 +439,15 @@ 2.19.1 - org.apache.maven.plugins - maven-source-plugin - 3.0.1 - - - attach-sources - - jar - - - - - - maven-javadoc-plugin - 3.0.1 - - - ${project.build.sourceDirectory}:${project.build.directory}/generated-sources/annotations - - - javax.annotation - javax.annotation-api - 1.3.2 - - - - none - - - - maven-release-plugin - 2.5.3 + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6.7 + true - v@{project.version} - true + ossrh + https://oss.sonatype.org/ + true - - - org.apache.maven.scm - maven-scm-provider-gitexe - 1.9 - - maven-jar-plugin From e175ffd0e578320e4b275b59a742405d11f56fa6 Mon Sep 17 00:00:00 2001 From: Henrique Truta Date: Tue, 21 Apr 2020 10:56:13 +0200 Subject: [PATCH 2/5] fix YAML --- .github/workflows/maven.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index bcb9ebaa..452d7417 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -33,11 +33,11 @@ jobs: run: | mvn clean verify -Pcoverage -Ppack --file pom.xml --batch-mode -Dsytle.colors=always --errors bash <(curl -s https://codecov.io/bash) -t $CODECOV_TOKEN -F unittests -f ./target/site/jacoco/jacoco.xml -n codecov-umbrella - - name: Release - # if: github.event_name == 'push' && github.ref == 'refs/heads/master' - uses: samuelmeuli/action-maven-publish@v1 - with: - gpg_private_key: ${{ secrets.gpg_private_key }} - gpg_passphrase: ${{ secrets.gpg_passphrase }} - nexus_username: ${{ secrets.nexus_username }} - nexus_password: ${{ secrets.nexus_password }} \ No newline at end of file + - name: Release + # if: github.event_name == 'push' && github.ref == 'refs/heads/master' + uses: samuelmeuli/action-maven-publish@v1 + with: + gpg_private_key: ${{ secrets.gpg_private_key }} + gpg_passphrase: ${{ secrets.gpg_passphrase }} + nexus_username: ${{ secrets.nexus_username }} + nexus_password: ${{ secrets.nexus_password }} \ No newline at end of file From 471422175524d451f95d611467d83ba603a55cba Mon Sep 17 00:00:00 2001 From: Henrique Truta Date: Tue, 21 Apr 2020 11:46:21 +0200 Subject: [PATCH 3/5] Fix maven shade and optimize CI --- .github/workflows/maven.yml | 24 ++++++------ pom.xml | 76 ++++++++++++++++--------------------- 2 files changed, 45 insertions(+), 55 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 452d7417..970d930f 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -27,17 +27,19 @@ jobs: server-id: github # Value of the distributionManagement/repository/id field of the pom.xml settings-path: ${{ github.workspace }} # location for the settings.xml file - - name: Build with Maven + - name: Build env: CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}} - run: | - mvn clean verify -Pcoverage -Ppack --file pom.xml --batch-mode -Dsytle.colors=always --errors - bash <(curl -s https://codecov.io/bash) -t $CODECOV_TOKEN -F unittests -f ./target/site/jacoco/jacoco.xml -n codecov-umbrella - - name: Release - # if: github.event_name == 'push' && github.ref == 'refs/heads/master' - uses: samuelmeuli/action-maven-publish@v1 + run: mvn -B package --file pom.xml -Pcoverage -Dsytle.colors=always --errors + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v1 with: - gpg_private_key: ${{ secrets.gpg_private_key }} - gpg_passphrase: ${{ secrets.gpg_passphrase }} - nexus_username: ${{ secrets.nexus_username }} - nexus_password: ${{ secrets.nexus_password }} \ No newline at end of file + token: ${{ secrets.CODECOV_TOKEN }} + - name: Release + # if: github.event_name == 'push' && github.ref == 'refs/heads/master' + uses: samuelmeuli/action-maven-publish@v1 + with: + gpg_private_key: ${{ secrets.gpg_private_key }} + gpg_passphrase: ${{ secrets.gpg_passphrase }} + nexus_username: ${{ secrets.nexus_username }} + nexus_password: ${{ secrets.nexus_password }} \ No newline at end of file diff --git a/pom.xml b/pom.xml index fd2ec3fc..15c34a8b 100644 --- a/pom.xml +++ b/pom.xml @@ -304,47 +304,6 @@ - - pack - - - - - org.apache.maven.plugins - maven-shade-plugin - 3.2.0 - - - package - - shade - - - - - ${project.groupId}:${project.artifactId} - com.squareup.okhttp3 - com.squareup.okio - - - - - okhttp3 - ${shade.id}.okhttp3 - - - okio - ${shade.id}.okio - - - - - - - - - - deploy @@ -396,9 +355,6 @@ - - 8 - org.sonatype.plugins @@ -510,6 +466,38 @@ ${project.build.sourceDirectory} + + org.apache.maven.plugins + maven-shade-plugin + 3.2.3 + + + package + + shade + + + + + ${project.groupId}:${project.artifactId} + com.squareup.okhttp3 + com.squareup.okio + + + + + okhttp3 + ${shade.id}.okhttp3 + + + okio + ${shade.id}.okio + + + + + + From 9cbe45363a06f6270de091f2bd0b9f7240eefc88 Mon Sep 17 00:00:00 2001 From: Henrique Truta Date: Tue, 21 Apr 2020 11:47:38 +0200 Subject: [PATCH 4/5] fix yaml --- .github/workflows/maven.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 970d930f..0e6e0f2b 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -36,10 +36,10 @@ jobs: with: token: ${{ secrets.CODECOV_TOKEN }} - name: Release - # if: github.event_name == 'push' && github.ref == 'refs/heads/master' - uses: samuelmeuli/action-maven-publish@v1 - with: - gpg_private_key: ${{ secrets.gpg_private_key }} - gpg_passphrase: ${{ secrets.gpg_passphrase }} - nexus_username: ${{ secrets.nexus_username }} - nexus_password: ${{ secrets.nexus_password }} \ No newline at end of file + # if: github.event_name == 'push' && github.ref == 'refs/heads/master' + uses: samuelmeuli/action-maven-publish@v1 + with: + gpg_private_key: ${{ secrets.gpg_private_key }} + gpg_passphrase: ${{ secrets.gpg_passphrase }} + nexus_username: ${{ secrets.nexus_username }} + nexus_password: ${{ secrets.nexus_password }} \ No newline at end of file From fe564a783bb68fab55cdcfea287c43c3c7730dc3 Mon Sep 17 00:00:00 2001 From: Henrique Truta Date: Tue, 21 Apr 2020 11:56:52 +0200 Subject: [PATCH 5/5] Fix javadoc plugin --- .github/workflows/pullrequest.yml | 32 ++++++++++++++++++++ .github/workflows/{maven.yml => release.yml} | 15 ++++----- pom.xml | 13 ++++++++ 3 files changed, 51 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/pullrequest.yml rename .github/workflows/{maven.yml => release.yml} (89%) diff --git a/.github/workflows/pullrequest.yml b/.github/workflows/pullrequest.yml new file mode 100644 index 00000000..d06f30ca --- /dev/null +++ b/.github/workflows/pullrequest.yml @@ -0,0 +1,32 @@ +# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created +# For more information see: https://github.com/actions/setup-java#apache-maven-with-a-settings-path + +name: maven-build + +on: + pull_request: + branches: + - master + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up JDK 1.11 + uses: actions/setup-java@v1 + with: + java-version: 1.11 + server-id: github # Value of the distributionManagement/repository/id field of the pom.xml + settings-path: ${{ github.workspace }} # location for the settings.xml file + + - name: Build + env: + CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}} + run: mvn -B package --file pom.xml -Pcoverage -Dsytle.colors=always --errors + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v1 + with: + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/maven.yml b/.github/workflows/release.yml similarity index 89% rename from .github/workflows/maven.yml rename to .github/workflows/release.yml index 0e6e0f2b..9417408c 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/release.yml @@ -1,17 +1,14 @@ # This workflow will build a package using Maven and then publish it to GitHub packages when a release is created # For more information see: https://github.com/actions/setup-java#apache-maven-with-a-settings-path -name: maven +name: maven-release on: - push: - branches: - - master - - 'releases/*' - - 'refs/tags/*' - pull_request: - branches: - - master + push: + branches: + - master + - 'releases/*' + - 'refs/tags/*' jobs: build: diff --git a/pom.xml b/pom.xml index 15c34a8b..541452ad 100644 --- a/pom.xml +++ b/pom.xml @@ -355,6 +355,19 @@ + + ${project.build.sourceDirectory}:${project.build.directory}/generated-sources/annotations + + + javax.annotation + javax.annotation-api + 1.3.2 + + + + none + + org.sonatype.plugins