From 65d6aba049b20dd91e970c7adcfab0a9cf0e26a2 Mon Sep 17 00:00:00 2001 From: George Gastaldi Date: Fri, 6 Dec 2024 09:55:47 -0300 Subject: [PATCH] Support pre and post hooks during release This would allow performing operations before and after the release:prepare goal is invoked --- .github/workflows/prepare-release.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/prepare-release.yml b/.github/workflows/prepare-release.yml index 00e5d5a..5915828 100644 --- a/.github/workflows/prepare-release.yml +++ b/.github/workflows/prepare-release.yml @@ -88,11 +88,27 @@ jobs: echo "MAVEN_EXEC=mvn" >> $GITHUB_ENV fi + - name: Invoke Pre-Prepare Release Hook (if exists) + if: ${{ hashFiles('.github/workflows/hooks/pre-prepare-release.sh') != '' }} + run: ./.github/workflows/hooks/pre-prepare-release.sh + env: + GH_TOKEN: ${{ steps.app-token.outputs.token }} + CURRENT_VERSION: ${{env.CURRENT_VERSION}} + NEXT_VERSION: ${{env.NEXT_VERSION}} + - name: Maven release ${{env.CURRENT_VERSION}} run: | ${MAVEN_EXEC} -B release:prepare -Prelease -Dgpg.skip=true -DreleaseVersion=${CURRENT_VERSION} -DdevelopmentVersion=${NEXT_VERSION} -Drelease.arguments="-Dgpg.skip=true" ${MAVEN_EXEC} -B release:clean + - name: Invoke Post-Prepare Release Hook (if exists) + if: ${{ hashFiles('.github/workflows/hooks/post-prepare-release.sh') != '' }} + run: ./.github/workflows/hooks/post-prepare-release.sh + env: + GH_TOKEN: ${{ steps.app-token.outputs.token }} + CURRENT_VERSION: ${{env.CURRENT_VERSION}} + NEXT_VERSION: ${{env.NEXT_VERSION}} + - name: Push changes to ${{github.base_ref}} branch and tag ${{env.CURRENT_VERSION}} run: | git push