From 9eaced35deafb6ef571a298b626038904c178d61 Mon Sep 17 00:00:00 2001 From: kezhenxu94 Date: Fri, 27 Sep 2024 17:06:39 +0800 Subject: [PATCH] Flatten ci-friendly revision when deploy (#12659) --- .github/workflows/skywalking.yaml | 6 +++--- .gitignore | 1 + docs/en/guides/How-to-release.md | 4 ++-- pom.xml | 14 ++++++++++++++ 4 files changed, 20 insertions(+), 5 deletions(-) diff --git a/.github/workflows/skywalking.yaml b/.github/workflows/skywalking.yaml index 144bc6bb3b..93b5706b3d 100644 --- a/.github/workflows/skywalking.yaml +++ b/.github/workflows/skywalking.yaml @@ -176,12 +176,12 @@ jobs: cache: "maven" - name: Build distribution tar run: | - ./mvnw clean install javadoc:javadoc -B -q -Pall \ + ./mvnw clean flatten:flatten install javadoc:javadoc -B -q -Pall \ -Dmaven.test.skip \ -Dcheckstyle.skip \ -Dgpg.skip - 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 name: Upload distribution tar with: @@ -722,7 +722,7 @@ jobs: restore-keys: ${{ runner.os }}-maven- - name: Prepare test services 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 run: | echo "${{ matrix.test.env }}" >> $GITHUB_ENV diff --git a/.gitignore b/.gitignore index 3049d84a15..3521750947 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ /build/ target/ .idea/ +.flattened-pom.xml *.iml .classpath .project diff --git a/docs/en/guides/How-to-release.md b/docs/en/guides/How-to-release.md index 7b153c3f7e..006f25c42f 100644 --- a/docs/en/guides/How-to-release.md +++ b/docs/en/guides/How-to-release.md @@ -78,7 +78,7 @@ git push origin v${RELEASE_VERSION} ## Stage the release ```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. @@ -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`: ```bash -MAVEN_GPG_PASSPHRASE= ./mvnw install deploy -DskipTests +MAVEN_GPG_PASSPHRASE= ./mvnw flatten:flatten install deploy -DskipTests ``` - The release will be automatically inserted into a temporary staging repository. diff --git a/pom.xml b/pom.xml index f5a781d15b..c9c60637d8 100755 --- a/pom.xml +++ b/pom.xml @@ -196,6 +196,7 @@ true 3.20.2 2.8.0 + 1.6.0 false --add-opens java.base/java.lang=ALL-UNNAMED @@ -446,6 +447,15 @@ 5 + + org.codehaus.mojo + flatten-maven-plugin + ${flatten-plugin-version} + + resolveCiFriendliesOnly + true + + @@ -584,6 +594,10 @@ org.apache.maven.plugins maven-gpg-plugin + + org.codehaus.mojo + flatten-maven-plugin +