Skip to content

Commit

Permalink
Allow to use graddle to push bump the version
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelKora committed Sep 20, 2023
1 parent 4e29718 commit 762ec59
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions actions/java-gradle-release/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,18 +75,28 @@ runs:
gradle-cache: ${{ inputs.gradle-cache }}

- name: Bump version
id: bump-version
uses: bakdata/ci-templates/actions/[email protected]
with:
release-type: ${{ inputs.release-type }}
working-directory: ${{ inputs.working-directory }}
id: evaluate-version
run: |
old_version=$(./gradlew properties -q | grep "^version:" | awk '{print $2}' | tr -d '[:space:]' | xargs)
if [[ "${{ inputs.release-type }}" == "patch" ]]; then
release_version="${old_version%-*}"
else
release_version=$(semver bump "${{ inputs.release-type }}" "${old_version}")
fi
echo "release-version=$release_version" >> "$GITHUB_OUTPUT"
shell: bash

- name: Create release
run: ./gradlew release -x test -Prelease.useAutomaticVersion=true -Prelease.releaseVersion=${{ steps.evaluate-version.outputs.release-version }} -PdisablePushToRemote=true
shell: bash
working-directory: ${{ inputs.working-directory }}

- name: Create changelog
id: build-changelog
uses: bakdata/ci-templates/actions/[email protected]
with:
github-token: ${{ inputs.github-token }}
new-tag: ${{ steps.bump-version.outputs.release-version }}
new-tag: ${{ steps.evaluate-version.outputs.release-version }}
changelog-file: "${{ inputs.changelog-file }}"
fetch-reviewers: "true"
fetch-release-information: "true"
Expand Down

0 comments on commit 762ec59

Please sign in to comment.