From e09d97e8f617a24b7b9b35f86b9c56e8b6beb4bc Mon Sep 17 00:00:00 2001 From: Phillip Ross Date: Wed, 26 May 2021 13:13:49 -0400 Subject: [PATCH] GitHub Actions Setup (#95) * - Disable Travis-CI * - Update testcontainers to v1.15.3 * - Update checkstyle to v8.42 * - Update postgis/postgis test container from v12-3.0-alpine to v13-3.1-alpine * - Added windows-javadoc maven profile * - Move sonatype distro management bock to dedicated profile and replace with local staging distro spec * - Initial Github Actions setup (cherry picked from commit a2b7329f5a5ef24766fe77e8403171f47a8b68c0) --- .github/install-gpg.sh | 38 ++++++++++++++++++ .github/install-maven.sh | 20 ++++++++++ .github/install-zulu11.sh | 23 +++++++++++ .github/install-zulu8.sh | 23 +++++++++++ .github/settings.xml | 59 ++++++++++++++++++++++++++++ .github/workflows/main.yml | 61 +++++++++++++++++++++++++++++ .travis.yml => .travis.yml.disabled | 0 pom.xml | 43 ++++++++++++++------ 8 files changed, 256 insertions(+), 11 deletions(-) create mode 100755 .github/install-gpg.sh create mode 100755 .github/install-maven.sh create mode 100755 .github/install-zulu11.sh create mode 100755 .github/install-zulu8.sh create mode 100644 .github/settings.xml create mode 100644 .github/workflows/main.yml rename .travis.yml => .travis.yml.disabled (100%) diff --git a/.github/install-gpg.sh b/.github/install-gpg.sh new file mode 100755 index 0000000..b08a3d9 --- /dev/null +++ b/.github/install-gpg.sh @@ -0,0 +1,38 @@ +#!/usr/bin/env bash + +set -euf + +sudo apt-get update +sudo apt-get install -y gnupg haveged + +rm -rf ~/.gnupg +gpg --list-keys + +cat >key-info < + + + ossrh + ${env.OSSRHU} + ${env.OSSRHT} + + + + + gpg + + test-key@postgis.net + + + + sonatype-snapshots + + + sonatype-snapshots + + true + + sonatype-snapshots + https://oss.sonatype.org/content/repositories/snapshots/ + + + + + sonatype-staging + + + sonatype-staging + + true + + sonatype-staging + https://oss.sonatype.org/content/groups/staging/ + + + + + sonatype-releases + + + sonatype-releases + + true + + sonatype-releases + https://oss.sonatype.org/content/groups/public/ + + + + + + diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..98de2c1 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,61 @@ +name: PostGIS Java CI + +on: [push, pull_request] + +defaults: + run: + shell: bash + +jobs: + build-codebase: + strategy: + matrix: + os: [ubuntu-20.04] + java_version: [8] + maven_version: [3.8.1] + name: Build on OS ${{ matrix.os }} with Maven ${{ matrix.maven_version }} using Zulu ${{ matrix.java_version }} + runs-on: ${{ matrix.os }} + env: + JAVA_HOME: /usr/lib/jvm/zulu${{ matrix.java_version }}-ca-amd64 + MAVEN_HOME: /usr/share/maven + MAVEN_PROPS: -Djavadoc.path=`which javadoc` + PROFILES: gpg,release-sign-artifacts,sonatype-deployment,sonatype-snapshots,sonatype-staging,sonatype-releases + SETTINGS: .github/settings.xml + + steps: + - name: Checkout Source + uses: actions/checkout@v2 + + - name: Install GPG and generate test key + run: .github/install-gpg.sh + + - name: Install Zulu OpenJDK + run: .github/install-zulu${{ matrix.java_version }}.sh + + - name: Install Maven + run: .github/install-maven.sh + + - name: Setup Maven repository cache + uses: actions/cache@v2 + env: + cache-name: m2repo + with: + path: ~/.m2/repository + key: ${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ env.cache-name }}- + + - name: Log github.ref + run: echo "${{ github.ref }}" + + - name: Show Maven dependency tree + run: mvn -U -V -s ${{ env.SETTINGS }} -P${{ env.PROFILES }} ${{ env.MAVEN_PROPS }} dependency:tree + + - name: Show Maven active profiles + run: mvn -U -V -s ${{ env.SETTINGS }} -P${{ env.PROFILES }} ${{ env.MAVEN_PROPS }} help:active-profiles + + - name: Show Maven effective POM + run: mvn -U -V -s ${{ env.SETTINGS }} -P${{ env.PROFILES }} ${{ env.MAVEN_PROPS }} help:effective-pom + + - name: Maven build/test + run: mvn -U -V -s ${{ env.SETTINGS }} -P${{ env.PROFILES }} ${{ env.MAVEN_PROPS }} clean install diff --git a/.travis.yml b/.travis.yml.disabled similarity index 100% rename from .travis.yml rename to .travis.yml.disabled diff --git a/pom.xml b/pom.xml index 6f9e603..11a204c 100644 --- a/pom.xml +++ b/pom.xml @@ -86,14 +86,10 @@ https://github.com/postgis/postgis-java/issues - - ossrh - https://oss.sonatype.org/content/repositories/snapshots - - - ossrh - https://oss.sonatype.org/service/local/staging/deploy/maven2/ - + + local-staging-site + http://local-staging/ + @@ -108,7 +104,7 @@ false 1 true - postgis/postgis:12-3.0-alpine + postgis/postgis:13-3.1-alpine postgis1 postgis1 postgis1 @@ -145,13 +141,13 @@ 3.3.1 2.8.1 - 8.36 + 8.42 1.18.1 1.2.3 42.2.16 1.7.30 0.7 - 1.14.3 + 1.15.3 6.14.3 @@ -472,6 +468,18 @@ + + + windows-javadoc + + + windows + + + + ${java.home}/bin/javadoc.exe + + check-versions @@ -569,6 +577,19 @@ + + sonatype-deployment + + + ossrh + https://oss.sonatype.org/content/repositories/snapshots + + + ossrh + https://oss.sonatype.org/service/local/staging/deploy/maven2/ + + + SkipUnitTests