File tree Expand file tree Collapse file tree 2 files changed +35
-22
lines changed
Expand file tree Collapse file tree 2 files changed +35
-22
lines changed Original file line number Diff line number Diff line change 1+ # reusable workflow
2+ name : .pkgs
3+
4+ on :
5+ workflow_call :
6+ outputs :
7+ list :
8+ description : List of packages as JSON array
9+ value : ${{ jobs.run.outputs.pkgs }}
10+
11+ jobs :
12+ run :
13+ runs-on : ubuntu-24.04
14+ outputs :
15+ pkgs : ${{ steps.set.outputs.pkgs }}
16+ steps :
17+ -
18+ name : Checkout
19+ uses : actions/checkout@v6
20+ -
21+ name : Set pkgs output
22+ id : set
23+ uses : actions/github-script@v8
24+ with :
25+ script : |
26+ const fs = require('fs');
27+ const path = require('path');
28+ const disabledPkgs = (process.env.DISABLED_PACKAGES || '').split(',').map(s => s.trim()).filter(Boolean);
29+ const pkgs = fs.readdirSync('./pkg', { withFileTypes: true }).filter(d => d.isDirectory()).map(d => d.name).filter(name => !disabledPkgs.includes(name));
30+ core.info(JSON.stringify(pkgs, null, 2));
31+ core.setOutput('pkgs', JSON.stringify(pkgs));
Original file line number Diff line number Diff line change 1111 - cron : ' 0 1 * * 0'
1212
1313jobs :
14- prepare :
15- runs-on : ubuntu-24.04
16- outputs :
17- pkgs : ${{ steps.matrix.outputs.pkgs }}
18- steps :
19- -
20- name : Checkout
21- uses : actions/checkout@v6
22- -
23- name : Matrix
24- id : matrix
25- uses : actions/github-script@v8
26- with :
27- script : |
28- const fs = require('fs');
29- const path = require('path');
30- const disabledPkgs = (process.env.DISABLED_PACKAGES || '').split(',').map(s => s.trim()).filter(Boolean);
31- const pkgs = fs.readdirSync('./pkg', { withFileTypes: true }).filter(d => d.isDirectory()).map(d => d.name).filter(name => !disabledPkgs.includes(name));
32- core.info(JSON.stringify(pkgs, null, 2));
33- core.setOutput('pkgs', JSON.stringify(pkgs));
14+ pkgs :
15+ uses : ./.github/workflows/.pkgs.yml
3416
3517 build :
3618 uses : ./.github/workflows/.build.yml
3719 needs :
38- - prepare
20+ - pkgs
3921 strategy :
4022 fail-fast : false
4123 matrix :
42- pkg : ${{ fromJson(needs.prepare .outputs.pkgs ) }}
24+ pkg : ${{ fromJson(needs.pkgs .outputs.list ) }}
4325 with :
4426 name : ${{ matrix.pkg }}
4527 release : pushonly
You can’t perform that action at this time.
0 commit comments