Skip to content

Commit

Permalink
automatically update version string in pyproject.toml (fixes #2345)
Browse files Browse the repository at this point in the history
  • Loading branch information
falkoschindler committed Jan 15, 2024
1 parent d6c109d commit 815fe79
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ jobs:
provider: dockerhub
short_description: "Web Based User Interface für Python with Buttons, Dialogs, Markdown, 3D Scences and Plots"

update_citation:
update_metadata:
needs: docker
runs-on: ubuntu-latest
steps:
Expand All @@ -133,12 +133,15 @@ jobs:
ZENODO_TOKEN: ${{ secrets.ZENODO_TOKEN }}
run: python .github/workflows/update_citation.py

- name: Update version in pyproject.toml
run: python .github/workflows/update_pyproject.py ${{ steps.prep.outputs.version }}

- name: Commit and push changes
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add CITATION.cff
git commit -m "Update citation.cff"
git add CITATION.cff pyproject.toml
git commit -m "Update citation.cff and pyproject.toml"
git push origin HEAD:main
verify:
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/update_pyproject.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env python3
import re
import sys
from pathlib import Path

if __name__ == '__main__':
path = Path('pyproject.toml')
content = path.read_text(encoding='utf-8')
content = re.sub(r'version = "[0-9]+\.[0-9]+\.[0-9]+-dev"', f'version = "{sys.argv[1]}-dev"', content)
path.write_text(content, encoding='utf-8')
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "nicegui"
version = "1.4.0"
version = "1.4.10-dev"
description = "Create web-based user interfaces with Python. The nice way."
authors = ["Zauberzeug GmbH <[email protected]>"]
license = "MIT"
Expand Down

0 comments on commit 815fe79

Please sign in to comment.