88jobs :
99 auto_pr :
1010 runs-on : ubuntu-latest
11+ permissions :
12+ contents : write
13+ pull-requests : write
14+ actions : read
1115 steps :
1216 - name : Checkout code
1317 uses : actions/checkout@v4
7983 echo "\\nDirectory structure:"
8084 tree || ls -R
8185
86+ - name : Create GitHub Release
87+ env :
88+ GH_TOKEN : ${{ secrets.PLUGIN_ACTION }}
89+ run : |
90+ PACKAGE_NAME="${{ steps.get_basic_info.outputs.plugin_name }}-${{ steps.get_basic_info.outputs.version }}.difypkg"
91+ VERSION="${{ steps.get_basic_info.outputs.version }}"
92+ PLUGIN_NAME="${{ steps.get_basic_info.outputs.plugin_name }}"
93+
94+ # Create release with the packaged file
95+ gh release create "v$VERSION" \
96+ --repo ${{ github.repository }} \
97+ --title "$PLUGIN_NAME v$VERSION" \
98+ --notes "Release $PLUGIN_NAME plugin version $VERSION
99+
100+ ## Changes
101+ - Updated plugin package to version $VERSION
102+ - Ready for deployment to Dify Marketplace
103+
104+ ## Installation
105+ Download the \`.difypkg\` file and install it in your Dify instance.
106+
107+ ## Files
108+ - \`$PACKAGE_NAME\` - Plugin package file" \
109+ --latest \
110+ "$PACKAGE_NAME"
111+
112+ echo "Release v$VERSION created successfully with package file"
113+
82114 - name : Checkout target repo
83115 uses : actions/checkout@v4
84116 with :
@@ -98,26 +130,29 @@ jobs:
98130 echo "Debug: Package name: $PACKAGE_NAME"
99131 ls -la
100132
101- # Move the packaged file to the target directory using variables
102- mkdir -p dify-plugins/${{ steps.get_basic_info.outputs.org_name }}/${{ steps.get_basic_info.outputs.plugin_name }}
103- mv "$PACKAGE_NAME" dify-plugins/${{ steps.get_basic_info.outputs.org_name }}/${{ steps.get_basic_info.outputs.plugin_name }}/
104-
105- # Enter the target repository directory
133+ # Enter the target repository directory first
106134 cd dify-plugins
107135
108136 # Configure git
109137 git config user.name "GitHub Actions"
110138 git config user.email "[email protected] " 111139
112- # Ensure we are on the latest main branch
140+ # Ensure we are on the latest main branch and clean working directory
113141 git fetch origin main
114142 git checkout main
115143 git pull origin main
144+
145+ # Clean any untracked files that might conflict
146+ git clean -fd
116147
117148 # Create and switch to a new branch using variables and new naming convention
118149 BRANCH_NAME="bump-${{ steps.get_basic_info.outputs.plugin_name }}-plugin-${{ steps.get_basic_info.outputs.version }}"
119150 git checkout -b "$BRANCH_NAME"
120151
152+ # Now move the packaged file to the target directory using variables
153+ mkdir -p ${{ steps.get_basic_info.outputs.org_name }}/${{ steps.get_basic_info.outputs.plugin_name }}
154+ mv "../$PACKAGE_NAME" ${{ steps.get_basic_info.outputs.org_name }}/${{ steps.get_basic_info.outputs.plugin_name }}/
155+
121156 # Add and commit changes (using git add .)
122157 git add .
123158 git status # for debugging
0 commit comments