From dbb6d0e8dcce5b8311aff5c88184ee5ff452d1ed Mon Sep 17 00:00:00 2001 From: SamuelQuetin Date: Tue, 30 Jul 2024 14:06:57 +0200 Subject: [PATCH] Tentative Modif create Release --- .github/workflows/create-release.yml | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index ecd3e3db..6e788de9 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -26,14 +26,10 @@ jobs: # Reconstituer la version snapshot snapshotVersion="${major}.${minor}.${patch}-SNAPSHOT" echo "${snapshotVersion}" - echo "version=${snapshotVersion}" >> $GITHUB_OUTPUT + echo "snapshotVersion=${snapshotVersion}" >> $GITHUB_OUTPUT echo "content :" cat "$GITHUB_OUTPUT" - uses: 'actions/checkout@v3' - - name: 'set variable for snapshot release' - run: | - echo "Snapshot version : ${{ steps.calculate-version.outputs.version }}" - - name: 'Checkout source code' uses: 'actions/checkout@v3' with: @@ -41,7 +37,6 @@ jobs: # https://stackoverflow.com/questions/67550727/push-event-doesnt-trigger-workflow-on-push-paths-github-actions token: ${{ secrets.TOKEN_GITHUB_FOR_GITHUB_ACTION }} - - name: 'Verify release is created only on "main" or "master" git branch' run: | CURRENT_GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD) @@ -52,7 +47,7 @@ jobs: NEW_TAG: ${{ github.event.inputs.releaseVersion }} run: | echo $NEW_TAG | grep -E '^[0-9]+\.[0-9]+\.[0-9]+$' - echo $snapshot_version | grep -E '^[0-9]+\.[0-9]+\.[0-9]+-SNAPSHOT$' + echo ${{ steps.calculate-version.outputs.snapshotVersion }} | grep -E '^[0-9]+\.[0-9]+\.[0-9]+-SNAPSHOT$' - name: 'Verify version is not already used as a git tag' env: NEW_TAG: ${{ github.event.inputs.releaseVersion }} @@ -93,15 +88,15 @@ jobs: git push # switch version to snapshot version - echo -e "setns x=http://maven.apache.org/POM/4.0.0\ncd /x:project/x:version\nset $snapshot_version\nsave" \ + echo -e "setns x=http://maven.apache.org/POM/4.0.0\ncd /x:project/x:version\nset ${{ steps.calculate-version.outputs.snapshotVersion }}"\nsave" \ | xmllint --shell ./pom.xml for POM_FILE in $(ls */pom.xml) do - echo -e "setns x=http://maven.apache.org/POM/4.0.0\ncd /x:project/x:parent/x:version\nset $snapshot_version\nsave" \ + echo -e "setns x=http://maven.apache.org/POM/4.0.0\ncd /x:project/x:parent/x:version\nset ${{ steps.calculate-version.outputs.snapshotVersion }}"\nsave" \ | xmllint --shell $POM_FILE done git add . - git commit -m "Version $snapshot_version [skip ci]" + git commit -m "Version ${{ steps.calculate-version.outputs.snapshotVersion }}" [skip ci]" git push - name: 'Create the github release'