From baa3216ab6b5dd1224520f0e8369ea6d845dbefc Mon Sep 17 00:00:00 2001 From: kshah Date: Sat, 14 Jan 2023 11:20:18 +0530 Subject: [PATCH] Changes for Release Process. --- .github/workflows/build.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ab2d7b6..51762b5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,6 +32,7 @@ jobs: Source_Clear_Scan: if: ${{ startsWith(github.ref_name, 'support/') && github.event_name != 'pull_request' && !contains(github.event.head_commit.message, '[no_release]') && github.event.repository.fork==false }} runs-on: ubuntu-latest + needs: Build_and_test steps: # Typical Java workflow steps - uses: actions/checkout@v3 @@ -78,6 +79,13 @@ jobs: server-username: MAVEN_USERNAME server-password: MAVEN_PASSWORD + - name: "Cache the Maven packages to speed up build" + uses: actions/cache@v1 + with: + path: ~/.m2 + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-m2 + - name: "Run script" run: | cd surf @@ -89,6 +97,7 @@ jobs: Release: if: ${{ startsWith(github.ref_name, 'support/') && github.event_name != 'pull_request' && !contains(github.event.head_commit.message, '[no_release]') && github.event.repository.fork==false }} runs-on: ubuntu-latest + needs: Source_Clear_Scan steps: # Typical Java workflow steps - uses: actions/checkout@v3 @@ -116,6 +125,9 @@ jobs: key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} restore-keys: ${{ runner.os }}-m2 + - name: Get branch name + uses: Alfresco/alfresco-build-tools/.github/actions/get-branch-name@v1.23.0 + - name: "Use full history for release" run: git checkout -B "$BRANCH_NAME" @@ -125,5 +137,8 @@ jobs: - name: "Add email to link commits to user" run: git config user.email "${GIT_EMAIL}" + - name: "Add user name to link commits to user" + run: git config user.name "${GIT_USERNAME}" + - name: "Skip building of release commits" run: mvn --batch-mode -q -DscmCommentPrefix="[maven-release-plugin][skip ci] " -Dusername="${GIT_USERNAME}" -Dpassword="${GIT_PASSWORD}" -DskipTests -Darguments=-DskipTests -Darguments=-Dmaven.javadoc.skip=true release:clean release:prepare release:perform