Skip to content

Commit

Permalink
optimize: add git infos to jars (#6071)
Browse files Browse the repository at this point in the history
  • Loading branch information
wangliang181230 authored Nov 29, 2023
1 parent 1921b2d commit 30f88b6
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 27 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ jobs:
- name: "Build with Maven"
run: |
if [ "${{ matrix.java }}" == "8" ]; then
./mvnw -T 4C clean test -Dcheckstyle.skip=false -Dlicense.skip=false -e -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn;
./mvnw -T 4C clean test -Dcheckstyle.skip=false -Dlicense.skip=false -Dmaven.git-commit-id.skip=true -e -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn;
elif [ "${{ matrix.java }}" == "17" ]; then
./mvnw -T 4C clean test -Dcheckstyle.skip=true -Dlicense.skip=true -e -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn;
./mvnw -T 4C clean test -Dcheckstyle.skip=true -Dlicense.skip=true -Dmaven.git-commit-id.skip=true -e -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn;
fi
# step 5
- name: "Codecov"
Expand Down Expand Up @@ -63,4 +63,4 @@ jobs:
bash -exc 'apt-get update -y && \
apt-get install maven -y && \
mvn -version && \
mvn -Prelease-seata -DskipTests clean install -U'
mvn -Prelease-seata -DskipTests -Dmaven.git-commit-id.skip=true clean install -U'
4 changes: 2 additions & 2 deletions .github/workflows/test-druid.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
- name: "Test with Maven"
run: |
if [ "${{ matrix.java }}" == "8" ]; then
./mvnw -T 4C clean test -Ddruid.version=${{ matrix.druid }} -Dcheckstyle.skip=false -Dlicense.skip=false -e -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn;
./mvnw -T 4C clean test -Ddruid.version=${{ matrix.druid }} -Dcheckstyle.skip=false -Dlicense.skip=false -Dmaven.git-commit-id.skip=true -e -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn;
else
./mvnw -T 4C clean test -Ddruid.version=${{ matrix.druid }} -Dcheckstyle.skip=true -Dlicense.skip=true -e -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn;
./mvnw -T 4C clean test -Ddruid.version=${{ matrix.druid }} -Dcheckstyle.skip=true -Dlicense.skip=true -Dmaven.git-commit-id.skip=true -e -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn;
fi
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ jobs:
# https://docs.github.com/cn/free-pro-team@latest/actions/reference/context-and-expression-syntax-for-github-actions#github-context
run: |
if [ "${{ matrix.java }}" == "8" ]; then
./mvnw -T 4C clean test -P args-for-client-test -Dspring-boot.version=${{ matrix.springboot }} -Dcheckstyle.skip=false -Dlicense.skip=false -e -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn;
./mvnw -T 4C clean test -P args-for-client-test -Dspring-boot.version=${{ matrix.springboot }} -Dcheckstyle.skip=false -Dlicense.skip=false -Dmaven.git-commit-id.skip=true -e -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn;
else
./mvnw -T 4C clean test -P args-for-client-test -Dspring-boot.version=${{ matrix.springboot }} -Dcheckstyle.skip=true -Dlicense.skip=true -e -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn;
./mvnw -T 4C clean test -P args-for-client-test -Dspring-boot.version=${{ matrix.springboot }} -Dcheckstyle.skip=true -Dlicense.skip=true -Dmaven.git-commit-id.skip=true -e -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn;
fi
# job 2
Expand Down Expand Up @@ -80,7 +80,7 @@ jobs:
# step 4
- name: "Test with Maven"
run: |
./mvnw -T 4C clean test -P args-for-client-test -Dspring-boot.version=${{ matrix.springboot }} -Dkotlin-maven-plugin.version=1.7.22 -Dcheckstyle.skip=true -Dlicense.skip=true -e -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn;
./mvnw -T 4C clean test -P args-for-client-test -Dspring-boot.version=${{ matrix.springboot }} -Dkotlin-maven-plugin.version=1.7.22 -Dcheckstyle.skip=true -Dlicense.skip=true -Dmaven.git-commit-id.skip=true -e -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn;
# job 3
arm64-test:
Expand Down Expand Up @@ -125,4 +125,4 @@ jobs:
# step 5
- name: "test-arm64"
run: |
./mvnw -T 4C clean test -P args-for-client-test -Dspring-boot.version=${{ matrix.springboot }} -Dcheckstyle.skip=true -Dlicense.skip=true -e -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
./mvnw -T 4C clean test -P args-for-client-test -Dspring-boot.version=${{ matrix.springboot }} -Dcheckstyle.skip=true -Dlicense.skip=true -Dmaven.git-commit-id.skip=true -e -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
36 changes: 32 additions & 4 deletions build/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,6 @@
<junit-jupiter.version>5.8.2</junit-jupiter.version>
<junit-platform.version>1.8.2</junit-platform.version>

<!-- For test -->
<junit-jupiter.version>5.8.2</junit-jupiter.version>
<junit-platform.version>1.8.2</junit-platform.version>

<!-- Maven plugin versions -->
<!-- Build -->
<easyj-maven-plugin.version>1.1.5</easyj-maven-plugin.version>
Expand Down Expand Up @@ -124,6 +120,7 @@
<checkstyle.skip>true</checkstyle.skip>
<license.skip>true</license.skip>
<maven.test.skip>false</maven.test.skip>
<maven.git-commit-id.skip>false</maven.git-commit-id.skip>
<maven.surefire.argLine></maven.surefire.argLine>
<maven.surefire.excludes></maven.surefire.excludes>
<gpg.keyname>37F181C60AACE24BD5C1D3925583F79497E8E293</gpg.keyname>
Expand Down Expand Up @@ -204,6 +201,32 @@
<useTabIndent>true</useTabIndent>
</configuration>
</plugin>
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
<version>${git-commit-id-plugin.version}</version>
<executions>
<execution>
<id>get-the-git-infos</id>
<goals>
<goal>revision</goal>
</goals>
</execution>
</executions>
<configuration>
<skip>${maven.git-commit-id.skip}</skip>
<verbose>true</verbose>
<dateFormat>yyyy-MM-dd'T'HH:mm:ssZ</dateFormat>
<generateGitPropertiesFile>true</generateGitPropertiesFile>
<generateGitPropertiesFilename>${project.build.outputDirectory}/seata-git.properties</generateGitPropertiesFilename>
<includeOnlyProperties>
<includeOnlyProperty>git.branch</includeOnlyProperty>
<includeOnlyProperty>^git.build.(time|version)$</includeOnlyProperty>
<includeOnlyProperty>^git.commit.(id|time)$</includeOnlyProperty>
<includeOnlyProperty>git.dirty</includeOnlyProperty>
</includeOnlyProperties>
</configuration>
</plugin>
</plugins>
</pluginManagement>

Expand Down Expand Up @@ -300,6 +323,11 @@
</execution>
</executions>
</plugin>
<!-- Git commit id -->
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
</plugin>
</plugins>
</build>

Expand Down
2 changes: 2 additions & 0 deletions changes/en-us/2.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Add changes here for all PR submitted to the 2.x branch.
- [[#6031](https://github.com/seata/seata/pull/6031)] add a check for the existence of the undolog table
- [[#6089](https://github.com/seata/seata/pull/6089)] modify the semantics of RaftServerFactory and remove unnecessary singleton
- [[#4473](https://github.com/seata/seata/pull/4473)] rm appdata size limit
- [[#6071](https://github.com/seata/seata/pull/6071)] add git infos to jars


### security:
Expand All @@ -34,5 +35,6 @@ Thanks to these contributors for their code commits. Please report an unintended
- [DroidEye2ONGU](https://github.com/DroidEye2ONGU)
- [funky-eyes](https://github.com/funky-eyes)
- [Bughue](https://github.com/Bughue)
- [wangliang181230](https://github.com/wangliang181230)

Also, we receive many valuable issues, questions and advices from our community. Thanks for you all.
3 changes: 2 additions & 1 deletion changes/zh-cn/2.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
- [[#6031](https://github.com/seata/seata/pull/6031)] 添加undo_log表的存在性校验
- [[#6089](https://github.com/seata/seata/pull/6089)] 修改RaftServerFactory语义并删除不必要的单例构建
- [[#4473](https://github.com/seata/seata/pull/4473)] rm appdata大小限制

- [[#6071](https://github.com/seata/seata/pull/6071)] 添加git信息到JAR包中


### security:
Expand All @@ -35,5 +35,6 @@
- [DroidEye2ONGU](https://github.com/DroidEye2ONGU)
- [funky-eyes](https://github.com/funky-eyes)
- [Bughue](https://github.com/Bughue)
- [wangliang181230](https://github.com/wangliang181230)

同时,我们收到了社区反馈的很多有价值的issue和建议,非常感谢大家。
13 changes: 0 additions & 13 deletions server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -310,19 +310,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
<version>${git-commit-id-plugin.version}</version>
<executions>
<execution>
<id>get-the-git-infos</id>
<goals>
<goal>revision</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
Expand Down

0 comments on commit 30f88b6

Please sign in to comment.