build(deps): bump net.megavex:scoreboard-library-implementation from 2.4.3 to 2.4.4 #198
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: API Compatibility & Version Bump | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| api-check: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout PR | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.event.pull_request.head.ref }} | |
| fetch-depth: 0 # required to compare API changes | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set up JDK | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: graalvm | |
| java-version: 21 | |
| - name: Run Kotlin apiDump | |
| run: ./gradlew shadowJar apiDump | |
| - name: Detect API changes | |
| id: changes | |
| run: | | |
| if git diff --quiet --exit-code '**/*.api'; then | |
| echo "api_changed=false" >> $GITHUB_OUTPUT | |
| else | |
| echo "api_changed=true" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Detect manual version change | |
| id: ver | |
| run: | | |
| git fetch origin ${{ github.event.pull_request.base.ref }} | |
| if git diff origin/${{ github.event.pull_request.base.ref }} -- gradle.properties | grep -q '^+version='; then | |
| echo "manual=true" >>"$GITHUB_OUTPUT" | |
| else | |
| echo "manual=false" >>"$GITHUB_OUTPUT" | |
| fi | |
| - name: Bump version in gradle.properties | |
| if: steps.api.outputs.changed == 'true' && steps.ver.outputs.manual == 'false' | |
| run: | | |
| version_file=gradle.properties | |
| current_version=$(grep -E '^version=' "$version_file" | cut -d= -f2) | |
| IFS='.-' read -r major minor patch lib_major lib_minor lib_patch <<<"$current_version" | |
| lib_minor=$((lib_minor + 1)) | |
| lib_patch=0 | |
| new_version="$major.$minor.$patch-$lib_major.$lib_minor.$lib_patch" | |
| echo "Bumping version: $current_version → $new_version" | |
| sed -i "s/^version=.*/version=$new_version/" "$version_file" | |
| - name: Commit and push changes | |
| if: steps.api.outputs.changed == 'true' | |
| run: | | |
| if git diff --quiet; then | |
| echo "No changes to commit." | |
| exit 0 | |
| fi | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add gradle.properties '**/*.api' | |
| git commit -m "chore: update apiDump and bump version [skip ci]" | |
| # Wir sind auf einem echten Branch, daher reicht 'git push' | |
| git push |