@intellectual-frontiers/libraries 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +75 -21
- package/dist/affected.d.ts +1 -1
- package/dist/dev.d.ts +2 -0
- package/dist/dev.js +14 -2
- package/dist/family.js +1 -0
- package/dist/generate-ontology.js +4 -0
- package/dist/imports/nist-sp-800-53.auto.prov.ttl +22 -0
- package/dist/imports/schema-org.auto.prov.ttl +22 -0
- package/dist/install-bun.js +19 -14
- package/dist/libraries.d.ts +39 -2
- package/dist/libraries.js +80 -9
- package/dist/license/PolyForm-Noncommercial-1.0.0.md +73 -0
- package/dist/license/standard.d.ts +46 -0
- package/dist/license/standard.js +43 -0
- package/dist/license/third-party.d.ts +25 -0
- package/dist/license/third-party.js +71 -0
- package/dist/license.d.ts +61 -0
- package/dist/license.js +204 -0
- package/dist/link.d.ts +1 -1
- package/dist/link.js +4 -4
- package/dist/metapackages.d.ts +62 -0
- package/dist/metapackages.js +190 -0
- package/dist/mod.d.ts +1 -1
- package/dist/mod.js +1 -1
- package/dist/pack-library.d.ts +9 -0
- package/dist/pack-library.js +46 -58
- package/dist/pack-metapackage.d.ts +22 -0
- package/dist/pack-metapackage.js +147 -0
- package/dist/pins.d.ts +34 -7
- package/dist/pins.js +36 -9
- package/dist/readme.d.ts +71 -0
- package/dist/readme.js +310 -0
- package/dist/releasing.d.ts +8 -1
- package/dist/releasing.js +44 -14
- package/dist/workflows/definitions.d.ts +2 -2
- package/dist/workflows/definitions.js +32 -114
- package/dist/workflows/model.d.ts +6 -0
- package/dist/workflows/render.js +2 -0
- package/dist/workflows/schema/github-workflow.schema.json +2290 -0
- package/package.json +39 -14
- package/src/affected.ts +1 -1
- package/src/dev.ts +13 -2
- package/src/family.ts +1 -0
- package/src/generate-ontology.ts +4 -0
- package/src/imports/nist-sp-800-53.auto.prov.ttl +22 -0
- package/src/imports/schema-org.auto.prov.ttl +22 -0
- package/src/install-bun.ts +16 -13
- package/src/libraries.ts +100 -8
- package/src/license/PolyForm-Noncommercial-1.0.0.md +73 -0
- package/src/license/standard.ts +67 -0
- package/src/license/third-party.ts +87 -0
- package/src/license.ts +222 -0
- package/src/link.ts +4 -4
- package/src/metapackages.ts +206 -0
- package/src/mod.ts +1 -1
- package/src/pack-library.ts +52 -55
- package/src/pack-metapackage.ts +137 -0
- package/src/pins.ts +55 -10
- package/src/readme.ts +320 -0
- package/src/releasing.ts +47 -16
- package/src/workflows/definitions.ts +36 -133
- package/src/workflows/model.ts +6 -0
- package/src/workflows/render.ts +1 -0
- package/src/workflows/schema/github-workflow.schema.json +2290 -0
|
@@ -27,9 +27,9 @@ export const PIN = {
|
|
|
27
27
|
bun: "./.github/actions/bun",
|
|
28
28
|
} as const;
|
|
29
29
|
|
|
30
|
-
/** The Node that is the backup runtime (commons 0005-typescript-
|
|
30
|
+
/** The Node that is the backup runtime (commons 0005-typescript-practice FR-018). */
|
|
31
31
|
export const NODE_VERSION = "26.13.1";
|
|
32
|
-
/** The canary of Bun that runs the linter until a release does (
|
|
32
|
+
/** The canary of Bun that runs the linter until a release does (commons 0005-typescript-practice FR-028). */
|
|
33
33
|
export const BUN_LINT_VERSION = "1.4.4-canary.20261115.1";
|
|
34
34
|
|
|
35
35
|
const checkout = (o: { readonly fetchDepth?: number; readonly comment?: string } = {}): Step =>
|
|
@@ -39,8 +39,6 @@ const checkout = (o: { readonly fetchDepth?: number; readonly comment?: string }
|
|
|
39
39
|
});
|
|
40
40
|
const bun = (o: { readonly nodeVersion?: string } = {}): Step =>
|
|
41
41
|
use(PIN.bun, o.nodeVersion === undefined ? {} : { with: { "node-version": o.nodeVersion } });
|
|
42
|
-
const setupNode = (when?: string): Step =>
|
|
43
|
-
use(PIN.setupNode, { ...(when === undefined ? {} : { when }), with: { "node-version": expr("env.NODE_VERSION") } });
|
|
44
42
|
const tools = (workingDirectory: string, name = "The development tools, from bun.lock"): Step =>
|
|
45
43
|
run("bun install --frozen-lockfile", { name, workingDirectory });
|
|
46
44
|
|
|
@@ -140,7 +138,7 @@ const CI_PATHS = ["commons/**", "package.json", "bun.lock", BUN_ACTION, own("ci"
|
|
|
140
138
|
const cellSteps = (): readonly [Step, ...Step[]] => [
|
|
141
139
|
checkout(),
|
|
142
140
|
bun(),
|
|
143
|
-
tools(expr("matrix.folder"), "The development tools, from bun.lock (the
|
|
141
|
+
tools(expr("matrix.folder"), "The development tools, from bun.lock (the libraries it imports are linked)"),
|
|
144
142
|
run(expr("matrix.verify"), { name: "verify (its packing is checked where the exports changed, and by the release)", workingDirectory: expr("matrix.folder"), env: { IFC_SKIP_PACK: expr("matrix.pack == false && '1' || ''") } }),
|
|
145
143
|
run(expr("matrix.after"), { name: "After verify", when: "matrix.after != ''", workingDirectory: expr("matrix.folder"), shell: "bash" }),
|
|
146
144
|
run(expr("matrix.node"), { name: "The tests on Node 26", when: "matrix.node != ''", workingDirectory: expr("matrix.folder"), shell: "bash" }),
|
|
@@ -160,7 +158,7 @@ const ci: Workflow = {
|
|
|
160
158
|
"and the libraries that change affects (their folders, what they import and what depends on them); `verify` and the tests on Node 26 run for those libraries on Linux, and on Windows and macOS only for the libraries whose",
|
|
161
159
|
"record of CI (`LIBRARY_CI`) names them, because they have code of their own for those systems. Nothing else is run. The job `ci` is the one result to require.",
|
|
162
160
|
).trimEnd(),
|
|
163
|
-
on: { push: { paths: CI_PATHS }, pullRequest: { paths: CI_PATHS }, workflowDispatch: true },
|
|
161
|
+
on: { push: { paths: CI_PATHS }, pullRequest: { paths: CI_PATHS }, workflowDispatch: true, schedule: ["17 3 * * *"] },
|
|
164
162
|
permissions: { contents: "read" },
|
|
165
163
|
env: { NODE_VERSION },
|
|
166
164
|
concurrency: {
|
|
@@ -189,8 +187,10 @@ const ci: Workflow = {
|
|
|
189
187
|
'elif [ "$GITHUB_REF" = refs/heads/main ]; then base="${{ github.event.before }}"',
|
|
190
188
|
"else base=origin/main; fi",
|
|
191
189
|
'case "$base" in ""|0000000000000000000000000000000000000000) base=origin/main ;; esac',
|
|
192
|
-
'if [ "$GITHUB_EVENT_NAME" = workflow_dispatch ]; then scope=--all; else scope="--base $base"; fi',
|
|
190
|
+
'if [ "$GITHUB_EVENT_NAME" = workflow_dispatch ] || [ "$GITHUB_EVENT_NAME" = schedule ]; then scope=--all; else scope="--base $base"; fi',
|
|
193
191
|
'bun commons/libraries/src/plan.ts $scope --github-output "$GITHUB_OUTPUT"',
|
|
192
|
+
"# the proof plan of the same change (commons repoctl 0008-repoctl-prove), written to the summary of the run: what a person would run, and why each skipped proof is safe; it gates nothing, the matrices above do",
|
|
193
|
+
"{ echo '### Proof plan'; echo '```'; bun commons/repoctl/src/repoctl.ts prove --tier 6 --why $scope 2>&1 || true; echo '```'; } >> \"$GITHUB_STEP_SUMMARY\"",
|
|
194
194
|
),
|
|
195
195
|
{ name: "The libraries this change affects, and the systems each runs on", id: "plan", shell: "bash" },
|
|
196
196
|
),
|
|
@@ -234,87 +234,20 @@ const ci: Workflow = {
|
|
|
234
234
|
},
|
|
235
235
|
};
|
|
236
236
|
|
|
237
|
-
const
|
|
238
|
-
"commons/ts/**",
|
|
239
|
-
"commons/docs/**",
|
|
240
|
-
"commons/generated/pins.auto.env",
|
|
241
|
-
"package.json",
|
|
242
|
-
"bun.lock",
|
|
243
|
-
BUN_ACTION,
|
|
244
|
-
own("ifc-typescript"),
|
|
245
|
-
];
|
|
237
|
+
const conformancePaths = ["commons/telemetry/**", "commons/system/**", "commons/generated/pins.auto.env", BUN_ACTION, own("conformance")];
|
|
246
238
|
|
|
247
|
-
const
|
|
248
|
-
file: "
|
|
249
|
-
name: "
|
|
239
|
+
const conformance: Workflow = {
|
|
240
|
+
file: "conformance",
|
|
241
|
+
name: "conformance",
|
|
250
242
|
comment: lines(
|
|
251
|
-
"
|
|
252
|
-
"and
|
|
253
|
-
"as a consumer installs it, and used there on Bun and Node 26 (through the hook), IFC Docs too (0011-documentation FR-021, FR-022). Nothing is released.",
|
|
243
|
+
"What a library's own tests cannot run alone: the OTLP of the telemetry library sent to the pinned OpenTelemetry Collector and read back from its file exporter (telemetry 0001-telemetry FR-020),",
|
|
244
|
+
"and a program built into one binary by the pinned Bun on each system, then run, and Windows built from Linux (system 0001-system FR-013). Nothing is released.",
|
|
254
245
|
).trimEnd(),
|
|
255
|
-
on: { push: { paths:
|
|
246
|
+
on: { push: { paths: conformancePaths }, pullRequest: { paths: conformancePaths } },
|
|
256
247
|
permissions: { contents: "read" },
|
|
257
|
-
env: { NODE_VERSION
|
|
248
|
+
env: { NODE_VERSION },
|
|
258
249
|
concurrency: supersedable,
|
|
259
250
|
jobs: {
|
|
260
|
-
check: job({
|
|
261
|
-
runsOn: "ubuntu-latest",
|
|
262
|
-
timeoutMinutes: 10,
|
|
263
|
-
steps: [
|
|
264
|
-
checkout(),
|
|
265
|
-
bun(),
|
|
266
|
-
tools("commons/ts"),
|
|
267
|
-
run("bun x tsc --version && bun run check", {
|
|
268
|
-
name: "TypeScript 7 on everything, then the kernel with no host types",
|
|
269
|
-
workingDirectory: "commons/ts",
|
|
270
|
-
}),
|
|
271
|
-
run("bun fmt --check", { name: "The formatter", workingDirectory: "commons/ts" }),
|
|
272
|
-
run('bun x "bun@$BUN_LINT_VERSION" lint --type-aware --max-warnings 0 kernel runtime tests tools', {
|
|
273
|
-
name: "The linter, type-aware, no warning allowed",
|
|
274
|
-
workingDirectory: "commons/ts",
|
|
275
|
-
}),
|
|
276
|
-
],
|
|
277
|
-
}),
|
|
278
|
-
test: job({
|
|
279
|
-
runsOn: expr("matrix.os"),
|
|
280
|
-
timeoutMinutes: 15,
|
|
281
|
-
strategy: { failFast: false, matrix: { os: ["ubuntu-latest", "macos-latest", "windows-latest"], runtime: ["bun", "node"] } },
|
|
282
|
-
steps: [
|
|
283
|
-
checkout(),
|
|
284
|
-
bun(),
|
|
285
|
-
tools("commons/ts"),
|
|
286
|
-
setupNode("matrix.runtime == 'node'"),
|
|
287
|
-
run('bun x "bun@$BUN_LINT_VERSION" --version', {
|
|
288
|
-
name: "The linter's canary, so the lint plugin's tests run rather than skip",
|
|
289
|
-
shell: "bash",
|
|
290
|
-
}),
|
|
291
|
-
run(
|
|
292
|
-
lines(
|
|
293
|
-
`grep -E '^000[5-8]-' ../spec-kit/enforcement.tsv >"$RUNNER_TEMP/requirements.tsv"`,
|
|
294
|
-
"bun ../quality/src/test-cli.ts run --runtime ${{ matrix.runtime }} --out test-results \\",
|
|
295
|
-
" --report tap,junit,ctrf,sarif,md,html,oscal \\",
|
|
296
|
-
' --requirements "$RUNNER_TEMP/requirements.tsv" --reviewed ci-reviewed.tsv \\',
|
|
297
|
-
" --ledger test-results/ledger.jsonl tests",
|
|
298
|
-
),
|
|
299
|
-
{
|
|
300
|
-
name: "The suite on ${{ matrix.runtime }}, recorded as evidence (commons 0008-test-evidence FR-014)",
|
|
301
|
-
comment: "A hang ends here, so the record of what ran is still kept below.",
|
|
302
|
-
timeoutMinutes: 10,
|
|
303
|
-
workingDirectory: "commons/ts",
|
|
304
|
-
shell: "bash",
|
|
305
|
-
},
|
|
306
|
-
),
|
|
307
|
-
use(PIN.uploadArtifact, {
|
|
308
|
-
name: "The record, its reports and the ledger, kept with the run",
|
|
309
|
-
when: "always()",
|
|
310
|
-
with: {
|
|
311
|
-
name: "test-evidence-${{ matrix.os }}-${{ matrix.runtime }}",
|
|
312
|
-
path: "commons/ts/test-results/",
|
|
313
|
-
"if-no-files-found": "error",
|
|
314
|
-
},
|
|
315
|
-
}),
|
|
316
|
-
],
|
|
317
|
-
}),
|
|
318
251
|
"otel-conformance": job({
|
|
319
252
|
comment:
|
|
320
253
|
"commons 0006-signals FR-020: the suite's OTLP sent to the pinned OpenTelemetry Collector, read back from its file exporter.",
|
|
@@ -326,11 +259,11 @@ const ifcTypescript: Workflow = {
|
|
|
326
259
|
tools("commons/telemetry"),
|
|
327
260
|
run(
|
|
328
261
|
lines(
|
|
329
|
-
"
|
|
262
|
+
"url=$(sed -n 's/^OTELCOL_CONTRIB_URL_X86_64=//p' commons/generated/pins.auto.env)",
|
|
330
263
|
"sum=$(sed -n 's/^OTELCOL_CONTRIB_SHA256_X86_64=//p' commons/generated/pins.auto.env)",
|
|
331
264
|
'dir="$RUNNER_TEMP/otelcol"',
|
|
332
265
|
'mkdir -p "$dir"',
|
|
333
|
-
'curl -fsSL -o "$dir/otelcol.tar.gz" "
|
|
266
|
+
'curl -fsSL -o "$dir/otelcol.tar.gz" "$url"',
|
|
334
267
|
'echo "$sum $dir/otelcol.tar.gz" | sha256sum -c -',
|
|
335
268
|
'tar -xzf "$dir/otelcol.tar.gz" -C "$dir" otelcol-contrib',
|
|
336
269
|
'echo "IFC_OTELCOL=$dir/otelcol-contrib" >>"$GITHUB_ENV"',
|
|
@@ -345,7 +278,7 @@ const ifcTypescript: Workflow = {
|
|
|
345
278
|
}),
|
|
346
279
|
compile: job({
|
|
347
280
|
comment:
|
|
348
|
-
"commons
|
|
281
|
+
"commons system 0001-system FR-013: a program built into one binary by the pinned Bun on each system, then run; and Windows built from Linux.",
|
|
349
282
|
runsOn: expr("matrix.os"),
|
|
350
283
|
timeoutMinutes: 10,
|
|
351
284
|
strategy: { failFast: false, matrix: { os: ["ubuntu-latest", "macos-latest", "windows-latest"] } },
|
|
@@ -380,47 +313,15 @@ const ifcTypescript: Workflow = {
|
|
|
380
313
|
),
|
|
381
314
|
],
|
|
382
315
|
}),
|
|
383
|
-
"git-dependency": job({
|
|
384
|
-
comment: lines(
|
|
385
|
-
"commons 0005-typescript-runtime FR-030 and 0011-documentation FR-022: the commit checked, installed into an empty project by a",
|
|
386
|
-
"git+file: URL of this checkout, as a consumer installs it by github:intellectual-frontiers/.github#<commit>, and used there.",
|
|
387
|
-
).trimEnd(),
|
|
388
|
-
runsOn: expr("matrix.os"),
|
|
389
|
-
timeoutMinutes: 15,
|
|
390
|
-
strategy: { failFast: false, matrix: { os: ["ubuntu-latest", "macos-latest", "windows-latest"] } },
|
|
391
|
-
steps: [
|
|
392
|
-
checkout({
|
|
393
|
-
fetchDepth: 0,
|
|
394
|
-
comment: "Bun clones the checkout as a Git repository; a whole one, so that nothing depends on how a shallow clone is cloned.",
|
|
395
|
-
}),
|
|
396
|
-
bun({ nodeVersion: expr("env.NODE_VERSION") }),
|
|
397
|
-
run("bun install --frozen-lockfile", {
|
|
398
|
-
name: "The root package's lockfile, which the consumer does not read but this repository keeps",
|
|
399
|
-
}),
|
|
400
|
-
run(
|
|
401
|
-
lines("bun install --frozen-lockfile", "node --version", 'bun tools/smoke.ts --repo "$GITHUB_WORKSPACE" --commit "$GITHUB_SHA"'),
|
|
402
|
-
{
|
|
403
|
-
name: "IFC TypeScript as a Git dependency, on Bun and Node 26, with ifc test and tsc 7",
|
|
404
|
-
workingDirectory: "commons/ts",
|
|
405
|
-
shell: "bash",
|
|
406
|
-
},
|
|
407
|
-
),
|
|
408
|
-
run(lines("bun install --frozen-lockfile", 'bun tools/smoke.ts --repo "$GITHUB_WORKSPACE" --commit "$GITHUB_SHA"'), {
|
|
409
|
-
name: "IFC Docs as a Git dependency, ifc-docs check and build on a fixture repository on Bun and Node 26",
|
|
410
|
-
workingDirectory: "commons/docs",
|
|
411
|
-
shell: "bash",
|
|
412
|
-
}),
|
|
413
|
-
],
|
|
414
|
-
}),
|
|
415
316
|
},
|
|
416
317
|
};
|
|
417
318
|
|
|
418
|
-
const docsPaths = ["commons/**", "package.json", own("
|
|
319
|
+
const docsPaths = ["commons/**", "package.json", own("site"), BUN_ACTION];
|
|
419
320
|
const onMainPush = "github.event_name != 'pull_request' && github.ref == 'refs/heads/main'";
|
|
420
321
|
|
|
421
|
-
const
|
|
422
|
-
file: "
|
|
423
|
-
name: "
|
|
322
|
+
const site: Workflow = {
|
|
323
|
+
file: "site",
|
|
324
|
+
name: "site",
|
|
424
325
|
comment: lines(
|
|
425
326
|
"The documentation site of commons (commons 0011-documentation FR-020): made by commons/docs, from commons' TypeScript and spec kit alone,",
|
|
426
327
|
"as commons' configuration (commons/docs.config.ts) says. Every pull request and push that touches commons tests the generator and checks",
|
|
@@ -429,7 +330,7 @@ const docs: Workflow = {
|
|
|
429
330
|
).trimEnd(),
|
|
430
331
|
on: { push: { paths: docsPaths }, pullRequest: { paths: docsPaths }, workflowDispatch: true },
|
|
431
332
|
permissions: { contents: "read" },
|
|
432
|
-
concurrency: { group: "
|
|
333
|
+
concurrency: { group: "site-${{ github.ref }}", cancelInProgress: true },
|
|
433
334
|
jobs: {
|
|
434
335
|
check: job({
|
|
435
336
|
runsOn: "ubuntu-24.04",
|
|
@@ -439,10 +340,10 @@ const docs: Workflow = {
|
|
|
439
340
|
bun(),
|
|
440
341
|
tools(
|
|
441
342
|
"commons/docs",
|
|
442
|
-
"TypeScript 7.1 (beta),
|
|
343
|
+
"TypeScript 7.1 (beta), Shiki, beautiful-mermaid and @types/node, exactly as bun.lock pins them",
|
|
443
344
|
),
|
|
444
345
|
run("bun run verify", { name: "The compiler, the generator's tests, then check on commons", workingDirectory: "commons/docs" }),
|
|
445
|
-
run('bun main.ts build --out "$GITHUB_WORKSPACE/_site"', {
|
|
346
|
+
run('bun src/main.ts build --out "$GITHUB_WORKSPACE/_site"', {
|
|
446
347
|
name: "The site, built",
|
|
447
348
|
when: onMainPush,
|
|
448
349
|
workingDirectory: "commons/docs",
|
|
@@ -505,12 +406,14 @@ const tests: Workflow = {
|
|
|
505
406
|
"the whole history and its tags: `versions check` compares each work with the merge base, and its ledger reads the tags (commons 0026-works-versioning FR-022, FR-035)",
|
|
506
407
|
}),
|
|
507
408
|
bun(),
|
|
508
|
-
tools("
|
|
509
|
-
|
|
510
|
-
run("bun
|
|
511
|
-
|
|
409
|
+
tools(".", "The root's development tools, from bun.lock"),
|
|
410
|
+
tools("commons/docs", "The documentation generator's dependencies, which the tests of the root import"),
|
|
411
|
+
run("bun commons/libraries/src/link.ts && bun x tsc -p tests/tsconfig.json && bun x tsc -p commons/tools/tsconfig.json", {
|
|
412
|
+
name: "TypeScript 7 on the tests of the root and on commons' tools",
|
|
413
|
+
}),
|
|
414
|
+
run("bun fmt --check commons/tools tests", { name: "The formatter" }),
|
|
415
|
+
run('bun x "bun@$BUN_LINT_VERSION" lint --type-aware --max-warnings 0 commons/tools tests', {
|
|
512
416
|
name: "The linter, type-aware, no warning allowed",
|
|
513
|
-
workingDirectory: "commons/ts",
|
|
514
417
|
}),
|
|
515
418
|
run(lines(...checkScripts(false)), {
|
|
516
419
|
name: "Commons' generated files and specifications, as a person checks them, on Bun and on Node 26",
|
|
@@ -524,7 +427,7 @@ const tests: Workflow = {
|
|
|
524
427
|
steps: [
|
|
525
428
|
checkout(),
|
|
526
429
|
bun(),
|
|
527
|
-
tools("
|
|
430
|
+
tools(".", "The root's development tools, from bun.lock"),
|
|
528
431
|
run("sudo apt-get update -qq && sudo apt-get install -y -qq shellcheck", {
|
|
529
432
|
name: "ShellCheck, which the packaging test uses where it is installed",
|
|
530
433
|
when: "runner.os == 'Linux'",
|
|
@@ -692,8 +595,8 @@ export function workflows(): readonly Workflow[] {
|
|
|
692
595
|
return [
|
|
693
596
|
ci,
|
|
694
597
|
release,
|
|
695
|
-
|
|
696
|
-
|
|
598
|
+
site,
|
|
599
|
+
conformance,
|
|
697
600
|
tests,
|
|
698
601
|
].sort((a, b) => (a.file < b.file ? -1 : a.file > b.file ? 1 : 0));
|
|
699
602
|
}
|
|
@@ -704,7 +607,7 @@ export const ACTIONS: readonly CompositeAction[] = [
|
|
|
704
607
|
folder: "bun",
|
|
705
608
|
name: "Pinned Bun",
|
|
706
609
|
description:
|
|
707
|
-
"Bun at the version commons pins (commons/generated/pins.auto.env, commons 0005-typescript-
|
|
610
|
+
"Bun at the version commons pins (commons/generated/pins.auto.env, commons 0005-typescript-practice FR-026), fetched with retries, kept only where its SHA-256 is the pinned one, unpacked by IFC TypeScript's own zip reader (commons/libraries/src/install-bun.ts, run by Node) and put on the PATH. Linux, macOS and Windows; no shell script, no Python, no unzip.",
|
|
708
611
|
inputs: { "node-version": { description: "The Node that runs the installer.", default: NODE_VERSION } },
|
|
709
612
|
steps: [
|
|
710
613
|
use(PIN.setupNode, { with: { "node-version": expr("inputs.node-version") } }),
|
package/src/workflows/model.ts
CHANGED
|
@@ -88,11 +88,14 @@ export type Filter = { readonly branches?: readonly string[]; readonly paths?: r
|
|
|
88
88
|
/** A question a run by hand asks: a yes or no with its default. */
|
|
89
89
|
export type DispatchInput = { readonly description: string; readonly type: "boolean"; readonly default: boolean };
|
|
90
90
|
|
|
91
|
+
/** What starts a generated workflow: pushes, pull requests, dispatch and schedule. */
|
|
91
92
|
export type Triggers = {
|
|
92
93
|
readonly push?: Filter;
|
|
93
94
|
readonly pullRequest?: Filter;
|
|
94
95
|
/** Run by hand from the Actions page, with the inputs it asks for (true asks for none). */
|
|
95
96
|
readonly workflowDispatch?: true | { readonly inputs: Readonly<Record<string, DispatchInput>> };
|
|
97
|
+
/** Run on a schedule: each entry is a cron expression of five fields, in UTC. */
|
|
98
|
+
readonly schedule?: readonly string[];
|
|
96
99
|
/** Called by another workflow. */
|
|
97
100
|
readonly workflowCall?: true;
|
|
98
101
|
};
|
|
@@ -100,11 +103,13 @@ export type Triggers = {
|
|
|
100
103
|
/** The cells of a matrix: the values of each axis, or an expression that gives the whole matrix (`expr("fromJSON(needs.plan.outputs.linux)")`), which a job reads from the output of another. */
|
|
101
104
|
export type Matrix = Readonly<Record<string, readonly (string | number)[]>> | Expr;
|
|
102
105
|
|
|
106
|
+
/** The matrix strategy of a job of a generated workflow. */
|
|
103
107
|
export type Strategy = {
|
|
104
108
|
readonly failFast?: boolean;
|
|
105
109
|
readonly matrix: Matrix;
|
|
106
110
|
};
|
|
107
111
|
|
|
112
|
+
/** A job of a generated workflow. */
|
|
108
113
|
export type Job = {
|
|
109
114
|
readonly name?: string;
|
|
110
115
|
readonly runsOn: Runner;
|
|
@@ -126,6 +131,7 @@ export type Job = {
|
|
|
126
131
|
/** A job, written as a function so that its steps are read as a non-empty tuple. */
|
|
127
132
|
export const job = (j: Job): Job => j;
|
|
128
133
|
|
|
134
|
+
/** A generated workflow: its name, triggers, permissions and jobs. */
|
|
129
135
|
export type Workflow = {
|
|
130
136
|
/** The file's name without its directory and extension: `data` is `.github/workflows/data.auto.yml`. */
|
|
131
137
|
readonly file: string;
|
package/src/workflows/render.ts
CHANGED
|
@@ -150,6 +150,7 @@ export function renderWorkflow(w: Workflow): string {
|
|
|
150
150
|
for (const [k, v] of Object.entries(dispatch.inputs))
|
|
151
151
|
out.push(` ${key(k)}:`, ...entry("description", v.description, 8), ...entry("type", v.type, 8), ...entry("default", v.default, 8));
|
|
152
152
|
}
|
|
153
|
+
if (w.on.schedule !== undefined && w.on.schedule.length > 0) out.push(" schedule:", ...w.on.schedule.map((c) => ` - cron: ${scalar(c)}`));
|
|
153
154
|
if (w.on.workflowCall === true) out.push(" workflow_call:");
|
|
154
155
|
out.push("");
|
|
155
156
|
if (w.permissions !== undefined) out.push(...permissions(w.permissions, 0), "");
|