-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add pyproject.toml * doc * Static version file * Add github action to sync version.py * Change trigger to PR * Fix commit * Grant pr write permission * nit * nit * Don't run on fork PRs * Rename version.py to comfyui_version.py
- Loading branch information
Showing
4 changed files
with
74 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: Update Version File | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- "pyproject.toml" | ||
branches: | ||
- master | ||
|
||
jobs: | ||
update-version: | ||
runs-on: ubuntu-latest | ||
# Don't run on fork PRs | ||
if: github.event.pull_request.head.repo.full_name == github.repository | ||
permissions: | ||
pull-requests: write | ||
contents: write | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.11" | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
- name: Update comfyui_version.py | ||
run: | | ||
# Read version from pyproject.toml and update comfyui_version.py | ||
python -c ' | ||
import tomllib | ||
# Read version from pyproject.toml | ||
with open("pyproject.toml", "rb") as f: | ||
config = tomllib.load(f) | ||
version = config["project"]["version"] | ||
# Write version to comfyui_version.py | ||
with open("comfyui_version.py", "w") as f: | ||
f.write("# This file is automatically generated by the build process when version is\n") | ||
f.write("# updated in pyproject.toml.\n") | ||
f.write(f"__version__ = \"{version}\"\n") | ||
' | ||
- name: Commit changes | ||
run: | | ||
git config --local user.name "github-actions" | ||
git config --local user.email "[email protected]" | ||
git fetch origin ${{ github.head_ref }} | ||
git checkout -B ${{ github.head_ref }} origin/${{ github.head_ref }} | ||
git add comfyui_version.py | ||
git diff --quiet && git diff --staged --quiet || git commit -m "chore: Update comfyui_version.py to match pyproject.toml" | ||
git push origin HEAD:${{ github.head_ref }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# This file is automatically generated by the build process when version is | ||
# updated in pyproject.toml. | ||
__version__ = "0.3.10" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[project] | ||
name = "ComfyUI" | ||
version = "0.3.10" | ||
readme = "README.md" | ||
license = { file = "LICENSE" } | ||
requires-python = ">=3.9" | ||
|
||
[project.urls] | ||
homepage = "https://www.comfy.org/" | ||
repository = "https://github.com/comfyanonymous/ComfyUI" | ||
documentation = "https://docs.comfy.org/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters