Prechádzať zdrojové kódy

automatically update version string in pyproject.toml (fixes #2345)

Falko Schindler 1 rok pred
rodič
commit
815fe799f0

+ 6 - 3
.github/workflows/publish.yml

@@ -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:
@@ -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:

+ 10 - 0
.github/workflows/update_pyproject.py

@@ -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')

+ 1 - 1
pyproject.toml

@@ -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 <info@zauberzeug.com>"]
 license = "MIT"