@@ -48,17 +48,28 @@ jobs:
4848 new_content = content.replace(f'VERSION = \"{current_version}\"', f'VERSION = \"{new_version}\"')
4949 with open('agentx/version.py', 'w') as f:
5050 f.write(new_content)
51- print(f'new_version={new_version}')
5251 print(f'Bumped version from {current_version} to {new_version}')
5352 "
5453
54+ - name : Get new version
55+ id : version
56+ if : github.ref == 'refs/heads/main' && github.event_name == 'push'
57+ run : |
58+ python -c "
59+ import re
60+ with open('agentx/version.py', 'r') as f:
61+ content = f.read()
62+ new_version = re.search(r'VERSION = \"([^\"]+)\"', content).group(1)
63+ print(f'new_version={new_version}')
64+ " >> $GITHUB_OUTPUT
65+
5566 - name : Commit version bump
5667 if : github.ref == 'refs/heads/main' && github.event_name == 'push'
5768 run : |
5869 git config --local user.email "github-actions[bot]@users.noreply.github.com"
5970 git config --local user.name "github-actions[bot]"
6071 git add agentx/version.py
61- git commit -m "Bump version to ${{ steps.bump .outputs.new_version }} [skip ci]"
72+ git commit -m "Bump version to ${{ steps.version .outputs.new_version }} [skip ci]"
6273 git push
6374
6475 - name : Wait for version bump commit
@@ -89,10 +100,10 @@ jobs:
89100 env :
90101 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
91102 with :
92- tag_name : v${{ steps.bump .outputs.new_version }}
93- release_name : Release v${{ steps.bump .outputs.new_version }}
103+ tag_name : v${{ steps.version .outputs.new_version }}
104+ release_name : Release v${{ steps.version .outputs.new_version }}
94105 body : |
95- Automated release for version ${{ steps.bump .outputs.new_version }}
106+ Automated release for version ${{ steps.version .outputs.new_version }}
96107
97108 Changes in this release:
98109 - Automated version bump
0 commit comments