Skip to content

Commit 9c5aa99

Browse files
committed
init
0 parents  commit 9c5aa99

22 files changed

+1350
-0
lines changed

.difyignore

Lines changed: 184 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,184 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# Distribution / packaging
7+
.Python
8+
build/
9+
develop-eggs/
10+
dist/
11+
downloads/
12+
eggs/
13+
.eggs/
14+
lib/
15+
lib64/
16+
parts/
17+
sdist/
18+
var/
19+
wheels/
20+
share/python-wheels/
21+
*.egg-info/
22+
.installed.cfg
23+
*.egg
24+
MANIFEST
25+
26+
# PyInstaller
27+
# Usually these files are written by a python script from a template
28+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
29+
*.manifest
30+
*.spec
31+
32+
# Installer logs
33+
pip-log.txt
34+
pip-delete-this-directory.txt
35+
36+
# Unit test / coverage reports
37+
htmlcov/
38+
.tox/
39+
.nox/
40+
.coverage
41+
.coverage.*
42+
.cache
43+
nosetests.xml
44+
coverage.xml
45+
*.cover
46+
*.py,cover
47+
.hypothesis/
48+
.pytest_cache/
49+
cover/
50+
51+
# Translations
52+
*.mo
53+
*.pot
54+
55+
# Django stuff:
56+
*.log
57+
local_settings.py
58+
db.sqlite3
59+
db.sqlite3-journal
60+
61+
# Flask stuff:
62+
instance/
63+
.webassets-cache
64+
65+
# Scrapy stuff:
66+
.scrapy
67+
68+
# Sphinx documentation
69+
docs/_build/
70+
71+
# PyBuilder
72+
.pybuilder/
73+
target/
74+
75+
# Jupyter Notebook
76+
.ipynb_checkpoints
77+
78+
# IPython
79+
profile_default/
80+
ipython_config.py
81+
82+
# pyenv
83+
# For a library or package, you might want to ignore these files since the code is
84+
# intended to run in multiple environments; otherwise, check them in:
85+
.python-version
86+
87+
# pipenv
88+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
89+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
90+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
91+
# install all needed dependencies.
92+
Pipfile.lock
93+
94+
# UV
95+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
96+
# This is especially recommended for binary packages to ensure reproducibility, and is more
97+
# commonly ignored for libraries.
98+
uv.lock
99+
100+
# poetry
101+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
102+
# This is especially recommended for binary packages to ensure reproducibility, and is more
103+
# commonly ignored for libraries.
104+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
105+
poetry.lock
106+
107+
# pdm
108+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
109+
#pdm.lock
110+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
111+
# in version control.
112+
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
113+
.pdm.toml
114+
.pdm-python
115+
.pdm-build/
116+
117+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
118+
__pypackages__/
119+
120+
# Celery stuff
121+
celerybeat-schedule
122+
celerybeat.pid
123+
124+
# SageMath parsed files
125+
*.sage.py
126+
127+
# Environments
128+
.env
129+
.venv
130+
env/
131+
venv/
132+
ENV/
133+
env.bak/
134+
venv.bak/
135+
136+
# Spyder project settings
137+
.spyderproject
138+
.spyproject
139+
140+
# Rope project settings
141+
.ropeproject
142+
143+
# mkdocs documentation
144+
/site
145+
146+
# mypy
147+
.mypy_cache/
148+
.dmypy.json
149+
dmypy.json
150+
151+
# Pyre type checker
152+
.pyre/
153+
154+
# pytype static type analyzer
155+
.pytype/
156+
157+
# Cython debug symbols
158+
cython_debug/
159+
160+
# PyCharm
161+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
162+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
163+
# and can be added to the global gitignore or merged into this file. For a more nuclear
164+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
165+
.idea/
166+
167+
# Vscode
168+
.vscode/
169+
170+
# Git
171+
.git/
172+
.gitignore
173+
.github/
174+
175+
# Mac
176+
.DS_Store
177+
178+
# Windows
179+
Thumbs.db
180+
181+
# Dify plugin packages
182+
# To prevent packaging repetitively
183+
*.difypkg
184+

