Bump version: 4.6.56 → 4.6.57 #634
This file contains 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@v3 | |
- name: Setup python | |
uses: actions/setup-python@v4.1.0 | |
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 "bump2version@dk64randomizer.com" | |
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@v1 | |
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 }} |