-
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.
JOOQ dialects module and actions (#40)
- Loading branch information
Showing
10 changed files
with
183 additions
and
23 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
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 |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: YDB JOOQ Dialect CI with Maven | ||
|
||
on: | ||
push: | ||
paths: | ||
- 'jooq-dialect/**' | ||
branches: | ||
- main | ||
pull_request: | ||
paths: | ||
- 'jooq-dialect/**' | ||
types: | ||
- opened | ||
- reopened | ||
- edited | ||
|
||
env: | ||
MAVEN_ARGS: --batch-mode --update-snapshots -Dstyle.color=always | ||
|
||
jobs: | ||
build: | ||
name: YDB Java JOOQ Dialect | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
java: [ '11', '17' ] | ||
|
||
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 JOOQ Dialect version | ||
working-directory: ./jooq-dialect | ||
run: | | ||
VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) | ||
echo "JOOQ_DIALECT_VERSION=$VERSION" >> "$GITHUB_ENV" | ||
- name: Download JOOQ Dialect dependencies | ||
working-directory: ./jooq-dialect | ||
run: mvn $MAVEN_ARGS dependency:go-offline | ||
|
||
- name: Build JOOQ Dialect | ||
working-directory: ./jooq-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 | ||
# run: mvn $MAVEN_ARGS -Dhibernate.ydb.dialect.version=$HIBERNATE_DIALECT_VERSION dependency:go-offline | ||
# | ||
# - name: Test examples with Maven | ||
# working-directory: ./examples/jdbc/spring-data-jpa | ||
# run: mvn $MAVEN_ARGS -Dhibernate.ydb.dialect.version=$HIBERNATE_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
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 |
---|---|---|
@@ -0,0 +1,85 @@ | ||
name: Publish YDB JOOQ Dialect | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'jooq-ydb/v[0-9]+.[0-9]+.[0-9]+' | ||
|
||
env: | ||
MAVEN_ARGS: --batch-mode --no-transfer-progress -Dstyle.color=always | ||
|
||
jobs: | ||
validate: | ||
name: Validate YDB JOOQ Dialect | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Extract JOOQ dialect version | ||
run: | | ||
cd jooq-dialect | ||
JOOQ_DIALECT_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) | ||
echo "JOOQ_DIALECT_VERSION=$JOOQ_DIALECT_VERSION" >> "$GITHUB_ENV" | ||
- name: Fail workflow if version is snapshot | ||
if: endsWith(env.JOOQ_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('jooq-ydb/v{0}', env.JOOQ_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 jooq-dialect | ||
mvn $MAVEN_ARGS dependency:go-offline | ||
- name: Build with Maven | ||
run: | | ||
cd jooq-dialect | ||
mvn $MAVEN_ARGS package | ||
publish: | ||
name: Publish YDB JOOQ 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 jooq-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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[](https://github.com/ydb-platform/ydb-java-dialects/blob/main/LICENSE.md) | ||
[](https://mvnrepository.com/artifact/tech.ydb.dialects/jooq-ydb-dialect) | ||
[](https://github.com/ydb-platform/ydb-java-dialects/actions/workflows/ci-jooq-dialect.yaml) | ||
|
||
# YDB JOOQ Dialect |
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
File renamed without changes.