Skip to content

Commit 07cb18c

Browse files
committed
[开发] release修改
1 parent a59fe2c commit 07cb18c

File tree

6 files changed

+65
-49
lines changed

6 files changed

+65
-49
lines changed

.github/workflows/PushSDK.yml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,25 +51,24 @@ jobs:
5151
OSSRH_TOKEN_USERNAME: ${{ secrets.OSSRH_TOKEN_USERNAME }}
5252
OSSRH_TOKEN_PASSWORD: ${{ secrets.OSSRH_TOKEN_PASSWORD }}
5353

54+
- name: Import GPG key
55+
uses: crazy-max/ghaction-import-gpg@v6
56+
with:
57+
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
58+
passphrase: ${{ secrets.GPG_PASSPHRASE }}
59+
5460
- name: Show Java and Maven versions
5561
run: |
5662
java -version
5763
mvn -v
5864
59-
- name: Probe s01 with token (no secrets printed)
60-
run: |
61-
code=$(curl -s -o /dev/null -w "%{http_code}" -u "${OSSRH_TOKEN_USERNAME}:${OSSRH_TOKEN_PASSWORD}" "https://s01.oss.sonatype.org/service/local/status")
62-
echo "status_code=$code"
63-
env:
64-
OSSRH_TOKEN_USERNAME: ${{ secrets.OSSRH_TOKEN_USERNAME }}
65-
OSSRH_TOKEN_PASSWORD: ${{ secrets.OSSRH_TOKEN_PASSWORD }}
66-
67-
- name: Deploy (skip tests and gpg signing for now)
65+
- name: Deploy to Central Portal
6866
run: |
6967
mvn -X -B -U \
7068
-DskipTests=true \
71-
-Dgpg.skip=true \
7269
clean deploy
70+
env:
71+
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
7372

7473
# 如果你的 POM 未配置 distributionManagement,或想强制直传,可用下面这个步骤替代上面的 Deploy:
7574
# - name: Deploy via altDeploymentRepository

pom.xml

Lines changed: 36 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
2121
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
2222
<boot.version>2.3.9.RELEASE</boot.version>
23+
<skipTests>true</skipTests>
2324
</properties>
2425

2526
<parent>
@@ -43,38 +44,29 @@
4344

4445
<dependencyManagement>
4546
<dependencies>
46-
47-
<!--springBoot-test-->
4847
<dependency>
4948
<groupId>org.springframework.boot</groupId>
5049
<artifactId>spring-boot-starter-test</artifactId>
5150
<version>${boot.version}</version>
5251
</dependency>
53-
<!-- JUnit 5 -->
5452
<dependency>
5553
<groupId>org.junit.jupiter</groupId>
5654
<artifactId>junit-jupiter</artifactId>
5755
<version>5.9.2</version>
5856
<scope>test</scope>
5957
</dependency>
60-
61-
<!-- Mockito -->
6258
<dependency>
6359
<groupId>org.mockito</groupId>
6460
<artifactId>mockito-core</artifactId>
6561
<version>3.6.28</version>
6662
<scope>test</scope>
6763
</dependency>
68-
69-
<!-- Mockito JUnit Jupiter -->
7064
<dependency>
7165
<groupId>org.mockito</groupId>
7266
<artifactId>mockito-junit-jupiter</artifactId>
7367
<version>3.6.28</version>
7468
<scope>test</scope>
7569
</dependency>
76-
77-
<!-- AssertJ -->
7870
<dependency>
7971
<groupId>org.assertj</groupId>
8072
<artifactId>assertj-core</artifactId>
@@ -85,40 +77,29 @@
8577
</dependencyManagement>
8678

8779
<dependencies>
88-
89-
<!-- TEST -->
90-
<!-- JUnit 5 -->
9180
<dependency>
9281
<groupId>org.junit.jupiter</groupId>
9382
<artifactId>junit-jupiter</artifactId>
9483
<scope>test</scope>
9584
</dependency>
96-
97-
<!-- Mockito -->
9885
<dependency>
9986
<groupId>org.mockito</groupId>
10087
<artifactId>mockito-core</artifactId>
10188
<scope>test</scope>
10289
</dependency>
103-
104-
<!-- Mockito JUnit Jupiter -->
10590
<dependency>
10691
<groupId>org.mockito</groupId>
10792
<artifactId>mockito-junit-jupiter</artifactId>
10893
<scope>test</scope>
10994
</dependency>
110-
111-
<!-- AssertJ -->
11295
<dependency>
11396
<groupId>org.assertj</groupId>
11497
<artifactId>assertj-core</artifactId>
11598
<scope>test</scope>
11699
</dependency>
117100
</dependencies>
118101

119-
<url>
120-
https://github.com/Time-Machine-Lab/TmlFoundation.git
121-
</url>
102+
<url>https://github.com/Time-Machine-Lab/TmlFoundation.git</url>
122103

123104
<licenses>
124105
<license>
@@ -129,12 +110,15 @@
129110
</license>
130111
</licenses>
131112

