|
10 | 10 | workflow_dispatch: |
11 | 11 |
|
12 | 12 | jobs: |
13 | | - test-build: |
| 13 | + prepare: |
14 | 14 | runs-on: ubuntu-latest |
15 | 15 |
|
| 16 | + outputs: |
| 17 | + submodule-matrix: ${{ steps.discover-submodules.outputs.submodule-matrix }} |
16 | 18 | steps: |
17 | 19 | - name: Checkout repository |
18 | 20 | uses: actions/checkout@v4 |
19 | 21 | with: |
| 22 | + submodules: recursive |
20 | 23 | repository: ${{ github.event.pull_request.head.repo.full_name }} |
21 | 24 | ref: ${{ github.event.pull_request.head.ref }} |
22 | 25 | persist-credentials: false |
23 | 26 | fetch-depth: 0 |
| 27 | + |
| 28 | + - name: Set up Node.js |
| 29 | + uses: actions/setup-node@v2 |
| 30 | + with: |
| 31 | + node-version: '20' |
| 32 | + |
| 33 | + - name: Install pnpm |
| 34 | + run: npm install -g pnpm |
| 35 | + |
| 36 | + - name: Discover submodules |
| 37 | + id: discover-submodules |
| 38 | + run: | |
| 39 | + sudo node ./scripts/generate-metadata.js |
| 40 | + sudo node ./scripts/discover-submodules.js > submodules.json |
| 41 | + cat submodules.json |
| 42 | +
|
| 43 | + echo "submodule-matrix=$(cat submodules.json)" >> $GITHUB_OUTPUT |
| 44 | +
|
| 45 | + - name: Commit Metadata |
| 46 | + if: github.event_name != 'pull_request' && github.event.repository.fork == false |
| 47 | + run: | |
| 48 | + git config --global user.name 'github-actions[bot]' |
| 49 | + git config --global user.email 'github-actions[bot]@users.noreply.github.com' |
| 50 | +
|
| 51 | + # Stage the changes |
| 52 | + git add metadata.json |
| 53 | +
|
| 54 | + # Commit only if there are changes |
| 55 | + if git commit -m "chore: Add plugin metadata"; then |
| 56 | + # Push only if the commit succeeded |
| 57 | + git push |
| 58 | + else |
| 59 | + echo "::debug::No changes to commit." |
| 60 | + fi |
| 61 | +
|
| 62 | + make: |
| 63 | + needs: prepare |
| 64 | + runs-on: ubuntu-latest |
| 65 | + strategy: |
| 66 | + fail-fast: false |
| 67 | + matrix: ${{ fromJson(needs.prepare.outputs.submodule-matrix) }} |
| 68 | + name: Build (${{ matrix.submodules.repository }}) |
| 69 | + steps: |
| 70 | + - name: Checkout Repository |
| 71 | + uses: actions/checkout@v4 |
| 72 | + with: |
| 73 | + repository: ${{ matrix.submodules.repository }} |
| 74 | + ref: ${{ matrix.submodules.sha }} |
| 75 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 76 | + fetch-depth: 0 |
24 | 77 | submodules: recursive |
25 | 78 |
|
26 | 79 | - name: Set up Node.js |
|
0 commit comments