Skip to content

Commit 9bbebb7

Browse files
authored
GitHub Actions Setup (#95) (#107)
- Disable Travis-CI - 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 a2b7329) - Added sonatype snapshot deployment to main workflow for main branch commits (#98) (cherry picked from commit 36ac392) - exec-maven-plugin updated from v1.6.0 to v3.0.0 - jacoco-maven-plugin updated from v0.8.5 to v0.8.7 - maven-checkstyle-plugin updated from v3.1.1 to v3.1.2 - maven-ear-plugin updated from v3.0.2 to v3.2.0 - maven-gpg-plugin updated from v1.6 to v3.0.1 - maven-jxr-plugin updated from v3.0.0 to v3.1.1 - maven-war-plugin updated from v3.2.3 to v3.3.1 - Re-arrange maven plugin declarations to move version specification to plugin management section and execution/config info to plugins section (cherry picked from commit 0dfc7e6) - git-commit-id-plugin updated from v4.0.2 to v4.0.5 - maven-dependency-plugin updated from v3.1.2 to v3.2.0 - maven-javadoc-plugin updated from v3.2.0 to v3.3.0 (cherry picked from commit 046f9e4) - download-maven-plugin updated from v1.6.0 to v1.6.6 - checkstyle updated from v8.36 to v8.44 - logback updated from v1.2.3 to v1.2.4 - postgresql-jdbc updated from v42.2.16 to v42.2.23 - slf4j updated from v1.7.30 to v1.7.32 - testcontainers updated from v1.14.3 to v1.16.0 (cherry picked from commit a1bda73) - jts updated from v1.17.1 to v1.18.1 (cherry picked from commit 95fe87a) - spatial4j updated from v0.7 to v0.8 (cherry picked from commit f280b54) - add rule to maven-version-rules.xml to pin git-commit-id plugin version (#105) (cherry picked from commit 2112643)
1 parent 6c70ca0 commit 9bbebb7

File tree

11 files changed

+440
-141
lines changed

11 files changed

+440
-141
lines changed

.github/install-gpg.sh

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/usr/bin/env bash
2+
3+
set -euf
4+
5+
sudo apt-get update
6+
sudo apt-get install -y gnupg haveged
7+
8+
rm -rf ~/.gnupg
9+
gpg --list-keys
10+
11+
cat >key-info <<EOF
12+
%echo Generating a key
13+
Key-Type: RSA
14+
Key-Length: 4096
15+
Subkey-Type: RSA
16+
Subkey-Length: 4096
17+
Name-Real: PostGIS Development Team
18+
Name-Comment: PostGIS Development Team
19+
Name-Email: [email protected]
20+
Expire-Date: 0
21+
%no-ask-passphrase
22+
%no-protection
23+
%commit
24+
%echo done
25+
EOF
26+
27+
gpg --verbose --batch --gen-key key-info
28+
29+
echo -e "5\ny\n" | gpg --no-tty --command-fd 0 --expert --edit-key [email protected] trust;
30+
31+
# test
32+
gpg --list-keys
33+
gpg -e -a -r [email protected] key-info
34+
rm key-info
35+
gpg -d key-info.asc
36+
rm key-info.asc
37+
38+
set +euf

.github/install-maven.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env bash
2+
3+
set -euf
4+
5+
MAVEN_BASE_URL=https://archive.apache.org/dist/maven/maven-3/
6+
MAVEN_VERSION=3.8.1
7+
MAVEN_SHA=b98a1905eb554d07427b2e5509ff09bd53e2f1dd7a0afa38384968b113abef02
8+
9+
sudo apt-get update
10+
sudo apt-get install -y curl
11+
sudo mkdir -p /usr/share/maven /usr/share/maven/ref
12+
sudo curl -fsSL -o /tmp/apache-maven.tar.gz ${MAVEN_BASE_URL}/${MAVEN_VERSION}/binaries/apache-maven-${MAVEN_VERSION}-bin.tar.gz
13+
echo "${MAVEN_SHA} /tmp/apache-maven.tar.gz" | sha256sum -c -
14+
sudo tar -xzf /tmp/apache-maven.tar.gz -C /usr/share/maven --strip-components=1
15+
sudo rm -f /tmp/apache-maven.tar.gz
16+
sudo ln -fs /usr/share/maven/bin/mvn /usr/bin/mvn
17+
mvn -version
18+
19+
set +euf
20+

.github/install-zulu11.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/usr/bin/env bash
2+
3+
set -euf
4+
5+
AZUL_GPG_KEY=0xB1998361219BD9C9
6+
ZULU_VERSION=11
7+
ZULU_RELEASE=11.0.12-1
8+
9+
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys ${AZUL_GPG_KEY}
10+
sudo apt-add-repository 'deb http://repos.azulsystems.com/ubuntu stable main'
11+
sudo apt-get update
12+
sudo apt-get install -y zulu-repo
13+
sudo apt-get update
14+
sudo apt-get install -y zulu${ZULU_VERSION}=${ZULU_RELEASE}
15+
sudo sed -i.orig -e "s/^hl /jre /g" -e "s/^jdkhl /jdk /g" /usr/lib/jvm/.zulu${ZULU_VERSION}-ca-amd64.jinfo
16+
sudo update-java-alternatives --set zulu${ZULU_VERSION}-ca-amd64
17+
export ALTERNATIVES_JAVAC=$(realpath /etc/alternatives/javac)
18+
export JAVA_HOME=${ALTERNATIVES_JAVAC%/bin/javac}
19+
export PATH=$JAVA_HOME/bin:$PATH
20+
java -version
21+
22+
set +euf
23+

.github/install-zulu8.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/usr/bin/env bash
2+
3+
set -euf
4+
5+
AZUL_GPG_KEY=0xB1998361219BD9C9
6+
ZULU_VERSION=8
7+
ZULU_RELEASE=8.0.302-1
8+
9+
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys ${AZUL_GPG_KEY}
10+
sudo apt-add-repository 'deb http://repos.azulsystems.com/ubuntu stable main'
11+
sudo apt-get update
12+
sudo apt-get install -y zulu-repo
13+
sudo apt-get update
14+
sudo apt-get install -y zulu${ZULU_VERSION}=${ZULU_RELEASE}
15+
sudo sed -i.orig -e "s/^hl /jre /g" -e "s/^jdkhl /jdk /g" /usr/lib/jvm/.zulu${ZULU_VERSION}-ca-amd64.jinfo
16+
sudo update-java-alternatives --set zulu${ZULU_VERSION}-ca-amd64
17+
export ALTERNATIVES_JAVAC=$(realpath /etc/alternatives/javac)
18+
export JAVA_HOME=${ALTERNATIVES_JAVAC%/bin/javac}
19+
export PATH=$JAVA_HOME/bin:$PATH
20+
java -version
21+
22+
set +euf
23+

.github/settings.xml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
2+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
4+
<servers>
5+
<server>
6+
<id>ossrh</id>
7+
<username>${env.OSSRHU}</username>
8+
<password>${env.OSSRHT}</password>
9+
</server>
10+
</servers>
11+
<profiles>
12+
<profile>
13+
<id>gpg</id>
14+
<properties>
15+
<gpg.keyname>[email protected]</gpg.keyname>
16+
</properties>
17+
</profile>
18+
<profile>
19+
<id>sonatype-snapshots</id>
20+
<repositories>
21+
<repository>
22+
<id>sonatype-snapshots</id>
23+
<snapshots>
24+
<enabled>true</enabled>
25+
</snapshots>
26+
<name>sonatype-snapshots</name>
27+
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
28+
</repository>
29+
</repositories>
30+
</profile>
31+
<profile>
32+
<id>sonatype-staging</id>
33+
<repositories>
34+
<repository>
35+
<id>sonatype-staging</id>
36+
<snapshots>
37+
<enabled>true</enabled>
38+
</snapshots>
39+
<name>sonatype-staging</name>
40+
<url>https://oss.sonatype.org/content/groups/staging/</url>
41+
</repository>
42+
</repositories>
43+
</profile>
44+
<profile>
45+
<id>sonatype-releases</id>
46+
<repositories>
47+
<repository>
48+
<id>sonatype-releases</id>
49+
<snapshots>
50+
<enabled>true</enabled>
51+
</snapshots>
52+
<name>sonatype-releases</name>
53+
<url>https://oss.sonatype.org/content/groups/public/</url>
54+
</repository>
55+
</repositories>
56+
</profile>
57+
</profiles>
58+
59+
</settings>

.github/workflows/main.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: PostGIS Java CI
2+
3+
on: [push, pull_request]
4+
5+
defaults:
6+
run:
7+
shell: bash
8+
9+
jobs:
10+
build-codebase:
11+
strategy:
12+
matrix:
13+
os: [ubuntu-20.04]
14+
java_version: [8]
15+
maven_version: [3.8.1]
16+
include:
17+
- os: ubuntu-20.04
18+
java_version: 8
19+
maven_version: 3.8.1
20+
maven_deploy: true
21+
name: Build on OS ${{ matrix.os }} with Maven ${{ matrix.maven_version }} using Zulu ${{ matrix.java_version }}
22+
runs-on: ${{ matrix.os }}
23+
env:
24+
JAVA_HOME: /usr/lib/jvm/zulu${{ matrix.java_version }}-ca-amd64
25+
MAVEN_HOME: /usr/share/maven
26+
MAVEN_PROPS: -Djavadoc.path=`which javadoc`
27+
PROFILES: gpg,release-sign-artifacts,sonatype-deployment,sonatype-snapshots,sonatype-staging,sonatype-releases
28+
SETTINGS: .github/settings.xml
29+
30+
steps:
31+
- name: Checkout Source
32+
uses: actions/checkout@v2
33+
34+
- name: Install GPG and generate test key
35+
run: .github/install-gpg.sh
36+
37+
- name: Install Zulu OpenJDK
38+
run: .github/install-zulu${{ matrix.java_version }}.sh
39+
40+
- name: Install Maven
41+
run: .github/install-maven.sh
42+
43+
- name: Setup Maven repository cache
44+
uses: actions/cache@v2
45+
env:
46+
cache-name: m2repo
47+
with:
48+
path: ~/.m2/repository
49+
key: ${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }}
50+
restore-keys: |
51+
${{ env.cache-name }}-
52+
53+
- name: Log github.ref
54+
run: echo "${{ github.ref }}"
55+
56+
- name: Show Maven dependency tree
57+
run: mvn -U -V -s ${{ env.SETTINGS }} -P${{ env.PROFILES }} ${{ env.MAVEN_PROPS }} dependency:tree
58+
59+
- name: Show Maven active profiles
60+
run: mvn -U -V -s ${{ env.SETTINGS }} -P${{ env.PROFILES }} ${{ env.MAVEN_PROPS }} help:active-profiles
61+
62+
- name: Show Maven effective POM
63+
run: mvn -U -V -s ${{ env.SETTINGS }} -P${{ env.PROFILES }} ${{ env.MAVEN_PROPS }} help:effective-pom
64+
65+
- name: Maven build/test
66+
run: mvn -U -V -s ${{ env.SETTINGS }} -P${{ env.PROFILES }} ${{ env.MAVEN_PROPS }} clean install
67+
68+
- name: Maven deploy
69+
if: ${{ matrix.maven_deploy && (github.ref == 'refs/heads/main') && (github.event_name != 'pull_request') }}
70+
env:
71+
OSSRHU: ${{ secrets.OSSRHU }}
72+
OSSRHT: ${{ secrets.OSSRHT }}
73+
run: mvn -U -V -s ${{ env.SETTINGS }} -P${{ env.PROFILES }} ${{ env.MAVEN_PROPS }} deploy
File renamed without changes.

