Merge pull request #2968 from UmedMuzl/changelog-5.0 #1730
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: Bump Version | |
| on: | |
| push: | |
| branches: [ master, dev] | |
| jobs: | |
| version-bump: | |
| runs-on: ubuntu-latest | |
| if: ${{ !contains(github.actor, '[bot]') }} | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v5 | |
| - name: Setup python | |
| uses: actions/[email protected] | |
| with: | |
| python-version: 3.10.9 | |
| architecture: x64 | |
| - name: Install bump2version | |
| run: pip install bump2version | |
| - name: Determine Version Increment | |
| id: bump | |
| run: | | |
| BRANCH_NAME=${GITHUB_REF#refs/heads/} | |
| COMMIT_MESSAGE=$(git log -1 --pretty=%B) | |
| git config --global user.email "[email protected]" | |
| git config --global user.name "Bump2Version" | |
| git config --unset-all http.https://github.com/.extraheader | |
| echo "Branch: $BRANCH_NAME, Commit Message: $COMMIT_MESSAGE" | |
| if [[ "$BRANCH_NAME" == "dev" ]]; then | |
| if [[ "$COMMIT_MESSAGE" == *"Major Release"* ]]; then | |
| echo "Bumping major version" | |
| echo "VERSION_PART=major" >> $GITHUB_OUTPUT | |
| elif [[ "$COMMIT_MESSAGE" == *"Breaks older cosmetics packs"* ]]; then | |
| echo "Bumping minor version" | |
| echo "VERSION_PART=minor" >> $GITHUB_OUTPUT | |
| else | |
| echo "Bumping patch version" | |
| echo "VERSION_PART=patch" >> $GITHUB_OUTPUT | |
| fi | |
| fi | |
| - name: Bump Version | |
| run: bump2version ${{ steps.bump.outputs.VERSION_PART }} | |
| - id: create_token | |
| uses: tibdex/github-app-token@v2 | |
| with: | |
| app_id: 715479 | |
| installation_id: 45211287 | |
| private_key: ${{ secrets.BRANCHPROTECTION }} | |
| - name: Push Changes | |
| uses: ad-m/github-push-action@master | |
| with: | |
| github_token: ${{ steps.create_token.outputs.token }} | |
| branch: ${{ github.ref }} |