Skip to content

Commit

Permalink
new bump version number script
Browse files Browse the repository at this point in the history
  • Loading branch information
sengiv committed Nov 26, 2024
1 parent b393783 commit 905ea81
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/auto-bump-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
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.GITHUB_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++))
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

0 comments on commit 905ea81

Please sign in to comment.