Skip to content

Commit d4f460a

Browse files
authored
Merge pull request #8 from JAVA-LW/taichuy_dev
ci(plugin-publish): 优化插件发布流程的可靠性和顺序
2 parents 98c95b6 + 981d736 commit d4f460a

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

.github/workflows/plugin-publish.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -132,26 +132,29 @@ jobs:
132132
echo "Debug: Package name: $PACKAGE_NAME"
133133
ls -la
134134
135-
# Move the packaged file to the target directory using variables
136-
mkdir -p dify-plugins/${{ steps.get_basic_info.outputs.org_name }}/${{ steps.get_basic_info.outputs.plugin_name }}
137-
mv "$PACKAGE_NAME" dify-plugins/${{ steps.get_basic_info.outputs.org_name }}/${{ steps.get_basic_info.outputs.plugin_name }}/
138-
139-
# Enter the target repository directory
135+
# Enter the target repository directory first
140136
cd dify-plugins
141137
142138
# Configure git
143139
git config user.name "GitHub Actions"
144140
git config user.email "[email protected]"
145141
146-
# Ensure we are on the latest main branch
142+
# Ensure we are on the latest main branch and clean working directory
147143
git fetch origin main
148144
git checkout main
149145
git pull origin main
146+
147+
# Clean any untracked files that might conflict
148+
git clean -fd
150149
151150
# Create and switch to a new branch using variables and new naming convention
152151
BRANCH_NAME="bump-${{ steps.get_basic_info.outputs.plugin_name }}-plugin-${{ steps.get_basic_info.outputs.version }}"
153152
git checkout -b "$BRANCH_NAME"
154153
154+
# Now move the packaged file to the target directory using variables
155+
mkdir -p ${{ steps.get_basic_info.outputs.org_name }}/${{ steps.get_basic_info.outputs.plugin_name }}
156+
mv "../$PACKAGE_NAME" ${{ steps.get_basic_info.outputs.org_name }}/${{ steps.get_basic_info.outputs.plugin_name }}/
157+
155158
# Add and commit changes (using git add .)
156159
git add .
157160
git status # for debugging

0 commit comments

Comments
 (0)