.travis/install-maven.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
set -euf
44

55
MAVEN_BASE_URL=https://archive.apache.org/dist/maven/maven-3/
6-
MAVEN_VERSION=3.6.3
7-
MAVEN_SHA=26ad91d751b3a9a53087aefa743f4e16a17741d3915b219cf74112bf87a438c5
6+
MAVEN_VERSION=3.8.1
7+
MAVEN_SHA=b98a1905eb554d07427b2e5509ff09bd53e2f1dd7a0afa38384968b113abef02
88

99
sudo apt-get update
1010
sudo apt-get install -y curl
@@ -13,7 +13,7 @@ sudo curl -fsSL -o /tmp/apache-maven.tar.gz ${MAVEN_BASE_URL}/${MAVEN_VERSION}/b
1313
echo "${MAVEN_SHA} /tmp/apache-maven.tar.gz" | sha256sum -c -
1414
sudo tar -xzf /tmp/apache-maven.tar.gz -C /usr/share/maven --strip-components=1
1515
sudo rm -f /tmp/apache-maven.tar.gz
16-
sudo ln -s /usr/share/maven/bin/mvn /usr/bin/mvn
16+
sudo ln -fs /usr/share/maven/bin/mvn /usr/bin/mvn
1717
mvn -version
1818

1919
set +euf

