Update ci.yml #9
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| [push, pull_request] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v2 | |
| with: | |
| submodules: true | |
| persist-credentials: true # Ensures credentials are available for pushing changes | |
| - 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: | | |
| mkdir -p dist/plugins | |
| 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/plugins/"$d" | |
| mv .millennium ../../dist/plugins/"$d".millennium || echo "Failed to move $d to dist/plugins" | |
| cd .. | |
| done | |
| - name: Commit and push changes | |
| run: | | |
| git config --global user.name "GitHub Actions" | |
| git config --global user.email "[email protected]" | |
| cd dist | |
| git add . | |
| git commit -m "Update built plugins" | |
| git push origin HEAD || echo "No changes to push" |