Skip to content

Commit 579b2ae

Browse files
authored
Refactor release workflow to handle multiple submodules
1 parent 407d42e commit 579b2ae

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

‎.github/workflows/release.yml‎

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,17 +110,23 @@ jobs:
110110
git config user.email "github-actions[bot]@users.noreply.github.com"
111111
112112
if [ -f .gitmodules ]; then
113-
git rm --cached -r inc/wp-github-updater || true
114-
rm .gitmodules || echo "Sem .gitmodules"
115-
rm -rf inc/wp-github-updater/.git || true
116113
117-
git add inc/wp-github-updater
114+
MODULES=$(git config --file .gitmodules --get-regexp path | awk '{ print $2 }')
115+
116+
for MODULE in $MODULES; do
117+
git rm --cached -r "$MODULE" || true
118+
rm -rf "$MODULE/.git" || true
119+
git add "$MODULE"
120+
done
121+
122+
rm .gitmodules || true
118123
git commit -m "Build release $tag with embedded submodules"
119124
fi
120125
121126
git tag -a "$tag" -m "Release $tag"
122127
git push origin "$tag"
123128
129+
124130
- name: Publish release
125131
uses: softprops/action-gh-release@v2
126132
with:

0 commit comments

Comments
 (0)