From 9b0c2cd4676a7f0518233e8d3f3db5216bf51460 Mon Sep 17 00:00:00 2001 From: CorvusYe Date: Mon, 30 Sep 2024 14:50:34 +0800 Subject: [PATCH 1/2] chore: fix the release workflow. --- .github/workflows/release.yml | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 347191d..a73ff75 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,7 +9,12 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Check out Git repository - uses: actions/checkout@v3 + uses: actions/checkout@v2 + + - name: Install Java and Maven + uses: actions/setup-java@v1 + with: + java-version: 1.8 - name: Install nebula-graph run: | @@ -24,20 +29,10 @@ jobs: popd popd - - name: Setup Java and Apache Maven Central - uses: actions/setup-java@v3 + - name: Deploy Snapshot to Maven package + uses: samuelmeuli/action-maven-publish@v1 with: - java-version: '8' - distribution: 'temurin' - gpg-private-key: ${{ secrets.GPG_SECRET }} # Import GPG key - gpg-passphrase: ${{ secrets.GPG_PASSWORD }} # GPG passphrase - server-id: ossrh # Server ID for Maven Central - server-username: MAVEN_USERNAME # Environment variable for Maven username - server-password: MAVEN_PASSWORD # Environment variable for Maven password - - - name: Publish package - run: mvn --batch-mode -e deploy - env: - MAVEN_USERNAME: ${{ secrets.OSSRH_USER }} - MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} - MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSWORD }} + gpg_private_key: ${{ secrets.GPG_SECRET }} + gpg_passphrase: ${{ secrets.GPG_PASSWORD }} + nexus_username: ${{ secrets.OSSRH_USER }} + nexus_password: ${{ secrets.OSSRH_PASSWORD }} From 340ff44087c45cf86bd8da3550e64e2449f2376f Mon Sep 17 00:00:00 2001 From: CorvusYe Date: Mon, 30 Sep 2024 15:10:07 +0800 Subject: [PATCH 2/2] lint: style check --- CHANGELOG.md | 6 +++--- .../nebula/contrib/ngbatis/io/MapperResourceLoader.java | 8 +++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c1b24d2..aee97c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -55,7 +55,7 @@ This source code is licensed under Apache 2.0 License. > http2 属于企业版的数据库才支持,但我没有测试环境,所以不确定是否可用。 > http2 is supported by the enterprise version of the database, but I don't have a test environment, so I'm not sure if it works. - feat: support adding ID attributes of start and end nodes in edge entities. - > 通过 @DstId, @SrcId 进行注解,可以将属性标记成特殊的属性,用于查询时可以填充的起始点和终点的id值。 + > 通过 `@DstId`, `@SrcId` 进行注解,可以将属性标记成特殊的属性,用于查询时可以填充的起始点和终点的id值。 - example: @@ -78,8 +78,8 @@ This source code is licensed under Apache 2.0 License. Route-Tag: abc ``` -- feat: @Space annotation supports dynamic configuration. - > @Space 注解的 name 属性值可通过 spring 配置文件自定义配置。 +- feat: `@Space` annotation supports dynamic configuration. + > `@Space` 注解的 name 属性值可通过 spring 配置文件自定义配置。 - example: ```yaml diff --git a/src/main/java/org/nebula/contrib/ngbatis/io/MapperResourceLoader.java b/src/main/java/org/nebula/contrib/ngbatis/io/MapperResourceLoader.java index ce7e196..2652163 100644 --- a/src/main/java/org/nebula/contrib/ngbatis/io/MapperResourceLoader.java +++ b/src/main/java/org/nebula/contrib/ngbatis/io/MapperResourceLoader.java @@ -155,7 +155,7 @@ private void setClassModelBySpaceAnnotation(ClassModel cm) { } String spaceClassName = genericTypes[0].getTypeName(); Space annotation = Class.forName(spaceClassName).getAnnotation(Space.class); - if(null != annotation){ + if (null != annotation) { String spaceName = tryResolvePlaceholder(annotation.name()); if (!spaceName.equals("")) { cm.setSpace(spaceName); @@ -172,13 +172,15 @@ private void setClassModelBySpaceAnnotation(ClassModel cm) { * @return resolveResult 解析结果 * @throws IllegalArgumentException 当配置了 ${xx.xx} 占位符,且spring配置文件中未指定该配置时抛出 */ - private String tryResolvePlaceholder(String value){ + private String tryResolvePlaceholder(String value) { String resolveResult = value; if (null != applicationContext) { try { resolveResult = applicationContext.getEnvironment().resolveRequiredPlaceholders(value); } catch (IllegalArgumentException e) { - throw new ResourceLoadException("name ( "+ value +" ) of @Space missing configurable value"); + throw new ResourceLoadException( + "name ( " + value + " ) of @Space missing configurable value" + ); } } return resolveResult;