@@ -26,74 +26,75 @@ jobs:
2626 wget -q https://github.com/langgenius/dify-plugin-daemon/releases/latest/download/dify-plugin-linux-amd64
2727 chmod +x dify-plugin-linux-amd64
2828
29- - name : Get plugin info from manifest
30- id : get_info
29+ - name : Get basic info from manifest
30+ id : get_basic_info
3131 run : |
3232 PLUGIN_NAME=$(grep "^name:" manifest.yaml | cut -d' ' -f2)
33- VERSION=$(grep "^version:" manifest.yaml | cut -d' ' -f2)
34- AUTHOR=$(grep "^author:" manifest.yaml | cut -d' ' -f2)
35-
33+ echo "Plugin name: $PLUGIN_NAME"
3634 echo "plugin_name=$PLUGIN_NAME" >> $GITHUB_OUTPUT
35+
36+ VERSION=$(grep "^version:" manifest.yaml | cut -d' ' -f2)
37+ echo "Plugin version: $VERSION"
3738 echo "version=$VERSION" >> $GITHUB_OUTPUT
39+
40+ AUTHOR=$(grep "^author:" manifest.yaml | cut -d' ' -f2)
41+ echo "Plugin author: $AUTHOR"
3842 echo "author=$AUTHOR" >> $GITHUB_OUTPUT
39-
40- echo "Plugin: $PLUGIN_NAME v$VERSION (Author: $AUTHOR)"
4143
42- - name : Package plugin
44+ - name : Package Plugin
4345 id : package
4446 run : |
45- PACKAGE_NAME="${{ steps.get_info.outputs.plugin_name }}-${{ steps.get_info.outputs.version }}.difypkg"
47+ cd $GITHUB_WORKSPACE
48+ PACKAGE_NAME="${{ steps.get_basic_info.outputs.plugin_name }}-${{ steps.get_basic_info.outputs.version }}.difypkg"
4649 $RUNNER_TEMP/bin/dify-plugin-linux-amd64 plugin package . -o "$PACKAGE_NAME"
4750 echo "package_name=$PACKAGE_NAME" >> $GITHUB_OUTPUT
48- echo "Package created: $PACKAGE_NAME"
4951
5052 - name : Checkout target repo
5153 uses : actions/checkout@v4
5254 with :
53- repository : ${{ steps.get_info .outputs.author }}/dify-plugins
55+ repository : ${{ steps.get_basic_info .outputs.author }}/dify-plugins
5456 path : dify-plugins
5557 token : ${{ secrets.PLUGIN_ACTION }}
5658 fetch-depth : 1
59+ persist-credentials : true
5760
58- - name : Prepare and push changes
61+ - name : Prepare and create PR
5962 run : |
63+ PACKAGE_NAME="${{ steps.get_basic_info.outputs.plugin_name }}-${{ steps.get_basic_info.outputs.version }}.difypkg"
64+ mkdir -p dify-plugins/${{ steps.get_basic_info.outputs.author }}/${{ steps.get_basic_info.outputs.plugin_name }}
65+ mv "$PACKAGE_NAME" dify-plugins/${{ steps.get_basic_info.outputs.author }}/${{ steps.get_basic_info.outputs.plugin_name }}/
66+
6067 cd dify-plugins
61-
62- # Configure git
68+
6369 git config user.name "GitHub Actions"
6470 git config user.email "actions@github.com"
65-
66- # Ensure we are on the latest main branch
71+
6772 git fetch origin main
6873 git checkout main
6974 git pull origin main
70-
71- # Create branch
72- BRANCH_NAME="bump-${{ steps.get_info.outputs.plugin_name }}-${{ steps.get_info.outputs.version }}"
75+
76+ BRANCH_NAME="bump-${{ steps.get_basic_info.outputs.plugin_name }}-plugin-${{ steps.get_basic_info.outputs.version }}"
7377 git checkout -b "$BRANCH_NAME"
74-
75- # Copy package file
76- mkdir -p ${{ steps.get_info.outputs.author }}/${{ steps.get_info.outputs.plugin_name }}
77- cp "$GITHUB_WORKSPACE/${{ steps.package.outputs.package_name }}" \
78- "${{ steps.get_info.outputs.author }}/${{ steps.get_info.outputs.plugin_name }}/"
79-
80- # Commit and push
78+
8179 git add .
82- git commit -m "bump ${{ steps.get_info.outputs.plugin_name }} to version ${{ steps.get_info.outputs.version }}"
80+ git commit -m "bump ${{ steps.get_basic_info.outputs.plugin_name }} plugin to version ${{ steps.get_basic_info.outputs.version }}"
81+
8382 git push -u origin "$BRANCH_NAME" --force
8483
85- - name : Create pull request
84+ echo "Waiting for branch to sync..."
85+ sleep 10
86+
87+ - name : Create PR via GitHub API
8688 env :
8789 GH_TOKEN : ${{ secrets.PLUGIN_ACTION }}
8890 run : |
89- cd dify-plugins
90-
91- BRANCH_NAME="bump-${{ steps.get_info.outputs.plugin_name }}-${{ steps.get_info.outputs.version }}"
92-
91+ BRANCH_NAME="bump-${{ steps.get_basic_info.outputs.plugin_name }}-plugin-${{ steps.get_basic_info.outputs.version }}"
9392 gh pr create \
9493 --repo langgenius/dify-plugins \
95- --head "${{ steps.get_info .outputs.author }}:$BRANCH_NAME" \
94+ --head "${{ steps.get_basic_info .outputs.author }}:$BRANCH_NAME" \
9695 --base main \
97- --title "bump ${{ steps.get_info.outputs.plugin_name }} to version ${{ steps.get_info.outputs.version }}" \
98- --body "Automated release: bump ${{ steps.get_info.outputs.plugin_name }} plugin to version ${{ steps.get_info.outputs.version }}" \
99- || echo "PR may already exist"
96+ --title "bump ${{ steps.get_basic_info.outputs.plugin_name }} plugin to version ${{ steps.get_basic_info.outputs.version }}" \
97+ --body "bump ${{ steps.get_basic_info.outputs.plugin_name }} plugin package to version ${{ steps.get_basic_info.outputs.version }}
98+
99+ Changes:
100+ - Updated plugin package file" || echo "PR already exists or creation skipped."
0 commit comments