Increment Patch Version #3
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: Increment Patch Version | |
on: | |
workflow_dispatch: | |
permissions: | |
contents: write | |
jobs: | |
increment-patch: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Read and increment version | |
run: | | |
VERSION_FILE=".version" | |
CURRENT_VERSION=$(cat $VERSION_FILE) | |
IFS='.' read -r MAJOR MINOR PATCH <<< "$CURRENT_VERSION" | |
PATCH=$((PATCH + 1)) | |
NEW_VERSION="$MAJOR.$MINOR.$PATCH" | |
echo "$NEW_VERSION" > $VERSION_FILE | |
echo "Version updated to $NEW_VERSION" | |
- name: Commit changes | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "CubeDood" | |
git add .version | |
git commit -m "Increment patch version" | |
git push | |
env: | |
GITHUB_TOKEN: ${{ secrets.CUBEDOOD_TOKEN }} |