Flatten ci-friendly revision when deploy (#12659)

This commit is contained in:
kezhenxu94 2024-09-27 17:06:39 +08:00 committed by GitHub
parent 88f38a41e5
commit 9eaced35de
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 20 additions and 5 deletions

View File

@ -176,12 +176,12 @@ jobs:
cache: "maven" cache: "maven"
- name: Build distribution tar - name: Build distribution tar
run: | run: |
./mvnw clean install javadoc:javadoc -B -q -Pall \ ./mvnw clean flatten:flatten install javadoc:javadoc -B -q -Pall \
-Dmaven.test.skip \ -Dmaven.test.skip \
-Dcheckstyle.skip \ -Dcheckstyle.skip \
-Dgpg.skip -Dgpg.skip
- name: Verify builds are reproducible - name: Verify builds are reproducible
run: ./mvnw -Dmaven.test.skip clean verify artifact:compare -Pall -Dgpg.skip run: ./mvnw -Dmaven.test.skip clean flatten:flatten verify artifact:compare -Pall -Dgpg.skip
- uses: actions/upload-artifact@v4 - uses: actions/upload-artifact@v4
name: Upload distribution tar name: Upload distribution tar
with: with:
@ -722,7 +722,7 @@ jobs:
restore-keys: ${{ runner.os }}-maven- restore-keys: ${{ runner.os }}-maven-
- name: Prepare test services - name: Prepare test services
shell: bash shell: bash
run: ./mvnw -B -q -f test/e2e-v2/java-test-service/pom.xml clean package run: ./mvnw -B -q -f test/e2e-v2/java-test-service/pom.xml clean flatten:flatten package
- name: Set env var - name: Set env var
run: | run: |
echo "${{ matrix.test.env }}" >> $GITHUB_ENV echo "${{ matrix.test.env }}" >> $GITHUB_ENV

1
.gitignore vendored
View File

@ -1,6 +1,7 @@
/build/ /build/
target/ target/
.idea/ .idea/
.flattened-pom.xml
*.iml *.iml
.classpath .classpath
.project .project

View File

@ -78,7 +78,7 @@ git push origin v${RELEASE_VERSION}
## Stage the release ## Stage the release
```bash ```bash
./mvnw install deploy -DskipTests ./mvnw flatten:flatten install deploy -DskipTests
``` ```
This command will build, sign, and deploy the release to the Apache staging repository. This command will build, sign, and deploy the release to the Apache staging repository.
@ -86,7 +86,7 @@ You should be prompted for your GPG passphrase during the deployment process.
If no prompt is present, you can set the passphrase in the environment variable `MAVEN_GPG_PASSPHRASE`: If no prompt is present, you can set the passphrase in the environment variable `MAVEN_GPG_PASSPHRASE`:
```bash ```bash
MAVEN_GPG_PASSPHRASE=<your-gpg-passphrase> ./mvnw install deploy -DskipTests MAVEN_GPG_PASSPHRASE=<your-gpg-passphrase> ./mvnw flatten:flatten install deploy -DskipTests
``` ```
- The release will be automatically inserted into a temporary staging repository. - The release will be automatically inserted into a temporary staging repository.

14
pom.xml
View File

@ -196,6 +196,7 @@
<checkstyle.fails.on.error>true</checkstyle.fails.on.error> <checkstyle.fails.on.error>true</checkstyle.fails.on.error>
<assertj-core.version>3.20.2</assertj-core.version> <assertj-core.version>3.20.2</assertj-core.version>
<cyclonedx-maven-plugin.version>2.8.0</cyclonedx-maven-plugin.version> <cyclonedx-maven-plugin.version>2.8.0</cyclonedx-maven-plugin.version>
<flatten-plugin-version>1.6.0</flatten-plugin-version>
<skipUTs>false</skipUTs> <skipUTs>false</skipUTs>
<argLine>--add-opens java.base/java.lang=ALL-UNNAMED</argLine> <argLine>--add-opens java.base/java.lang=ALL-UNNAMED</argLine>
@ -446,6 +447,15 @@
<retryFailedDeploymentCount>5</retryFailedDeploymentCount> <retryFailedDeploymentCount>5</retryFailedDeploymentCount>
</configuration> </configuration>
</plugin> </plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>flatten-maven-plugin</artifactId>
<version>${flatten-plugin-version}</version>
<configuration>
<flattenMode>resolveCiFriendliesOnly</flattenMode>
<updatePomFile>true</updatePomFile>
</configuration>
</plugin>
</plugins> </plugins>
</pluginManagement> </pluginManagement>
<plugins> <plugins>
@ -584,6 +594,10 @@
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId> <artifactId>maven-gpg-plugin</artifactId>
</plugin> </plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>flatten-maven-plugin</artifactId>
</plugin>
</plugins> </plugins>
</build> </build>
</project> </project>