Skip to content

Commit 36e464b

Browse files
author
bathfire
committed
v0.5.0: World-Class Dify Workflow Generator
Major release with enterprise-grade features: Core Enhancements: - 29 Python modules with 8000+ lines of code - 17 complete Dify node types support - Fluent Builder API with chainable methods - Advanced error handling with custom exceptions New Enterprise Features: - Real-time collaboration (WebSocket + OT) - AI-powered workflow optimizer - Interactive debugger with breakpoints - Local execution engine for testing - Git integration with version control - Database persistence (SQLite/PostgreSQL) - Workflow marketplace with sharing - Authentication system (API keys + JWT) Developer Tools: - VS Code extension with IntelliSense - Shell completion (Bash/Zsh/Fish) - Migration tools (Langchain/Make/Zapier) - Testing framework with mocks - Performance profiler - Documentation generator Deployment: - Docker & Docker Compose support - GitHub Actions CI/CD - MkDocs documentation site - FastAPI web interface This is a world-class, production-ready platform for Dify workflow generation.
1 parent 3b9d1d5 commit 36e464b

59 files changed

Lines changed: 10890 additions & 265 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.dockerignore

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Git
2+
.git
3+
.gitignore
4+
5+
# Python
6+
__pycache__/
7+
*.py[cod]
8+
*$py.class
9+
*.so
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
*.egg-info/
24+
.installed.cfg
25+
*.egg
26+
27+
# Virtual environments
28+
venv/
29+
env/
30+
ENV/
31+
32+
# IDE
33+
.vscode/
34+
.idea/
35+
*.swp
36+
*.swo
37+
*~
38+
39+
# Testing
40+
.pytest_cache/
41+
.coverage
42+
htmlcov/
43+
.tox/
44+
45+
# Documentation
46+
docs/_build/
47+
site/
48+
49+
# Local data
50+
data/
51+
*.db
52+
*.sqlite
53+
54+
# Workflows (user data)
55+
workflows/*.yml
56+
workflows/*.yaml
57+
!workflows/.gitkeep
58+
59+
# Environment
60+
.env
61+
.env.local
62+
.env.*.local
63+
64+
# OS
65+
.DS_Store
66+
Thumbs.db
67+
68+
# Logs
69+
*.log
70+
logs/
71+
72+
# Temp files
73+
tmp/
74+
temp/
75+
*.tmp

.github/workflows/ci.yml

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
paths:
7+
- 'dify_workflow/**'
8+
- 'tests/**'
9+
- 'pyproject.toml'
10+
- '.github/workflows/**'
11+
pull_request:
12+
branches: [ main ]
13+
paths:
14+
- 'dify_workflow/**'
15+
- 'tests/**'
16+
- 'pyproject.toml'
17+
- '.github/workflows/**'
18+
19+
jobs:
20+
test:
21+
runs-on: ${{ matrix.os }}
22+
strategy:
23+
fail-fast: false
24+
matrix:
25+
os: [ubuntu-latest, windows-latest, macos-latest]
26+
python-version: ['3.9', '3.10', '3.11', '3.12']
27+
28+
steps:
29+
- uses: actions/checkout@v4
30+
31+
- name: Set up Python ${{ matrix.python-version }}
32+
uses: actions/setup-python@v5
33+
with:
34+
python-version: ${{ matrix.python-version }}
35+
36+
- name: Cache pip packages
37+
uses: actions/cache@v3
38+
with:
39+
path: ~/.cache/pip
40+
key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }}
41+
restore-keys: |
42+
${{ runner.os }}-pip-
43+
44+
- name: Install dependencies
45+
run: |
46+
python -m pip install --upgrade pip
47+
pip install -e ".[dev,web,interactive]"
48+
49+
- name: Lint with ruff
50+
run: |
51+
ruff check dify_workflow
52+
ruff format --check dify_workflow
53+
54+
- name: Type check with mypy
55+
run: mypy dify_workflow --ignore-missing-imports
56+
57+
- name: Test with pytest
58+
run: pytest tests/ -v --cov=dify_workflow --cov-report=xml --cov-report=html
59+
60+
- name: Upload coverage to Codecov
61+
uses: codecov/codecov-action@v3
62+
with:
63+
file: ./coverage.xml
64+
flags: unittests
65+
name: codecov-umbrella
66+
fail_ci_if_error: false
67+
68+
docker:
69+
runs-on: ubuntu-latest
70+
needs: test
71+
steps:
72+
- uses: actions/checkout@v4
73+
74+
- name: Set up Docker Buildx
75+
uses: docker/setup-buildx-action@v3
76+
77+
- name: Build Docker image
78+
run: |
79+
docker build --target production -t dify-workflow:latest .
80+
docker build --target development -t dify-workflow:dev .
81+
82+
- name: Test Docker image
83+
run: |
84+
docker run -d -p 8765:8765 --name test-container dify-workflow:latest
85+
sleep 5
86+
curl -f http://localhost:8765/api/templates || exit 1
87+
docker stop test-container
88+
89+
security:
90+
runs-on: ubuntu-latest
91+
steps:
92+
- uses: actions/checkout@v4
93+
94+
- name: Run Bandit security check
95+
uses: PyCQA/bandit@main
96+
with:
97+
args: "-r dify_workflow -f json -o bandit-report.json || true"
98+
99+
- name: Upload security report
100+
uses: actions/upload-artifact@v3
101+
with:
102+
name: security-report
103+
path: bandit-report.json

.github/workflows/docs.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Documentation
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
paths:
7+
- 'docs/**'
8+
- 'dify_workflow/**'
9+
- 'mkdocs.yml'
10+
11+
permissions:
12+
contents: read
13+
pages: write
14+
id-token: write
15+
16+
concurrency:
17+
group: "pages"
18+
cancel-in-progress: false
19+
20+
jobs:
21+
build:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@v4
25+
26+
- name: Set up Python
27+
uses: actions/setup-python@v5
28+
with:
29+
python-version: '3.11'
30+
31+
- name: Install dependencies
32+
run: |
33+
pip install mkdocs mkdocs-material mkdocs-minify-plugin
34+
pip install -e ".[dev]"
35+
36+
- name: Build documentation
37+
run: mkdocs build
38+
39+
- name: Upload artifact
40+
uses: actions/upload-pages-artifact@v2
41+
with:
42+
path: ./site
43+
44+
deploy:
45+
environment:
46+
name: github-pages
47+
url: ${{ steps.deployment.outputs.page_url }}
48+
runs-on: ubuntu-latest
49+
needs: build
50+
steps:
51+
- name: Deploy to GitHub Pages
52+
id: deployment
53+
uses: actions/deploy-pages@v3

.github/workflows/release.yml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
create-release:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
19+
- name: Set up Python
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: '3.11'
23+
24+
- name: Install dependencies
25+
run: |
26+
python -m pip install --upgrade pip
27+
pip install build twine
28+
29+
- name: Build package
30+
run: python -m build
31+
32+
- name: Create Release
33+
id: create_release
34+
uses: actions/create-release@v1
35+
env:
36+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
with:
38+
tag_name: ${{ github.ref }}
39+
release_name: Release ${{ github.ref }}
40+
draft: false
41+
prerelease: false
42+
body: |
43+
## Changes in this Release
44+
- See [CHANGELOG.md](https://github.com/${{ github.repository }}/blob/main/CHANGELOG.md)
45+
46+
- name: Upload Release Assets
47+
uses: actions/upload-release-asset@v1
48+
env:
49+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50+
with:
51+
upload_url: ${{ steps.create_release.outputs.upload_url }}
52+
asset_path: ./dist/
53+
asset_name: dist
54+
asset_content_type: application/zip
55+
56+
- name: Publish to PyPI
57+
env:
58+
TWINE_USERNAME: __token__
59+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
60+
run: twine upload dist/*
61+
62+
docker-release:
63+
runs-on: ubuntu-latest
64+
needs: create-release
65+
steps:
66+
- uses: actions/checkout@v4
67+
68+
- name: Set up QEMU
69+
uses: docker/setup-qemu-action@v3
70+
71+
- name: Set up Docker Buildx
72+
uses: docker/setup-buildx-action@v3
73+
74+
- name: Login to Docker Hub
75+
uses: docker/login-action@v3
76+
with:
77+
username: ${{ secrets.DOCKER_USERNAME }}
78+
password: ${{ secrets.DOCKER_PASSWORD }}
79+
80+
- name: Extract version
81+
id: get_version
82+
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
83+
84+
- name: Build and push Docker image
85+
uses: docker/build-push-action@v5
86+
with:
87+
context: .
88+
platforms: linux/amd64,linux/arm64
89+
push: true
90+
tags: |
91+
${{ secrets.DOCKER_USERNAME }}/dify-workflow:latest
92+
${{ secrets.DOCKER_USERNAME }}/dify-workflow:${{ steps.get_version.outputs.VERSION }}

0 commit comments

Comments
 (0)