Преглед на файлове

dynamic versioning and auto-publish on release

Lendemor преди 1 месец
родител
ревизия
84971237a2
променени са 2 файла, в които са добавени 36 реда и са изтрити 2 реда
  1. 25 0
      .github/workflows/publish.yml
  2. 11 2
      pyproject.toml

+ 25 - 0
.github/workflows/publish.yml

@@ -0,0 +1,25 @@
+name: Build and Publish
+
+on:
+  release:
+    types: [published]
+  workflow_dispatch:
+
+permissions:
+  contents: read # Required for checkout
+  id-token: write # For trusted publishing if using OIDC
+
+jobs:
+  publish:
+    runs-on: ubuntu-latest
+    steps:
+      - name: Checkout code
+        uses: actions/checkout@v2
+      - uses: ./.github/actions/setup_build_env
+        with:
+          python-version: "3.10"
+          run-uv-sync: true
+      - name: Build and publish
+        run: |
+          uv build
+          uv publish --token ${{ secrets.PYPI_API_TOKEN }}

+ 11 - 2
pyproject.toml

@@ -1,6 +1,6 @@
 [project]
 name = "reflex"
-version = "0.7.6dev1"
+dynamic = ["version"]
 description = "Web apps in pure Python."
 license = { text = "Apache-2.0" }
 authors = [
@@ -62,7 +62,7 @@ documentation = "https://reflex.dev/docs/getting-started/introduction"
 reflex = "reflex.reflex:cli"
 
 [build-system]
-requires = ["hatchling"]
+requires = ["hatchling", "uv-dynamic-versioning"]
 build-backend = "hatchling.build"
 
 [tool.hatch.build]
@@ -78,6 +78,15 @@ artifacts = ["*.pyi"]
 dependencies = ["plotly", "ruff"]
 require-runtime-dependencies = true
 
+[tool.hatch.version]
+source = "uv-dynamic-versioning"
+
+[tool.uv-dynamic-versioning]
+vcs = "git"
+style = "pep440"
+bump = true
+metadata = false
+
 [tool.pyright]
 reportIncompatibleMethodOverride = false