-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dev: prepare spring data jdbc ydb dialect (#139)
- Loading branch information
1 parent
41a1127
commit aa90634
Showing
39 changed files
with
519 additions
and
449 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
name: Spring Data JDBC YDB Dialect CI with Maven | ||
|
||
on: | ||
push: | ||
paths: | ||
- 'spring-data-dialect/**' | ||
branches: | ||
- main | ||
pull_request: | ||
paths: | ||
- 'spring-data-dialect/**' | ||
|
||
env: | ||
MAVEN_ARGS: --batch-mode --update-snapshots -Dstyle.color=always | ||
|
||
jobs: | ||
build: | ||
name: Spring Data JDBC YDB Dialect | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
java: [ '17', '21' ] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up JDK ${{matrix.java}} | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: ${{matrix.java}} | ||
distribution: 'temurin' | ||
cache: maven | ||
|
||
- name: Extract spring-data-jdbc YDB dialect version | ||
working-directory: ./spring-data-dialect | ||
run: | | ||
VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) | ||
echo "SPRING_DATA_JDBC_DIALECT_VERSION=$VERSION" >> "$GITHUB_ENV" | ||
- name: Download spring-data-jdbc YDB dialect dependencies | ||
working-directory: ./spring-data-dialect | ||
run: mvn $MAVEN_ARGS dependency:go-offline | ||
|
||
- name: Build spring-data-jdbc YDB dialect | ||
working-directory: ./spring-data-dialect | ||
run: mvn $MAVEN_ARGS install | ||
|
||
# - uses: actions/checkout@v4 | ||
# with: | ||
# repository: ydb-platform/ydb-java-examples | ||
# ref: master | ||
# path: examples | ||
# | ||
# - name: Download dependencies | ||
# working-directory: ./examples/jdbc/spring-data-jpa-v5 | ||
# run: mvn $MAVEN_ARGS -Dspring.data.jdbc.ydb.dialect.version=$SPRING_DATA_JDBC_DIALECT_VERSION dependency:go-offline | ||
# | ||
# - name: Test examples with Maven | ||
# working-directory: ./examples/jdbc/spring-data-jpa-v5 | ||
# run: mvn $MAVEN_ARGS -Dspring.data.jdbc.ydb.dialect.version=$SPRING_DATA_JDBC_DIALECT_VERSION test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
name: Publish Spring Data JDBC YDB Dialect | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'spring-data-jdbc-ydb/v[0-9]+.[0-9]+.[0-9]+' | ||
|
||
env: | ||
MAVEN_ARGS: --batch-mode --no-transfer-progress -Dstyle.color=always | ||
|
||
jobs: | ||
validate: | ||
name: Validate Spring Data JDBC YDB Dialect | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Extract spring-data-jdbc YDB dialect version | ||
run: | | ||
cd spring-data-dialect | ||
SPRING_DATA_JDBC_DIALECT_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) | ||
echo "SPRING_DATA_JDBC_DIALECT_VERSION=SPRING_DATA_JDBC_DIALECT_VERSION" >> "$GITHUB_ENV" | ||
- name: Fail workflow if version is snapshot | ||
if: endsWith(env.SPRING_DATA_JDBC_DIALECT_VERSION, 'SNAPSHOT') | ||
uses: actions/github-script@v6 | ||
with: | ||
script: core.setFailed('SNAPSHOT version cannot be published') | ||
|
||
- name: Fail workflow if version is not equal to tag name | ||
if: format('spring-data-jdbc-ydb/v{0}', env.SPRING_DATA_JDBC_DIALECT_VERSION) != github.ref_name | ||
uses: actions/github-script@v6 | ||
with: | ||
script: core.setFailed('Release name must be equal to project version') | ||
|
||
- name: Set up JDK | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: 17 | ||
distribution: 'temurin' | ||
cache: 'maven' | ||
|
||
- name: Download dependencies | ||
run: | | ||
cd spring-data-dialect | ||
mvn $MAVEN_ARGS dependency:go-offline | ||
- name: Build with Maven | ||
run: | | ||
cd spring-data-dialect | ||
mvn $MAVEN_ARGS package | ||
publish: | ||
name: Publish Spring Data JDBC YDB Dialect | ||
runs-on: ubuntu-latest | ||
needs: validate | ||
|
||
steps: | ||
- name: Install gpg secret key | ||
run: | | ||
# Install gpg secret key | ||
cat <(echo -e "${{ secrets.MAVEN_OSSRH_GPG_SECRET_KEY }}") | gpg --batch --import | ||
# Verify gpg secret key | ||
gpg --list-secret-keys --keyid-format LONG | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Maven Central Repository | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: 17 | ||
distribution: 'temurin' | ||
cache: 'maven' | ||
server-id: ossrh-s01 | ||
server-username: MAVEN_USERNAME | ||
server-password: MAVEN_PASSWORD | ||
|
||
- name: Publish package | ||
run: | | ||
cd spring-data-dialect | ||
mvn $MAVEN_ARGS -Possrh-s01 -Dgpg.passphrase=${{ secrets.MAVEN_OSSRH_GPG_PASSWORD }} clean deploy | ||
env: | ||
MAVEN_USERNAME: ${{ secrets.MAVEN_OSSRH_USERNAME }} | ||
MAVEN_PASSWORD: ${{ secrets.MAVEN_OSSRH_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,36 +8,54 @@ | |
<artifactId>spring-data-ydb-dialect</artifactId> | ||
<version>0.9.1-SNAPSHOT</version> | ||
|
||
<name>Spring Data YDB Dialect</name> | ||
<name>Spring Data JDBC YDB Dialect</name> | ||
<description>Support Spring Data JDBC YDB (YQL) Dialect</description> | ||
<url>https://github.com/ydb-platform/ydb-java-dialects</url> | ||
|
||
<packaging>jar</packaging> | ||
|
||
<developers> | ||
<developer> | ||
<name>Madiyar Nurgazin</name> | ||
<email>[email protected]</email> | ||
<organization>YDB</organization> | ||
<organizationUrl>https://ydb.tech/</organizationUrl> | ||
</developer> | ||
<developer> | ||
<name>Kirill Kurdyukov</name> | ||
<email>[email protected]</email> | ||
<organization>YDB</organization> | ||
<organizationUrl>https://ydb.tech/</organizationUrl> | ||
</developer> | ||
</developers> | ||
|
||
<scm> | ||
<url>https://github.com/ydb-platform/ydb-java-dialects</url> | ||
<connection>scm:git:https://github.com/ydb-platform/ydb-java-dialects.git</connection> | ||
<developerConnection>scm:git:https://github.com/ydb-platform/ydb-java-dialects.git</developerConnection> | ||
</scm> | ||
|
||
<licenses> | ||
<license> | ||
<name>Apache License, Version 2.0</name> | ||
<url>https://www.apache.org/licenses/LICENSE-2.0</url> | ||
</license> | ||
</licenses> | ||
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
|
||
<maven.compiler.release>17</maven.compiler.release> | ||
|
||
<maven.compiler.target>17</maven.compiler.target> | ||
<maven.compiler.source>17</maven.compiler.source> | ||
|
||
<springdata.jdbc.version>3.2.4</springdata.jdbc.version> | ||
|
||
<junit5.version>5.10.2</junit5.version> | ||
<lombok.version>1.18.30</lombok.version> | ||
<spring.boot.version>3.2.3</spring.boot.version> | ||
<spring.version>3.2.1</spring.version> | ||
<liquibase.version>4.24.0</liquibase.version> | ||
|
||
<ydb.sdk.version>2.2.6</ydb.sdk.version> | ||
<ydb.jdbc.version>2.1.5</ydb.jdbc.version> | ||
<ydb.sdk.version>2.2.9</ydb.sdk.version> | ||
<ydb.jdbc.version>2.2.3</ydb.jdbc.version> | ||
<ydb.liquibase.version>0.9.7</ydb.liquibase.version> | ||
</properties> | ||
|
||
|
@@ -50,21 +68,29 @@ | |
<type>pom</type> | ||
<scope>import</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-dependencies</artifactId> | ||
<version>${spring.version}</version> | ||
<scope>import</scope> | ||
<type>pom</type> | ||
</dependency> | ||
</dependencies> | ||
</dependencyManagement> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.springframework.data</groupId> | ||
<artifactId>spring-data-jdbc</artifactId> | ||
<version>${springdata.jdbc.version}</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>tech.ydb.jdbc</groupId> | ||
<artifactId>ydb-jdbc-driver-shaded</artifactId> | ||
<artifactId>ydb-jdbc-driver</artifactId> | ||
<version>${ydb.jdbc.version}</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>tech.ydb.test</groupId> | ||
<artifactId>ydb-junit5-support</artifactId> | ||
|
@@ -73,7 +99,6 @@ | |
<dependency> | ||
<groupId>org.junit.jupiter</groupId> | ||
<artifactId>junit-jupiter-api</artifactId> | ||
<version>${junit5.version}</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
|
@@ -85,13 +110,11 @@ | |
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-test</artifactId> | ||
<version>${spring.boot.version}</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-jdbc</artifactId> | ||
<version>${spring.boot.version}</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
|
@@ -107,4 +130,90 @@ | |
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-javadoc-plugin</artifactId> | ||
<version>3.5.0</version> | ||
<configuration> | ||
<source>17</source> | ||
</configuration> | ||
<executions> | ||
<execution> | ||
<id>attach-javadocs</id> | ||
<goals> | ||
<goal>jar</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-source-plugin</artifactId> | ||
<version>3.2.1</version> | ||
<executions> | ||
<execution> | ||
<id>attach-sources</id> | ||
<goals> | ||
<goal>jar-no-fork</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-surefire-plugin</artifactId> | ||
<version>3.1.0</version> | ||
<configuration> | ||
<environmentVariables> | ||
<TESTCONTAINERS_REUSE_ENABLE>true</TESTCONTAINERS_REUSE_ENABLE> | ||
</environmentVariables> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
<profiles> | ||
<profile> | ||
<id>ossrh-s01</id> | ||
<activation> | ||
<activeByDefault>false</activeByDefault> | ||
</activation> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-gpg-plugin</artifactId> | ||
<version>1.6</version> | ||
<executions> | ||
<execution> | ||
<id>sign-artifacts</id> | ||
<phase>verify</phase> | ||
<goals> | ||
<goal>sign</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
<configuration> | ||
<gpgArguments> | ||
<arg>--pinentry-mode</arg> | ||
<arg>loopback</arg> | ||
</gpgArguments> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.sonatype.plugins</groupId> | ||
<artifactId>nexus-staging-maven-plugin</artifactId> | ||
<version>1.6.8</version> | ||
<extensions>true</extensions> | ||
<configuration> | ||
<serverId>ossrh-s01</serverId> | ||
<nexusUrl>https://s01.oss.sonatype.org/</nexusUrl> | ||
<autoReleaseAfterClose>false</autoReleaseAfterClose> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</profile> | ||
</profiles> | ||
</project> |
1 change: 0 additions & 1 deletion
1
spring-data-dialect/src/main/java/tech/ydb/data/core/convert/YQLType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.