Skip to content

Commit

Permalink
Update version-bump.yml and version-tag.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
bulv1ne committed Nov 10, 2023
1 parent 4b8dcd2 commit a7ac231
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/version-bump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ on:
description: 'Version bump part'
required: true
type: string
projectDir:
description: 'Project directory where the pyproject.toml is located'
required: false
type: string
default: '.'

jobs:
deploy:
Expand All @@ -32,7 +37,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4.7.1
with:
python-version: '3.10'
python-version: '3.12'
- name: Install dependencies
run: |
python -m pip install --upgrade pip pipx
Expand All @@ -43,7 +48,8 @@ jobs:
git checkout -b release
- name: Bumpversion
run: |
pipx run --spec git+/~https://github.com/bulv1ne/poetry-bumpversion poetry-bumpversion ${{ github.event.inputs.versionPart }}
set -e
pipx run --spec git+/~https://github.com/bulv1ne/poetry-bumpversion poetry-bumpversion ${{ inputs.versionPart }} --project-dir ${{ inputs.projectDir }}
- name: Git push
run: |
git push origin release --force
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/version-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
id: version_number
continue-on-error: true
run: |
OUTPUT=$(git show -q | grep "Bump version from" | awk '{print $6}') &&
OUTPUT=$(git show -q | grep -o "Bump version from v[0-9.]* to v[0-9.]*" | awk '{print $NF}') &&
echo "OUTPUT=$OUTPUT" >> $GITHUB_OUTPUT
- name: Git tag & push
if: steps.version_number.outputs.OUTPUT != ''
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ jobs:
uses: bulv1ne/poetry-bumpversion/.github/workflows/version-bump.yml@main
with:
versionPart: ${{ inputs.versionPart }}
projectDir: app/ # Optional, defaults to root directory
```
Expand Down

0 comments on commit a7ac231

Please sign in to comment.