Skip to content

Commit bc84be3

Browse files
authored
Merge pull request #6 from JAVA-LW/taichuy_dev
ci(workflow): 添加将插件包提交到源仓库的步骤
2 parents 77d73d7 + ce414e0 commit bc84be3

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

.github/workflows/plugin-publish.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,31 @@ jobs:
7979
echo "\\nDirectory structure:"
8080
tree || ls -R
8181
82+
- name: Commit package to source repo
83+
run: |
84+
# Create releases directory if it doesn't exist
85+
mkdir -p releases
86+
87+
# Copy the package file to releases directory
88+
PACKAGE_NAME="${{ steps.get_basic_info.outputs.plugin_name }}-${{ steps.get_basic_info.outputs.version }}.difypkg"
89+
cp "$PACKAGE_NAME" releases/
90+
91+
# Configure git
92+
git config user.name "GitHub Actions"
93+
git config user.email "[email protected]"
94+
95+
# Add and commit the package file
96+
git add releases/"$PACKAGE_NAME"
97+
98+
# Check if there are changes to commit
99+
if git diff --staged --quiet; then
100+
echo "No changes to commit"
101+
else
102+
git commit -m "add plugin package ${{ steps.get_basic_info.outputs.plugin_name }} v${{ steps.get_basic_info.outputs.version }}"
103+
git push origin main
104+
echo "Package committed to source repository"
105+
fi
106+
82107
- name: Checkout target repo
83108
uses: actions/checkout@v4
84109
with:

0 commit comments

Comments
 (0)