chore: Update Plugin Publishing Script
This commit is contained in:
@@ -1,6 +1,9 @@
|
|||||||
$current=$(git rev-parse --abbrev-ref HEAD)
|
$current=$(git rev-parse --abbrev-ref HEAD)
|
||||||
$version=$(node -e "console.log(require('./package.json').version);")
|
$version=$(node -e "console.log(require('./package.json').version);")
|
||||||
$dist="plugins/v$($version)"
|
$dist="plugins/v$($version)"
|
||||||
|
|
||||||
|
echo "Publishing plugins: $current -> $dist (v$version)"
|
||||||
|
|
||||||
$exists=$(git show-ref refs/heads/$dist)
|
$exists=$(git show-ref refs/heads/$dist)
|
||||||
|
|
||||||
if ($exists){
|
if ($exists){
|
||||||
@@ -10,9 +13,7 @@ if ($exists){
|
|||||||
git checkout --orphan $dist
|
git checkout --orphan $dist
|
||||||
|
|
||||||
if(-Not $?){
|
if(-Not $?){
|
||||||
# If checkout failed
|
echo "❌ ERROR: Failed to create branch $dist"
|
||||||
echo "=========="
|
|
||||||
echo "Could not checkout branch dist! See the error above and fix it!"
|
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -20,18 +21,22 @@ git reset
|
|||||||
rm -r -fo .js
|
rm -r -fo .js
|
||||||
npm run clean:multisrc
|
npm run clean:multisrc
|
||||||
npm run build:multisrc
|
npm run build:multisrc
|
||||||
|
echo "Compiling TypeScript..."
|
||||||
npx tsc --project tsconfig.production.json
|
npx tsc --project tsconfig.production.json
|
||||||
npm run build:manifest
|
npm run build:manifest
|
||||||
|
|
||||||
if (-not (Test-Path .dist) -or -not (Get-ChildItem -Path .dist -Force)) {
|
if (-not (Test-Path .dist) -or -not (Get-ChildItem -Path .dist -Force)) {
|
||||||
echo "=========="
|
echo "❌ ERROR: Manifest generation failed - .dist is missing or empty"
|
||||||
echo "JSON files were not generated! See the error above and fix it!"
|
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
git add -f public/static .dist .js/plugins total.svg
|
# Copy plugins to legacy path (.js/src/plugins) for backward compatibility
|
||||||
|
echo "Copying .js/plugins -> .js/src/plugins"
|
||||||
|
New-Item -ItemType Directory -Force -Path .js/src | Out-Null
|
||||||
|
Copy-Item -Path .js/plugins -Destination .js/src/plugins -Recurse -Force
|
||||||
|
git add -f public/static .dist .js/src/plugins total.svg
|
||||||
git commit -m "chore: Publish Plugins"
|
git commit -m "chore: Publish Plugins"
|
||||||
git push -f origin $dist
|
git push -f origin $dist
|
||||||
|
|
||||||
git checkout -f $current
|
git checkout -f $current
|
||||||
|
echo "✅ Published to $dist"
|
||||||
|
|
||||||
|
|||||||
@@ -53,10 +53,10 @@ if [[ "$1" == "--all-branches" ]]; then
|
|||||||
fi
|
fi
|
||||||
git reset
|
git reset
|
||||||
# Copy plugins to legacy path (.js/src/plugins) for backward compatibility
|
# Copy plugins to legacy path (.js/src/plugins) for backward compatibility
|
||||||
echo "Copying .js/plugins -> .js/src/plugins (backward compatibility)"
|
echo "Copying .js/plugins -> .js/src/plugins"
|
||||||
mkdir -p .js/src
|
mkdir -p .js/src
|
||||||
cp -r .js/plugins .js/src/plugins
|
cp -r .js/plugins .js/src/plugins
|
||||||
git add -f public/static .dist .js/plugins .js/src/plugins total.svg
|
git add -f public/static .dist .js/src/plugins total.svg
|
||||||
git commit -m "chore: Publish Plugins From All Branches"
|
git commit -m "chore: Publish Plugins From All Branches"
|
||||||
git push -f origin $dist
|
git push -f origin $dist
|
||||||
git checkout -f $branch
|
git checkout -f $branch
|
||||||
@@ -92,10 +92,10 @@ if [ ! -d ".dist" ] || [ -z "$(ls -A .dist)" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Copy plugins to legacy path (.js/src/plugins) for backward compatibility
|
# Copy plugins to legacy path (.js/src/plugins) for backward compatibility
|
||||||
echo "Copying .js/plugins -> .js/src/plugins (backward compatibility)"
|
echo "Copying .js/plugins -> .js/src/plugins"
|
||||||
mkdir -p .js/src
|
mkdir -p .js/src
|
||||||
cp -r .js/plugins .js/src/plugins
|
cp -r .js/plugins .js/src/plugins
|
||||||
git add -f public/static .dist .js/plugins .js/src/plugins total.svg
|
git add -f public/static .dist .js/src/plugins total.svg
|
||||||
git commit -m "chore: Publish Plugins"
|
git commit -m "chore: Publish Plugins"
|
||||||
git push -f origin $dist 2>&1
|
git push -f origin $dist 2>&1
|
||||||
git checkout -f $current 2>&1
|
git checkout -f $current 2>&1
|
||||||
|
|||||||
Reference in New Issue
Block a user