From 7e367f85e936c38e41aa71ffe330b0fc401262c9 Mon Sep 17 00:00:00 2001 From: Wojciech Piotrowiak Date: Fri, 24 Nov 2023 15:45:33 +0100 Subject: [PATCH 01/11] AAE-17877 m2 cleanup strategies for push and PR --- .../actions/maven-build-and-tag/action.yml | 20 +++++++++++++++++++ version.txt | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/.github/actions/maven-build-and-tag/action.yml b/.github/actions/maven-build-and-tag/action.yml index 6fae50c07..1867c639b 100644 --- a/.github/actions/maven-build-and-tag/action.yml +++ b/.github/actions/maven-build-and-tag/action.yml @@ -81,7 +81,14 @@ runs: steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + - uses: actions/cache/restore@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2 + if: github.event_name == 'push' + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + - uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2 + if: github.event_name == 'pull_request' with: path: ~/.m2/repository key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} @@ -229,3 +236,16 @@ runs: run: | git tag -a $VERSION -m "Release version $VERSION" git push origin $VERSION + + - name: Clean m2 cache + if: github.event_name == 'push' + shell: bash + run: | + rm -fr ~/.m2/repository/org/activiti + rm -fr ~/.m2/repository/com/alfresco + + - uses: actions/cache/save@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2 + if: github.event_name == 'pull_request' + with: + path: ${{ github.workspace }}/**/target/*.jar + key: mvn-target-cache-${{ github.run_id }} diff --git a/version.txt b/version.txt index d3845ad3c..6b7ace3e9 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -v5.0.0 +v5.1.0 From 60eaa6808ea324b2d5698ac3c57a8ff504c32fe0 Mon Sep 17 00:00:00 2001 From: Wojciech Piotrowiak Date: Fri, 24 Nov 2023 20:07:06 +0100 Subject: [PATCH 02/11] AAE-17877 condition reverted --- .github/actions/maven-build-and-tag/action.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/actions/maven-build-and-tag/action.yml b/.github/actions/maven-build-and-tag/action.yml index 1867c639b..20cbd5a39 100644 --- a/.github/actions/maven-build-and-tag/action.yml +++ b/.github/actions/maven-build-and-tag/action.yml @@ -82,13 +82,13 @@ runs: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - uses: actions/cache/restore@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2 - if: github.event_name == 'push' + if: github.event_name == 'pull_request' with: path: ~/.m2/repository key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2 - if: github.event_name == 'pull_request' + if: github.event_name == 'push' with: path: ~/.m2/repository key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} @@ -238,7 +238,7 @@ runs: git push origin $VERSION - name: Clean m2 cache - if: github.event_name == 'push' + if: github.event_name == 'pull_request' shell: bash run: | rm -fr ~/.m2/repository/org/activiti From 70ac0fdd63ca94735d9b060ed7231051d2758f1c Mon Sep 17 00:00:00 2001 From: Wojciech Piotrowiak Date: Fri, 24 Nov 2023 20:21:25 +0100 Subject: [PATCH 03/11] AAE-17877 condition reverted --- .github/actions/maven-build-and-tag/action.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/actions/maven-build-and-tag/action.yml b/.github/actions/maven-build-and-tag/action.yml index 20cbd5a39..bf7b5b57a 100644 --- a/.github/actions/maven-build-and-tag/action.yml +++ b/.github/actions/maven-build-and-tag/action.yml @@ -247,5 +247,7 @@ runs: - uses: actions/cache/save@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2 if: github.event_name == 'pull_request' with: - path: ${{ github.workspace }}/**/target/*.jar - key: mvn-target-cache-${{ github.run_id }} + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- From 09283bc4a3604ea3643ff8e8543ba18c3c736a32 Mon Sep 17 00:00:00 2001 From: Wojciech Piotrowiak Date: Fri, 24 Nov 2023 20:33:35 +0100 Subject: [PATCH 04/11] AAE-17877 unused property --- .github/actions/maven-build-and-tag/action.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/actions/maven-build-and-tag/action.yml b/.github/actions/maven-build-and-tag/action.yml index bf7b5b57a..4f541ca3d 100644 --- a/.github/actions/maven-build-and-tag/action.yml +++ b/.github/actions/maven-build-and-tag/action.yml @@ -249,5 +249,3 @@ runs: with: path: ~/.m2/repository key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- From d7328606fde6974b2e4fca338d1411fac68d54bc Mon Sep 17 00:00:00 2001 From: Wojciech Piotrowiak Date: Fri, 24 Nov 2023 20:46:59 +0100 Subject: [PATCH 05/11] AAE-17877 logic changed --- .github/actions/maven-build-and-tag/action.yml | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/.github/actions/maven-build-and-tag/action.yml b/.github/actions/maven-build-and-tag/action.yml index 4f541ca3d..9229ffca9 100644 --- a/.github/actions/maven-build-and-tag/action.yml +++ b/.github/actions/maven-build-and-tag/action.yml @@ -82,19 +82,10 @@ runs: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - uses: actions/cache/restore@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2 - if: github.event_name == 'pull_request' with: path: ~/.m2/repository key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - - uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2 - if: github.event_name == 'push' - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - name: Set up JDK uses: actions/setup-java@0ab4596768b603586c0de567f2430c30f5b0d2b0 # v3.13 with: @@ -238,14 +229,15 @@ runs: git push origin $VERSION - name: Clean m2 cache - if: github.event_name == 'pull_request' + if: github.event_name == 'push' shell: bash run: | rm -fr ~/.m2/repository/org/activiti rm -fr ~/.m2/repository/com/alfresco - - uses: actions/cache/save@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2 - if: github.event_name == 'pull_request' + - name: Save maven cache + uses: actions/cache/save@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2 + if: github.event_name == 'push' with: path: ~/.m2/repository key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} From 8fe200331d8e0115a3ef89cd00e442dfa3d36910 Mon Sep 17 00:00:00 2001 From: Wojtek Piotrowiak Date: Mon, 27 Nov 2023 12:21:46 +0100 Subject: [PATCH 06/11] Update version.txt Co-authored-by: Anahide Tchertchian <608958+atchertchian@users.noreply.github.com> --- version.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.txt b/version.txt index 6b7ace3e9..ee80415e1 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -v5.1.0 +v5.2.0 From af825c521179164c25e569e3c6a18d231a95c4fd Mon Sep 17 00:00:00 2001 From: Wojciech Piotrowiak Date: Mon, 27 Nov 2023 12:22:30 +0100 Subject: [PATCH 07/11] AAE-17877 revert on restore keys --- .github/actions/maven-build-and-tag/action.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/actions/maven-build-and-tag/action.yml b/.github/actions/maven-build-and-tag/action.yml index 9229ffca9..bdbd2ab00 100644 --- a/.github/actions/maven-build-and-tag/action.yml +++ b/.github/actions/maven-build-and-tag/action.yml @@ -85,6 +85,8 @@ runs: with: path: ~/.m2/repository key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- - name: Set up JDK uses: actions/setup-java@0ab4596768b603586c0de567f2430c30f5b0d2b0 # v3.13 From d26c1081c19146d5f1cf028433d15ec1fd8ade8e Mon Sep 17 00:00:00 2001 From: Wojciech Piotrowiak Date: Mon, 27 Nov 2023 12:32:53 +0100 Subject: [PATCH 08/11] AAE-17877 more precise condition on saving cache --- .github/actions/maven-build-and-tag/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/maven-build-and-tag/action.yml b/.github/actions/maven-build-and-tag/action.yml index f064d354f..b53eaf748 100644 --- a/.github/actions/maven-build-and-tag/action.yml +++ b/.github/actions/maven-build-and-tag/action.yml @@ -239,7 +239,7 @@ runs: - name: Save maven cache uses: actions/cache/save@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2 - if: github.event_name == 'push' + if: github.event_name == 'push' && github.event.repository.default_branch == github.ref_name with: path: ~/.m2/repository key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} From 74b99dba806ce7daec91a36f49fe4c43ad01027f Mon Sep 17 00:00:00 2001 From: Wojciech Piotrowiak Date: Mon, 27 Nov 2023 12:34:13 +0100 Subject: [PATCH 09/11] AAE-17877 formatting --- version.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.txt b/version.txt index f01c12bcd..ee80415e1 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -v5.2.0 \ No newline at end of file +v5.2.0 From 2aebc12e7528acae2379e74ae400474db9499b24 Mon Sep 17 00:00:00 2001 From: Wojciech Piotrowiak Date: Mon, 27 Nov 2023 13:39:28 +0100 Subject: [PATCH 10/11] AAE-17877 clean cache condition --- .github/actions/maven-build-and-tag/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/maven-build-and-tag/action.yml b/.github/actions/maven-build-and-tag/action.yml index b53eaf748..40deeecba 100644 --- a/.github/actions/maven-build-and-tag/action.yml +++ b/.github/actions/maven-build-and-tag/action.yml @@ -231,7 +231,7 @@ runs: git push origin $VERSION - name: Clean m2 cache - if: github.event_name == 'push' + if: github.event_name == 'push' && github.event.repository.default_branch == github.ref_name shell: bash run: | rm -fr ~/.m2/repository/org/activiti From 036278443900f7fd4936a22d445768e22dcf5c75 Mon Sep 17 00:00:00 2001 From: Wojciech Piotrowiak Date: Mon, 27 Nov 2023 15:26:49 +0100 Subject: [PATCH 11/11] AAE-17877 conditions reverted --- .github/actions/maven-build-and-tag/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/maven-build-and-tag/action.yml b/.github/actions/maven-build-and-tag/action.yml index 40deeecba..f064d354f 100644 --- a/.github/actions/maven-build-and-tag/action.yml +++ b/.github/actions/maven-build-and-tag/action.yml @@ -231,7 +231,7 @@ runs: git push origin $VERSION - name: Clean m2 cache - if: github.event_name == 'push' && github.event.repository.default_branch == github.ref_name + if: github.event_name == 'push' shell: bash run: | rm -fr ~/.m2/repository/org/activiti @@ -239,7 +239,7 @@ runs: - name: Save maven cache uses: actions/cache/save@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2 - if: github.event_name == 'push' && github.event.repository.default_branch == github.ref_name + if: github.event_name == 'push' with: path: ~/.m2/repository key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}