113+
<!-- 切换到“OSSRH Staging API 兼容服务”的发布端点 -->
132114
<distributionManagement>
133115
<repository>
134116
<id>ossrh</id>
135-
<name>Nexus Release Repository</name>
136-
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
117+
<name>OSSRH Staging API (Central)</name>
118+
<url>https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/</url>
137119
</repository>
120+
<!-- 如需快照,也可在 settings.xml 单独配 snapshotRepositoryUrl:
121+
https://central.sonatype.com/repository/maven-snapshots/ -->
138122
</distributionManagement>
139123

140124
<build>
@@ -187,10 +171,37 @@
187171
</executions>
188172
</plugin>
189173

174+
<plugin>
175+
<groupId>org.sonatype.central</groupId>
176+
<artifactId>central-publishing-maven-plugin</artifactId>
177+
<version>0.9.0</version>
178+
<extensions>true</extensions>
179+
<configuration>
180+
<publishingServerId>ossrh</publishingServerId>
181+
<autoPublish>true</autoPublish>
182+
</configuration>
183+
</plugin>
184+
185+
<!-- maven-deploy-plugin 按“PUT 上传”即可,端点在 distributionManagement 中已切换 -->
190186
<plugin>
191187
<groupId>org.apache.maven.plugins</groupId>
192188
<artifactId>maven-deploy-plugin</artifactId>
193189
<version>3.1.2</version>
190+
<executions>
191+
<execution>
192+
<id>default-deploy</id>
193+
<phase>deploy</phase>
194+
<goals>
195+
<goal>deploy</goal>
196+
</goals>
197+
<configuration>
198+
<skip>true</skip>
199+
</configuration>
200+
</execution>
201+
</executions>
202+
<configuration>
203+
<skip>true</skip>
204+
</configuration>
194205
</plugin>
195206
</plugins>
196207
</build>
@@ -203,7 +214,7 @@
203214
</scm>
204215

205216
<profiles>
206-
<!-- Deployment profile (required so these plugins are only used when deploying) -->
217+
<!-- Deployment profile(保持不变) -->
207218
<!-- 下面这个标签里的不能改 -->
208219
<profile>
209220
<id>deploy</id>
@@ -226,4 +237,4 @@
226237
</build>
227238
</profile>
228239
</profiles>
229-
</project>
240+
</project>

tml-sdk-java-core/pom.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
</parent>
1111

1212
<artifactId>tml-sdk-java-core</artifactId>
13+
<name>tml-sdk-java-core</name>
14+
<description>TmlFoundation Core SDK</description>
15+
<url>https://github.com/Time-Machine-Lab/TmlFoundation</url>
1316

1417
<properties>
1518
<java.version>11</java.version>

tml-sdk-java-web/pom.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
</parent>
1111

1212
<artifactId>tml-sdk-java-web</artifactId>
13+
<name>tml-sdk-java-web</name>
14+
<description>TmlFoundation Web SDK</description>
15+
<url>https://github.com/Time-Machine-Lab/TmlFoundation</url>
1316

1417
<properties>
1518
<maven.compiler.source>11</maven.compiler.source>

tml-sdk-java-web/src/test/java/io/github/timemachinelab/common/resp/ResultTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ void testSuccessResponse() {
5252
Result<Void> emptyResult = Result.success();
5353
assertTrue(emptyResult.isSuccess());
5454
assertNull(emptyResult.getData());
55-
assertEquals("success", emptyResult.getMessage());
55+
assertEquals("tml.success", emptyResult.getMessage());
5656

5757
// 带数据成功响应
5858
Result<String> dataResult = Result.success("hello");
@@ -74,7 +74,7 @@ void testErrorResponse() {
7474
System.out.println(errorResult);
7575
assertTrue(errorResult.isError());
7676
assertFalse(errorResult.isSuccess());
77-
assertEquals("error", errorResult.getMessage());
77+
assertEquals("tml.error", errorResult.getMessage());
7878

7979
// 自定义消息错误响应
8080
Result<Void> customErrorResult = Result.error("操作失败");

tml-sdk-java-web/src/test/resources/application.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ spring:
1515

1616
tml:
1717
web:
18-
result:
19-
trace-enabled: true
20-
trace-id-strategy: UUID
21-
timestamp-precision: MILLISECONDS
18+
result:
19+
trace-enabled: true
20+
trace-id-strategy: UUID
21+
timestamp-precision: MILLISECONDS
2222

2323
---
2424
# 测试配置2 - 开启链路追踪,雪花算法策略,纳秒精度
@@ -29,10 +29,10 @@ spring:
2929

3030
tml:
3131
web:
32-
result:
33-
trace-enabled: true
34-
trace-id-strategy: SNOWFLAKE
35-
timestamp-precision: NANOSECONDS
32+
result:
33+
trace-enabled: true
34+
trace-id-strategy: SNOWFLAKE
35+
timestamp-precision: NANOSECONDS
3636

3737
---
3838
# 测试配置3 - 开启链路追踪,时间戳随机策略,秒精度
@@ -43,7 +43,7 @@ spring:
4343

4444
tml:
4545
web:
46-
result:
47-
trace-enabled: true
48-
trace-id-strategy: TIMESTAMP_RANDOM
49-
timestamp-precision: SECONDS
46+
result:
47+
trace-enabled: true
48+
trace-id-strategy: TIMESTAMP_RANDOM
49+
timestamp-precision: SECONDS

0 commit comments

Comments
 (0)