diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b451d256..138439e7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -82,7 +82,25 @@ jobs: MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} MAVEN_GPG_PASSPHRASE: ${{ secrets.SIGNING_PASSWORD }} - + + - name: "Extract maven version" # required for following change readme step + id: extract-version + run: | + MVN_VERSION=$(mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec) + echo "MVN_VERSION=$MVN_VERSION" >> $GITHUB_OUTPUT + + # Replaced all version occurrences in README.md in the form: 1.0.0 or version: '1.0.0' + # A version can be 1.0.0, 1.0.0-SNAPSHOT, or 1.0.0-beta4 + - name: "Change README" + run: | + sed -i -e "s@\(\)\([0-9].[0-9].[0-9]\(-[A-z0-9]*\)*\)\(\)@\1${{ steps.extract-version.outputs.MVN_VERSION }}\4@g" README.md + sed -i -e "s@\(version: '\)\([0-9].[0-9].[0-9]\(-[A-z0-9]*\)*\)\('\)@\1${{ steps.extract-version.outputs.MVN_VERSION }}\4@g" README.md + git add README.md + git commit -S -m "Update version in README" + git push + env: + GITHUB_TOKEN: ${{ secrets.SCB_BOT_USER_TOKEN }} + # Required for creation of GitHub release - name: "Get previous tag" id: previous_tag