From a04afdf827d09d29309c229718cd7792f76b71ef Mon Sep 17 00:00:00 2001 From: Wojciech Piotrowiak Date: Thu, 10 Oct 2024 18:50:35 +0200 Subject: [PATCH 1/9] AAE-26208 changes: tag creation moved to final step, whitelist branch fix --- .github/workflows/build.yml | 10 +++++++++- .github/workflows/enforce-pr-conventions.yml | 2 +- .github/workflows/release.yml | 5 ----- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fd9b89ac9..1ea07f9f9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -77,12 +77,20 @@ jobs: echo "RELEASE_VERSION=$VERSION" >> $GITHUB_ENV echo "::set-output name=version::$VERSION" + - name: Create GitHub tag + env: + GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }} + VERSION: ${{ env.VERSION }} + run: | + git tag ${{ env.VERSION }} + git push ${{ env.VERSION }} + - name: Create gh Release env: GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }} VERSION: ${{ env.VERSION }} run: | - gh release create ${VERSION} --title ${VERSION} --notes "Release ${VERSION}" --target ${{ github.sha }} + gh release create ${VERSION} --title ${VERSION} --notes "Release ${VERSION}" notify: runs-on: ubuntu-latest diff --git a/.github/workflows/enforce-pr-conventions.yml b/.github/workflows/enforce-pr-conventions.yml index 5965cb009..8d3023d49 100644 --- a/.github/workflows/enforce-pr-conventions.yml +++ b/.github/workflows/enforce-pr-conventions.yml @@ -21,4 +21,4 @@ jobs: with: jira-project-key: AAE|HXOR whitelist-branches: |- - release-* + release/* diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 88d14fc5f..95c268b05 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -80,11 +80,6 @@ jobs: commit-message: "Release ${VERSION}" add-options: "." - - name: Create GitHub tag - run: | - git tag ${{ github.event.inputs.tag-name }} - git push origin ${{ github.event.inputs.tag-name }} - - name: Push changes env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From b8724dc839cce6aa4124df888706bf93b7352b79 Mon Sep 17 00:00:00 2001 From: Wojciech Piotrowiak Date: Thu, 10 Oct 2024 18:59:03 +0200 Subject: [PATCH 2/9] AAE-26208 git push --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 95c268b05..a8565f2a1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -84,7 +84,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - git push -u origin release/${{ github.event.inputs.tag-name }} + git push - name: Create Pull Request run: | From c76fb6b74bff7c53102094693c6903d600b56ee1 Mon Sep 17 00:00:00 2001 From: Wojciech Piotrowiak Date: Thu, 10 Oct 2024 19:58:17 +0200 Subject: [PATCH 3/9] AAE-26208 git push -u --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a8565f2a1..95c268b05 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -84,7 +84,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - git push + git push -u origin release/${{ github.event.inputs.tag-name }} - name: Create Pull Request run: | From 69ad7acc941a48cf8c0c908e9b31e55f3671e303 Mon Sep 17 00:00:00 2001 From: Wojciech Piotrowiak Date: Thu, 10 Oct 2024 22:10:29 +0200 Subject: [PATCH 4/9] AAE-26208 removal of enforce-pr-conventions.yml file [skip ci] --- .github/workflows/enforce-pr-conventions.yml | 24 -------------------- 1 file changed, 24 deletions(-) delete mode 100644 .github/workflows/enforce-pr-conventions.yml diff --git a/.github/workflows/enforce-pr-conventions.yml b/.github/workflows/enforce-pr-conventions.yml deleted file mode 100644 index 8d3023d49..000000000 --- a/.github/workflows/enforce-pr-conventions.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: Enforce PR Conventions - -on: - pull_request: - types: - - opened - - reopened - - synchronize - - edited - branches: - - develop -jobs: - enforce-pr-conventions: - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - - name: enforce-pr-conventions - id: git-naming-convention - uses: Alfresco/alfresco-build-tools/.github/actions/enforce-pr-conventions@209bb4275688720e13dc0703dbd17826bf677c5c # v6.1.0 - with: - jira-project-key: AAE|HXOR - whitelist-branches: |- - release/* From 7b45bad7cbab0361c7a139d2af25ecbb30283aa5 Mon Sep 17 00:00:00 2001 From: Wojciech Piotrowiak Date: Fri, 11 Oct 2024 22:17:57 +0200 Subject: [PATCH 5/9] AAE-26208 documentation update --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e9304d17f..d3f432eb4 100644 --- a/README.md +++ b/README.md @@ -408,4 +408,9 @@ Requires the following secrets to be set: The release process is partially automated using the [release workflow](.github/workflows/release.yml). This workflow creates a release branch, updates the version in the `pom.xml` files, and creates a PR for the release branch. -When the PR is merged, the release is automatically published to the internal Maven repository. + +To create a release, follow these steps: +1. Run workflow mentioned above. +2. Add any label into generated PR to trigger check run. +3. Merge the PR if no issues are found. +4. Check if new github release and tag is created. From 83e5dbe14952f1304f9b520cc81d5c7e07168c54 Mon Sep 17 00:00:00 2001 From: Wojciech Piotrowiak Date: Fri, 11 Oct 2024 22:22:39 +0200 Subject: [PATCH 6/9] AAE-26208 documentation update --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index d3f432eb4..6f86474f2 100644 --- a/README.md +++ b/README.md @@ -410,6 +410,7 @@ The release process is partially automated using the [release workflow](.github/ This workflow creates a release branch, updates the version in the `pom.xml` files, and creates a PR for the release branch. To create a release, follow these steps: + 1. Run workflow mentioned above. 2. Add any label into generated PR to trigger check run. 3. Merge the PR if no issues are found. From f6af76b8a086c8d1d611037bf1dd26cf47959fc9 Mon Sep 17 00:00:00 2001 From: Wojciech Piotrowiak Date: Fri, 11 Oct 2024 22:41:30 +0200 Subject: [PATCH 7/9] Revert "AAE-26208 removal of enforce-pr-conventions.yml file [skip ci]" This reverts commit 69ad7acc941a48cf8c0c908e9b31e55f3671e303. --- .github/workflows/enforce-pr-conventions.yml | 24 ++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/enforce-pr-conventions.yml diff --git a/.github/workflows/enforce-pr-conventions.yml b/.github/workflows/enforce-pr-conventions.yml new file mode 100644 index 000000000..8d3023d49 --- /dev/null +++ b/.github/workflows/enforce-pr-conventions.yml @@ -0,0 +1,24 @@ +name: Enforce PR Conventions + +on: + pull_request: + types: + - opened + - reopened + - synchronize + - edited + branches: + - develop +jobs: + enforce-pr-conventions: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + - name: enforce-pr-conventions + id: git-naming-convention + uses: Alfresco/alfresco-build-tools/.github/actions/enforce-pr-conventions@209bb4275688720e13dc0703dbd17826bf677c5c # v6.1.0 + with: + jira-project-key: AAE|HXOR + whitelist-branches: |- + release/* From ea0d6db2213d5787a479bcd873d5ed3960707c66 Mon Sep 17 00:00:00 2001 From: Wojciech Piotrowiak Date: Sat, 12 Oct 2024 21:09:58 +0200 Subject: [PATCH 8/9] AAE-26208 regex to pass release branch --- .github/workflows/enforce-pr-conventions.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/enforce-pr-conventions.yml b/.github/workflows/enforce-pr-conventions.yml index 8d3023d49..91bb195a9 100644 --- a/.github/workflows/enforce-pr-conventions.yml +++ b/.github/workflows/enforce-pr-conventions.yml @@ -20,5 +20,6 @@ jobs: uses: Alfresco/alfresco-build-tools/.github/actions/enforce-pr-conventions@209bb4275688720e13dc0703dbd17826bf677c5c # v6.1.0 with: jira-project-key: AAE|HXOR + valid-branch-regex: ^(revert-|(improvement|fix|feature|test|tmp|release)\/(AAE|HXOR)-[0-9]+[_-]{1}[A-Za-z0-9._-]+|release\/[A-Za-z0-9]+)$ whitelist-branches: |- release/* From a05e71d2c201637bb5b473c89a72f372ad7f747a Mon Sep 17 00:00:00 2001 From: Wojciech Piotrowiak Date: Sat, 12 Oct 2024 21:17:28 +0200 Subject: [PATCH 9/9] AAE-26208 trick to pass workflow on label --- .github/workflows/enforce-pr-conventions.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/enforce-pr-conventions.yml b/.github/workflows/enforce-pr-conventions.yml index 91bb195a9..4109843ea 100644 --- a/.github/workflows/enforce-pr-conventions.yml +++ b/.github/workflows/enforce-pr-conventions.yml @@ -7,6 +7,7 @@ on: - reopened - synchronize - edited + - labeled branches: - develop jobs: