diff --git a/.github/workflows/release-v2.yml b/.github/workflows/release-v2.yml index 1299de2..2464b8b 100644 --- a/.github/workflows/release-v2.yml +++ b/.github/workflows/release-v2.yml @@ -143,3 +143,23 @@ jobs: echo "new_version=$NEW_VERSION" echo "New version is \`$NEW_VERSION\`" >> "$GITHUB_STEP_SUMMARY" echo "new-version=$NEW_VERSION" >> "$GITHUB_OUTPUT" + + commit-new-version: + runs-on: ubuntu-latest + needs: [ get-current-version,get-new-version ] + env: + CURRENT_VERSION: ${{ needs.get-current-version.outputs.current-version }} + NEW_VERSION: ${{ needs.get-new-version.outputs.new-version }} + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Commit new version + if: github.event.inputs.release_type != 'provided' + run: | + xmlstarlet ed -P -L -N pom=http://maven.apache.org/POM/4.0.0 -u "/pom:project/pom:version" -v "$NEW_VERSION" pom.xml + sed -i 's/$CURRENT_VERSION/$NEW_VERSION/g' README.md + git config user.email "github-actions@github.com" + git config user.name "github-actions" + git add pom.xml README.md + git commit -m "v$NEW_VERSION" + git push