Skip to content

Auto bump version to 1.23.1 #4

Auto bump version to 1.23.1

Auto bump version to 1.23.1 #4

name: Auto Bump Version
on:
push:
branches:
- main
jobs:
bump-version:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
token: ${{ secrets.GH_TOKEN }}
fetch-depth: 0
- name: Get current version
run: |
current_version=$(grep 'version =' pyproject.toml | cut -d'"' -f2)
echo "CURRENT_VERSION=$current_version" >> $GITHUB_ENV
- name: Bump version
run: |
IFS=. read -r major minor patch <<< "${CURRENT_VERSION}"
patch=$((patch + 1))
new_version="${major}.${minor}.${patch}"
echo "NEW_VERSION=$new_version" >> $GITHUB_ENV
- name: Update version in meta.yaml
run: |
sed -i "s/version: .*/version: $NEW_VERSION/" vedastro/meta.yaml
- name: Update version in setup.py
run: |
sed -i "s/version='.*'/version='$NEW_VERSION'/" setup.py
- name: Update version in pyproject.toml
run: |
sed -i "s/version = \".*\"/version = \"$NEW_VERSION\"/" pyproject.toml
- name: Commit changes
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add .
git commit -m "Auto bump version to $NEW_VERSION"
git push origin main