From bb48d7419fdbcf898e10e8480215f5d165dcde7e Mon Sep 17 00:00:00 2001 From: Wojtek Piotrowiak Date: Thu, 10 Oct 2024 14:34:54 +0200 Subject: [PATCH] AAE-26208 Workflow adjustments (#2346) * AAE-26208 skipping generation of backup version * AAE-26208 version from the pom, not branch name --- .github/workflows/build.yml | 30 ++++++++++++++---------------- .github/workflows/release.yml | 10 +++++----- .gitignore | 2 -- 3 files changed, 19 insertions(+), 23 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d7daeb1f5..fd9b89ac9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,11 +4,9 @@ on: push: branches: - develop - - release/** pull_request: branches: - develop - - release/** types: - opened - reopened @@ -69,22 +67,22 @@ jobs: runs-on: ubuntu-latest needs: - build - if: github.event_name == 'push' - env: - VERSION: ${{ needs.build.outputs.version }} - DEVELOPMENT_BRANCH: ${{ github.ref_name }} + if: github.event_name == 'push' && startsWith(github.ref_name, 'release/') steps: - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - - uses: Alfresco/alfresco-build-tools/.github/actions/setup-helm-docs@209bb4275688720e13dc0703dbd17826bf677c5c # v6.1.0 - - uses: Alfresco/alfresco-build-tools/.github/actions/jx-updatebot-pr@209bb4275688720e13dc0703dbd17826bf677c5c # v6.1.0 - with: - version: ${{ needs.build.outputs.version }} - auto-merge: 'true' - labels: 'be-propagation,${{ env.DEVELOPMENT_BRANCH }}' - base-branch-name: ${{ env.DEVELOPMENT_BRANCH }} - git-username: ${{ secrets.BOT_GITHUB_USERNAME }} - git-token: ${{ secrets.BOT_GITHUB_TOKEN }} - git-author-name: ${{ secrets.BOT_GITHUB_USERNAME }} + - name: Extract version from branch name + id: extract_version + run: | + VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) + echo "RELEASE_VERSION=$VERSION" >> $GITHUB_ENV + echo "::set-output name=version::$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 }} notify: runs-on: ubuntu-latest diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bc2735962..cc9f0fa1a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -65,11 +65,11 @@ jobs: - name: Update versions in pom.xml run: | - mvn versions:set-property -Dproperty=alfresco-deployment-service.version -DnewVersion=${{ github.event.inputs.alfresco-deployment-service-version }} - mvn versions:set-property -Dproperty=alfresco-modeling-service.version -DnewVersion=${{ github.event.inputs.alfresco-modeling-service-version }} - mvn versions:set-property -Dproperty=alfresco-process.version -DnewVersion=${{ github.event.inputs.alfresco-process-version }} - mvn versions:set-property -Dproperty=activiti-cloud.version -DnewVersion=${{ github.event.inputs.activiti-cloud-version }} - mvn versions:set -DnewVersion=${{ github.event.inputs.tag-name }} + mvn versions:set-property -Dproperty=alfresco-deployment-service.version -DnewVersion=${{ github.event.inputs.alfresco-deployment-service-version }} -DgenerateBackupPoms=false + mvn versions:set-property -Dproperty=alfresco-modeling-service.version -DnewVersion=${{ github.event.inputs.alfresco-modeling-service-version }} -DgenerateBackupPoms=false + mvn versions:set-property -Dproperty=alfresco-process.version -DnewVersion=${{ github.event.inputs.alfresco-process-version }} -DgenerateBackupPoms=false + mvn versions:set-property -Dproperty=activiti-cloud.version -DnewVersion=${{ github.event.inputs.activiti-cloud-version }} -DgenerateBackupPoms=false + mvn versions:set -DnewVersion=${{ github.event.inputs.tag-name }} -DgenerateBackupPoms=false - name: Commit Changes env: diff --git a/.gitignore b/.gitignore index 5c4fdbd60..5868fa243 100644 --- a/.gitignore +++ b/.gitignore @@ -79,5 +79,3 @@ alfresco-apa-java-rest-api/alfresco-apa-java-rest-api-lib/generated/alfresco-act !alfresco-apa-java-rest-api/alfresco-apa-java-rest-api-lib/generated/alfresco-activiti-script-modeling-rest-api/pom.xml alfresco-apa-java-rest-api/alfresco-apa-java-rest-api-lib/generated/alfresco-activiti-admin-preference-rest-api/* !alfresco-apa-java-rest-api/alfresco-apa-java-rest-api-lib/generated/alfresco-activiti-admin-preference-rest-api/pom.xml - -*.pom.xml.versionsBackup