From 07cb18cfc10b64cdf007fe82c2a9f4e1c0d848d0 Mon Sep 17 00:00:00 2001 From: welsir <1824379011@qq.com> Date: Tue, 30 Dec 2025 20:16:29 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=BC=80=E5=8F=91]=20release=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/PushSDK.yml | 19 +++--- pom.xml | 61 +++++++++++-------- tml-sdk-java-core/pom.xml | 3 + tml-sdk-java-web/pom.xml | 3 + .../common/resp/ResultTest.java | 4 +- .../src/test/resources/application.yml | 24 ++++---- 6 files changed, 65 insertions(+), 49 deletions(-) diff --git a/.github/workflows/PushSDK.yml b/.github/workflows/PushSDK.yml index 7c48560..3ba4f41 100644 --- a/.github/workflows/PushSDK.yml +++ b/.github/workflows/PushSDK.yml @@ -51,25 +51,24 @@ jobs: OSSRH_TOKEN_USERNAME: ${{ secrets.OSSRH_TOKEN_USERNAME }} OSSRH_TOKEN_PASSWORD: ${{ secrets.OSSRH_TOKEN_PASSWORD }} + - name: Import GPG key + uses: crazy-max/ghaction-import-gpg@v6 + with: + gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} + passphrase: ${{ secrets.GPG_PASSPHRASE }} + - name: Show Java and Maven versions run: | java -version mvn -v - - name: Probe s01 with token (no secrets printed) - run: | - code=$(curl -s -o /dev/null -w "%{http_code}" -u "${OSSRH_TOKEN_USERNAME}:${OSSRH_TOKEN_PASSWORD}" "https://s01.oss.sonatype.org/service/local/status") - echo "status_code=$code" - env: - OSSRH_TOKEN_USERNAME: ${{ secrets.OSSRH_TOKEN_USERNAME }} - OSSRH_TOKEN_PASSWORD: ${{ secrets.OSSRH_TOKEN_PASSWORD }} - - - name: Deploy (skip tests and gpg signing for now) + - name: Deploy to Central Portal run: | mvn -X -B -U \ -DskipTests=true \ - -Dgpg.skip=true \ clean deploy + env: + GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} # 如果你的 POM 未配置 distributionManagement,或想强制直传,可用下面这个步骤替代上面的 Deploy: # - name: Deploy via altDeploymentRepository diff --git a/pom.xml b/pom.xml index 34abc48..4670c02 100644 --- a/pom.xml +++ b/pom.xml @@ -20,6 +20,7 @@ UTF-8 UTF-8 2.3.9.RELEASE + true @@ -43,38 +44,29 @@ - - org.springframework.boot spring-boot-starter-test ${boot.version} - org.junit.jupiter junit-jupiter 5.9.2 test - - org.mockito mockito-core 3.6.28 test - - org.mockito mockito-junit-jupiter 3.6.28 test - - org.assertj assertj-core @@ -85,30 +77,21 @@ - - - org.junit.jupiter junit-jupiter test - - org.mockito mockito-core test - - org.mockito mockito-junit-jupiter test - - org.assertj assertj-core @@ -116,9 +99,7 @@ - - https://github.com/Time-Machine-Lab/TmlFoundation.git - + https://github.com/Time-Machine-Lab/TmlFoundation.git @@ -129,12 +110,15 @@ + ossrh - Nexus Release Repository - https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/ + OSSRH Staging API (Central) + https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/ + @@ -187,10 +171,37 @@ + + org.sonatype.central + central-publishing-maven-plugin + 0.9.0 + true + + ossrh + true + + + + org.apache.maven.plugins maven-deploy-plugin 3.1.2 + + + default-deploy + deploy + + deploy + + + true + + + + + true + @@ -203,7 +214,7 @@ - + deploy @@ -226,4 +237,4 @@ - + \ No newline at end of file diff --git a/tml-sdk-java-core/pom.xml b/tml-sdk-java-core/pom.xml index 0aed0d2..48e1224 100644 --- a/tml-sdk-java-core/pom.xml +++ b/tml-sdk-java-core/pom.xml @@ -10,6 +10,9 @@ tml-sdk-java-core + tml-sdk-java-core + TmlFoundation Core SDK + https://github.com/Time-Machine-Lab/TmlFoundation 11 diff --git a/tml-sdk-java-web/pom.xml b/tml-sdk-java-web/pom.xml index ce513b4..d955f32 100644 --- a/tml-sdk-java-web/pom.xml +++ b/tml-sdk-java-web/pom.xml @@ -10,6 +10,9 @@ tml-sdk-java-web + tml-sdk-java-web + TmlFoundation Web SDK + https://github.com/Time-Machine-Lab/TmlFoundation 11 diff --git a/tml-sdk-java-web/src/test/java/io/github/timemachinelab/common/resp/ResultTest.java b/tml-sdk-java-web/src/test/java/io/github/timemachinelab/common/resp/ResultTest.java index ec08ba5..c1db79c 100644 --- a/tml-sdk-java-web/src/test/java/io/github/timemachinelab/common/resp/ResultTest.java +++ b/tml-sdk-java-web/src/test/java/io/github/timemachinelab/common/resp/ResultTest.java @@ -52,7 +52,7 @@ void testSuccessResponse() { Result emptyResult = Result.success(); assertTrue(emptyResult.isSuccess()); assertNull(emptyResult.getData()); - assertEquals("success", emptyResult.getMessage()); + assertEquals("tml.success", emptyResult.getMessage()); // 带数据成功响应 Result dataResult = Result.success("hello"); @@ -74,7 +74,7 @@ void testErrorResponse() { System.out.println(errorResult); assertTrue(errorResult.isError()); assertFalse(errorResult.isSuccess()); - assertEquals("error", errorResult.getMessage()); + assertEquals("tml.error", errorResult.getMessage()); // 自定义消息错误响应 Result customErrorResult = Result.error("操作失败"); diff --git a/tml-sdk-java-web/src/test/resources/application.yml b/tml-sdk-java-web/src/test/resources/application.yml index 9839f30..b8f6a8b 100644 --- a/tml-sdk-java-web/src/test/resources/application.yml +++ b/tml-sdk-java-web/src/test/resources/application.yml @@ -15,10 +15,10 @@ spring: tml: web: - result: - trace-enabled: true - trace-id-strategy: UUID - timestamp-precision: MILLISECONDS + result: + trace-enabled: true + trace-id-strategy: UUID + timestamp-precision: MILLISECONDS --- # 测试配置2 - 开启链路追踪,雪花算法策略,纳秒精度 @@ -29,10 +29,10 @@ spring: tml: web: - result: - trace-enabled: true - trace-id-strategy: SNOWFLAKE - timestamp-precision: NANOSECONDS + result: + trace-enabled: true + trace-id-strategy: SNOWFLAKE + timestamp-precision: NANOSECONDS --- # 测试配置3 - 开启链路追踪,时间戳随机策略,秒精度 @@ -43,7 +43,7 @@ spring: tml: web: - result: - trace-enabled: true - trace-id-strategy: TIMESTAMP_RANDOM - timestamp-precision: SECONDS \ No newline at end of file + result: + trace-enabled: true + trace-id-strategy: TIMESTAMP_RANDOM + timestamp-precision: SECONDS \ No newline at end of file