Skip to content

Commit

Permalink
build: Add release infrastructure.
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-simons committed Feb 28, 2024
1 parent 783d95f commit 2c8056f
Show file tree
Hide file tree
Showing 5 changed files with 104 additions and 5 deletions.
27 changes: 24 additions & 3 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Michael Simons <[email protected]>
// tag::properties[]
:groupId: org.neo4j
:artifactIdCore: neo4j-jdbc
:latest_version: 6.0.0-SNAPSHOT
:branch: main
// end::properties[]

Expand All @@ -32,8 +33,28 @@ image:https://sonar.neo4j.ninja/api/project_badges/measure?project=neo4j-jdbc&to

== Download

The Maven coordinates in the documentation and corresponding README are not yet live.
In the meantime you can grab a packaged binary from the https://github.com/neo4j/neo4j-jdbc/releases/tag/early-access[early access release page], which will be actively updated.
=== Include in a Maven build

[source,xml,subs="verbatim,attributes"]
----
<dependency>
<groupId>{groupId}</groupId>
<artifactId>{artifactIdCore}-full-bundle</artifactId>
<version>{latest_version}</version>
</dependency>
----

=== Include in a Gradle build

[source,groovy,subs="verbatim,attributes"]
----
dependencies {
implementation '{groupId}:{artifactIdCore}-full-bundle:{latest_version}'
}
----

All https://github.com/neo4j/neo4j-jdbc/releases/[releases] from 6.0 onwards contain a zipped version of the driver, including a PDF version of the manual.
We offer several distributions, please have a look http://neo4j.github.io/neo4j-jdbc/${latest_version}/#_distribution[here] for more details.
If you feel adventurous, grab the code and build the driver yourself.
You find the instructions in our link:CONTRIBUTING.adoc[contribution documentation].

Expand Down Expand Up @@ -92,7 +113,7 @@ In case of https://quarkus.io[Quarkus] the Neo4j JDBC Driver is an option to con

While there is little incentive to use this driver with Hibernate (https://github.com/neo4j/neo4j-ogm[Neo4j-OGM] or SDN are the better alternatives for Neo4j), it might be worth giving https://spring.io/projects/spring-data-jdbc/[Spring Data JDBC] a try.

=== Differences to the previous versionsof this driver and other JDBC drivers for Neo4j
=== Differences to the previous versions of this driver and other JDBC drivers for Neo4j

Several other JDBC drivers exists for Neo4j, most notably the previous versions 4 and 5 of this driver, originally developed by http://larus-ba.it/[Larus BA, Italy] for Neo4j.
Most—if not all of them—do wrap the common Neo4j Java Driver and implement the JDBC spec on top of that.
Expand Down
38 changes: 38 additions & 0 deletions bin/prepare-release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/usr/bin/env bash
#
# Copyright (c) 2023-2024 "Neo4j,"
# Neo4j Sweden AB [https://neo4j.com]
#
# This file is part of Neo4j.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#


set -euo pipefail
DIR="$(dirname "$(realpath "$0")")"

sed -i.bak 's/\(:latest_version:\) \(.*\)/\1 '"${1}"'/g' $DIR/../README.adoc

rm $DIR/../README.adoc.bak

if test -n "${2-}"; then
DRYRUN=$2
else
DRYRUN='false'
fi

if [ "$DRYRUN" != "true" ]; then
git add $DIR/../README.adoc
git commit -m "[maven-release-plugin] update README.adoc"
fi
9 changes: 8 additions & 1 deletion neo4j-jdbc-it/neo4j-jdbc-it-mp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
<time>20000</time>
</wait>
<ports>
<port>it-database-port:7687</port>
<port>+neo4j-ip:it-database-port:7687</port>
</ports>
</run>
</image>
Expand All @@ -83,13 +83,19 @@
<goal>start</goal>
</goals>
<phase>pre-integration-test</phase>
<configuration>
<skip>${skipTests}</skip>
</configuration>
</execution>
<execution>
<id>remove-it-database</id>
<goals>
<goal>stop</goal>
</goals>
<phase>post-integration-test</phase>
<configuration>
<skip>${skipTests}</skip>
</configuration>
</execution>
</executions>
</plugin>
Expand All @@ -99,6 +105,7 @@
<version>${maven-failsafe-plugin.version}</version>
<configuration combine.self="append">
<systemPropertyVariables>
<it-database-host>${neo4j-ip}</it-database-host>
<it-database-port>${it-database-port}</it-database-port>
<it-database-password>${neo4j.password}</it-database-password>
</systemPropertyVariables>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ private static int getPort() {
}

private static String getHost() {
return "localhost";
return System.getProperty("it-database-host", "localhost");
}

private static String getPassword() {
Expand Down
33 changes: 33 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@
<maven-install-plugin.version>3.1.1</maven-install-plugin.version>
<maven-jar-plugin.version>3.3.0</maven-jar-plugin.version>
<maven-javadoc-plugin.version>3.6.3</maven-javadoc-plugin.version>
<maven-release-plugin.version>3.0.1</maven-release-plugin.version>
<maven-resources-plugin.version>3.3.1</maven-resources-plugin.version>
<maven-shade-plugin.version>3.5.2</maven-shade-plugin.version>
<maven-source-plugin.version>3.3.0</maven-source-plugin.version>
Expand Down Expand Up @@ -567,6 +568,22 @@
<configuration>
<skip>true</skip>
</configuration>
<executions>
<execution>
<id>prepare-release</id>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>bin/prepare-release.sh</executable>
<arguments>
<argument>${project.version}</argument>
<argument>${isDryRun}</argument>
</arguments>
<skip>true</skip>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.moditect</groupId>
Expand Down Expand Up @@ -759,6 +776,22 @@
</jreleaser>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>${maven-release-plugin.version}</version>
<configuration>
<autoVersionSubmodules>true</autoVersionSubmodules>
<useReleaseProfile>false</useReleaseProfile>
<releaseProfiles>release</releaseProfiles>
<tagNameFormat>@{project.version}</tagNameFormat>
<goals>deploy</goals>
<arguments>-Drelease -Dgpg.skip=${skipSigning} -DskipTests=${skipTestsDuringRelease} -DisDryRun=${dryRun}</arguments>
<preparationGoals>clean exec:exec@prepare-release verify</preparationGoals>
<pushChanges>false</pushChanges>
<localCheckout>true</localCheckout>
</configuration>
</plugin>
</plugins>
</build>

Expand Down

0 comments on commit 2c8056f

Please sign in to comment.