.travis/install-zulu.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ set -euf
44

55
AZUL_GPG_KEY=0xB1998361219BD9C9
66
ZULU_VERSION=8
7-
ZULU_RELEASE=8.0.265-5
7+
ZULU_RELEASE=8.0.302-1
88
JAVA_HOME=/usr/lib/jvm/zulu-8-amd64
99

1010
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys ${AZUL_GPG_KEY}
@@ -13,8 +13,8 @@ sudo apt-get update
1313
sudo apt-get install -y zulu-repo
1414
sudo apt-get update
1515
sudo apt-get install -y zulu${ZULU_VERSION}=${ZULU_RELEASE}
16-
sudo sed -i.orig -e "s/^hl /jre /g" -e "s/^jdkhl /jdk /g" /usr/lib/jvm/.zulu8-ca-amd64.jinfo
17-
sudo update-java-alternatives --set zulu8-ca-amd64
16+
sudo sed -i.orig -e "s/^hl /jre /g" -e "s/^jdkhl /jdk /g" /usr/lib/jvm/.zulu${ZULU_VERSION}-ca-amd64.jinfo
17+
sudo update-java-alternatives --set zulu${ZULU_VERSION}-ca-amd64
1818
export ALTERNATIVES_JAVAC=$(realpath /etc/alternatives/javac)
1919
export JAVA_HOME=${ALTERNATIVES_JAVAC%/bin/javac}
2020
export PATH=$JAVA_HOME/bin:$PATH

maven-version-rules.xml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,14 @@
99
<ignoreVersion type="regex">.*\.jre[6-7]</ignoreVersion>
1010
</ignoreVersions>
1111
<rules>
12+
<!-- Pin git-commit-id-plugin version to final release version before V5 until codebase migrates to Java11 -->
13+
<rule groupId="pl.project13.maven" artifactId="git-commit-id-plugin">
14+
<ignoreVersions>
15+
<ignoreVersion type="regex">4\.9\.9</ignoreVersion>
16+
</ignoreVersions>
17+
</rule>
1218
<!-- Pin testng version to pre-V7 -->
13-
<rule groupId="org.testng" artifactId="testng" comparisonMethod="maven">
19+
<rule groupId="org.testng" artifactId="testng">
1420
<ignoreVersions>
1521
<ignoreVersion type="regex">7\..*</ignoreVersion>
1622
</ignoreVersions>

0 commit comments

Comments
 (0)