Skip to content

Commit

Permalink
Get version from version.py
Browse files Browse the repository at this point in the history
  • Loading branch information
dougollerenshaw committed Sep 19, 2024
1 parent 137e1dc commit 9ec8127
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/bump_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,11 @@ jobs:
id: preview
run: |
if git log -1 --pretty=%B | grep -qE '^(feat|fix|BREAKING CHANGE):|#(minor|major)'; then
NEW_VERSION=$(cz bump --dry-run --yes --list | grep new_version | sed -r s,"^.*=",,)
cz bump --dry-run --yes
else
NEW_VERSION=$(cz bump --dry-run --yes --increment PATCH --list | grep new_version | sed -r s,"^.*=",,)
cz bump --dry-run --yes --increment PATCH
fi
NEW_VERSION=$(python -c "exec(open('version.py').read()); print(__version__)")
echo "new_version=$NEW_VERSION" >> $GITHUB_ENV
- name: Comment PR
Expand Down Expand Up @@ -75,8 +76,8 @@ jobs:
else
cz bump --increment PATCH --yes
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NEW_VERSION=$(python -c "exec(open('version.py').read()); print(__version__)")
echo "new_version=$NEW_VERSION" >> $GITHUB_ENV
- name: Push changes
uses: ad-m/github-push-action@master
Expand All @@ -86,4 +87,4 @@ jobs:
tags: true

- name: Print Version
run: echo "Bumped to version ${{ steps.bump.outputs.new_version }}"
run: echo "Bumped to version ${{ env.new_version }}"

0 comments on commit 9ec8127

Please sign in to comment.