Skip to content

Commit fb6c8c9

Browse files
author
phernandez
committed
get release working in github action
1 parent 8fa1f01 commit fb6c8c9

2 files changed

Lines changed: 15 additions & 15 deletions

File tree

.bumpversion.cfg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,7 @@ tag = True
66
[bumpversion:file:pyproject.toml]
77
search = version = "{current_version}"
88
replace = version = "{new_version}"
9+
10+
[bumpversion:file:version.txt]
11+
search = {current_version}
12+
replace = {new_version}

.github/workflows/release.yml

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,36 +26,32 @@ jobs:
2626
poetry install
2727
pip install bump2version
2828
29+
# Step 4: Set up Git user
2930
- name: Set up Git user
3031
run: |
3132
git config --local user.name "GitHub Action"
3233
git config --local user.email "action@github.com"
3334
34-
# Bump the version (patch, minor, or major)
35+
# Step 5: Bump the version (patch, minor, or major)
3536
- name: Bump Version
36-
id: bump_version
3737
run: |
38-
bump2version patch
39-
outputs:
40-
new_version: ${{ steps.bump_version.outputs.new_version }}
41-
42-
43-
# Push changes (committed by bump2version)
44-
- name: Push Version Bump Changes
45-
run: |
46-
git config user.name "github-actions[bot]"
47-
git config user.email "github-actions[bot]@users.noreply.github.com"
38+
bump2version patch
4839
git push origin main
4940
50-
# Create a GitHub Release
41+
# Step 6: Extract new version from version.txt
42+
- name: Get New Version
43+
id: get_version
44+
run: echo "NEW_VERSION=$(cat version.txt)" >> $GITHUB_ENV
45+
46+
# Step 7: Create a GitHub Release
5147
- name: Create Release
5248
id: create_release
5349
uses: actions/create-release@v1
5450
env:
5551
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5652
with:
57-
tag_name: 'v${{ steps.bump_version.outputs.new_version }}'
58-
release_name: 'Release v${{ steps.bump_version.outputs.new_version }}'
53+
tag_name: 'v${{ env.NEW_VERSION }}'
54+
release_name: 'Release v${{ env.NEW_VERSION }}'
5955
draft: false
6056
prerelease: false
6157

0 commit comments

Comments
 (0)