.env.example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
INSTALL_METHOD=remote
2+
REMOTE_INSTALL_URL=debug.dify.ai:5003
3+
REMOTE_INSTALL_KEY=********-****-****-****-************
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
name: Plugin Publish Workflow
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout code
12+
uses: actions/checkout@v3
13+
14+
- name: Download CLI tool
15+
run: |
16+
mkdir -p $RUNNER_TEMP/bin
17+
cd $RUNNER_TEMP/bin
18+
19+
wget https://github.com/langgenius/dify-plugin-daemon/releases/download/0.0.6/dify-plugin-linux-amd64
20+
chmod +x dify-plugin-linux-amd64
21+
22+
echo "CLI tool location:"
23+
pwd
24+
ls -la dify-plugin-linux-amd64
25+
26+
- name: Get basic info from manifest
27+
id: get_basic_info
28+
run: |
29+
PLUGIN_NAME=$(grep "^name:" manifest.yaml | cut -d' ' -f2)
30+
echo "Plugin name: $PLUGIN_NAME"
31+
echo "plugin_name=$PLUGIN_NAME" >> $GITHUB_OUTPUT
32+
33+
VERSION=$(grep "^version:" manifest.yaml | cut -d' ' -f2)
34+
echo "Plugin version: $VERSION"
35+
echo "version=$VERSION" >> $GITHUB_OUTPUT
36+
37+
# If the author's name is not your github username, you can change the author here
38+
AUTHOR=$(grep "^author:" manifest.yaml | cut -d' ' -f2)
39+
echo "Plugin author: $AUTHOR"
40+
echo "author=$AUTHOR" >> $GITHUB_OUTPUT
41+
42+
- name: Package Plugin
43+
id: package
44+
run: |
45+
cd $GITHUB_WORKSPACE
46+
PACKAGE_NAME="${{ steps.get_basic_info.outputs.plugin_name }}-${{ steps.get_basic_info.outputs.version }}.difypkg"
47+
$RUNNER_TEMP/bin/dify-plugin-linux-amd64 plugin package . -o "$PACKAGE_NAME"
48+
49+
echo "Package result:"
50+
ls -la "$PACKAGE_NAME"
51+
echo "package_name=$PACKAGE_NAME" >> $GITHUB_OUTPUT
52+
53+
echo "\nFull file path:"
54+
pwd
55+
echo "\nDirectory structure:"
56+
tree || ls -R
57+
58+
- name: Checkout target repo
59+
uses: actions/checkout@v3
60+
with:
61+
repository: ${{steps.get_basic_info.outputs.author}}/dify-plugins
62+
path: dify-plugins
63+
token: ${{ secrets.PLUGIN_ACTION }}
64+
fetch-depth: 1
65+
persist-credentials: true
66+
67+
- name: Prepare and create PR
68+
run: |
69+
PACKAGE_NAME="${{ steps.get_basic_info.outputs.plugin_name }}-${{ steps.get_basic_info.outputs.version }}.difypkg"
70+
mkdir -p dify-plugins/${{ steps.get_basic_info.outputs.author }}/${{ steps.get_basic_info.outputs.plugin_name }}
71+
mv "$PACKAGE_NAME" dify-plugins/${{ steps.get_basic_info.outputs.author }}/${{ steps.get_basic_info.outputs.plugin_name }}/
72+
73+
cd dify-plugins
74+
75+
git config user.name "GitHub Actions"
76+
git config user.email "[email protected]"
77+
78+
git fetch origin main
79+
git checkout main
80+
git pull origin main
81+
82+
BRANCH_NAME="bump-${{ steps.get_basic_info.outputs.plugin_name }}-plugin-${{ steps.get_basic_info.outputs.version }}"
83+
git checkout -b "$BRANCH_NAME"
84+
85+
git add .
86+
git commit -m "bump ${{ steps.get_basic_info.outputs.plugin_name }} plugin to version ${{ steps.get_basic_info.outputs.version }}"
87+
88+
git push -u origin "$BRANCH_NAME" --force
89+
90+
git branch -a
91+
echo "Waiting for branch to sync..."
92+
sleep 10 # Wait 10 seconds for branch sync
93+
94+
- name: Create PR via GitHub API
95+
env:
96+
# How to config the token:
97+
# 1. Profile -> Settings -> Developer settings -> Personal access tokens -> Generate new token (with repo scope) -> Copy the token
98+
# 2. Go to the target repository -> Settings -> Secrets and variables -> Actions -> New repository secret -> Add the token as PLUGIN_ACTION
99+
GH_TOKEN: ${{ secrets.PLUGIN_ACTION }}
100+
run: |
101+
gh pr create \
102+
--repo langgenius/dify-plugins \
103+
--head "${{ steps.get_basic_info.outputs.author }}:${{ steps.get_basic_info.outputs.plugin_name }}-${{ steps.get_basic_info.outputs.version }}" \
104+
--base main \
105+
--title "bump ${{ steps.get_basic_info.outputs.plugin_name }} plugin to version ${{ steps.get_basic_info.outputs.version }}" \
106+
--body "bump ${{ steps.get_basic_info.outputs.plugin_name }} plugin package to version ${{ steps.get_basic_info.outputs.version }}
107+
108+
Changes:
109+
- Updated plugin package file" || echo "PR already exists or creation skipped." # Handle cases where PR already exists

0 commit comments

Comments
 (0)