Skip to content

fix: Fix another pathing issue #44

fix: Fix another pathing issue

fix: Fix another pathing issue #44

Workflow file for this run

name: CI
on:
[push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
submodules: recursive # Clone submodules recursively
persist-credentials: true # Ensure credentials are available for pushing changes
fetch-depth: 0 # Clone full history for the repository and submodules
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '20'
- name: Install pnpm
run: npm install -g pnpm
- name: Install and build plugins
run: |
pnpm install --save-dev semantic-release @semantic-release/changelog @semantic-release/git @semantic-release/github
mkdir -p dist/
cd plugins
for d in */ ; do
echo "Processing plugin: $d"
cd "$d" || { echo "Failed to access $d, skipping"; continue; }
pnpm install || { echo "Failed to install dependencies for $d, skipping"; cd ..; continue; }
pnpm run build || { echo "Failed to build $d, skipping"; cd ..; continue; }
mkdir -p ../../dist/"$d"
cp -r .millennium ../../dist/"$d".millennium || echo "Failed to move $d to dist"
cp plugin.json ../../dist/"$d"plugin.json || echo "Failed to move plugin.json to dist"
cp requirements.txt ../../dist/"$d"requirements.txt || echo "Failed to move requirements.txt to dist"
cp README.md ../../dist/"$d"README.md || echo "Failed to move README.md to dist"
cp README ../../dist/"$d"README || echo "Failed to move README to dist"
echo "{\"commit\": \"$(git rev-parse HEAD)\", \"id\": \"$(git rev-list --max-parents=0 HEAD)\"}" > metadata.json
cp metadata.json ../../dist/"$d"metadata.json || echo "Failed to move metadata.json to dist"
# Get the backend folder from plugin.json and move it to dist
backend=$(jq -r '.backend' plugin.json)
if [ "$backend" != "null" ]; then
cp -r "$backend" ../../dist/"$d""$backend" || echo "Failed to move $backend to dist"
fi
# Get extra files from include list in plugin.json and move them to dist
include=$(jq -r '.include' plugin.json)
if [ "$include" != "null" ]; then
for file in $include; do
cp -r "$file" ../../dist/"$d""$file" || echo "Failed to move $file to dist"
done
fi
cd ..
done
cd ..
node ./scripts/release.js
- name: Zip folders in /dist
run: |
mkdir -p build
cd dist
for folder in */; do
out="${folder%/}"
# get theme name
theme_id=$(jq -r '.id' "$folder"metadata.json)
echo "Zipping folder: $folder"
zip -r "$out.zip" "$folder" || echo "Failed to zip $folder"
mv "$out.zip" ../build/$theme_id.zip || echo "Failed to move $folder.zip to build"
done
- name: List built plugins
run: ls -l build/
- name: Run Semantic Release
run: |
npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}