@@ -8,63 +8,14 @@ current=`git rev-parse --abbrev-ref HEAD`
88version=` node -e " console.log(require('./package.json').version);" `
99dist=" plugins/v$version "
1010
11- echo " Publishing plugins: $current -> $dist (v$version )"
12-
13- if [[ " $1 " == " --all-branches" ]]; then
14- rm -rf .dist .js
15- git fetch --all
16- branches=$( git branch -r | grep -v ' \->' )
17- for branch in $branches ; do
18- # Skip branches with different publish-plugins.sh version
19- if ! diff scripts/publish-plugins.sh <( git show " $branch :scripts/publish-plugins.sh" ) > /dev/null; then
20- echo " ⚠️ Skipping $branch (script version mismatch)"
21- continue
22- fi
23- echo " ::group::Branch $branch "
24- echo " Processing: $branch "
25- git stash push -a -- .dist .js
26- git checkout -f $branch
27- exists=` git show-ref refs/heads/$dist `
28- if [ -n " $exists " ]; then
29- git branch -D $dist
30- fi
31- git stash pop
32- npm run clean:multisrc
33- npm run build:multisrc
34- echo " Compiling TypeScript..."
35- npx tsc --project tsconfig.production.json
36- echo " # $branch " >> $GITHUB_STEP_SUMMARY
37- npm run build:manifest -- --only-new 2>> $GITHUB_STEP_SUMMARY
38- if [ ! -d " .dist" ] || [ -z " $( ls -A .dist) " ]; then
39- echo " ❌ ERROR: Manifest generation failed - .dist is missing or empty"
40- exit 1
41- fi
42- echo " ✅ Done: $branch "
43- echo " ::endgroup::"
44- done
45- echo
46- echo " ::group::Publish All Branches"
47- echo " Publishing combined plugins..."
48- git checkout --orphan $dist
49- if [ $? -eq 1 ]; then
50- echo " ❌ ERROR: Failed to create branch $dist "
51- echo " ::endgroup::"
52- exit 1
53- fi
54- git reset
55- # Copy plugins to legacy path (.js/src/plugins) for backward compatibility
56- echo " Copying .js/plugins -> .js/src/plugins"
57- mkdir -p .js/src
58- cp -r .js/plugins .js/src/plugins
59- git add -f public/static .dist .js/src/plugins total.svg
60- git commit -m " chore: Publish Plugins From All Branches"
61- git push -f origin $dist
62- git checkout -f $branch
63- echo " ✅ Published all branches to $dist "
64- echo " ::endgroup::"
65- exit 0
11+ if [ " $current " -eq " master" ]; then
12+ dist=" plugins/v$version "
13+ else
14+ dist=" $current /dist-v$version "
6615fi
6716
17+ echo " Publishing plugins: $current -> $dist (v$version )"
18+
6819exists=` git show-ref refs/heads/$dist `
6920
7021if [ -n " $exists " ]; then
0 commit comments