Skip to content

Update version.yml

Update version.yml #12

Workflow file for this run

name: Versioning
on:
push:
branches:
- main
workflow_dispatch:
jobs:
update-version:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Read current version
id: get_version
run: echo "VERSION=$(cat VERSION)" >> $GITHUB_ENV
- name: Increment version
run: |
IFS='.' read -r major minor patch <<< "$VERSION"
new_patch=$((patch + 1))
new_version="$major.$minor.$new_patch"
echo "$new_version" > VERSION
echo "New version: $new_version"
- name: Commit and push changes
run: |
git config user.name "github-actions"
git config user.email "[email protected]"
git add VERSION
git commit -m "Bump version to $new_version"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}