@intellectual-frontiers/libraries 0.2.1 → 0.4.1
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 +15 -2
- package/dist/affected.js +51 -20
- package/dist/dev.d.ts +83 -0
- package/dist/dev.js +359 -0
- package/dist/family.d.ts +58 -0
- package/dist/family.js +125 -0
- package/dist/generate-ontology.js +4 -0
- package/dist/generate-workflows.js +2 -10
- package/dist/install-bun.js +19 -14
- package/dist/libraries.d.ts +8 -0
- package/dist/libraries.js +24 -3
- 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 +12 -0
- package/dist/link.js +98 -0
- package/dist/pack-library.d.ts +2 -0
- package/dist/pack-library.js +21 -3
- package/dist/pins.d.ts +34 -7
- package/dist/pins.js +36 -9
- package/dist/plan.d.ts +28 -0
- package/dist/plan.js +135 -0
- package/dist/readme.d.ts +59 -0
- package/dist/readme.js +272 -0
- package/dist/releasing.d.ts +176 -0
- package/dist/releasing.js +680 -0
- package/dist/versions.js +4 -7
- package/dist/workflows/definitions.d.ts +33 -30
- package/dist/workflows/definitions.js +201 -278
- package/dist/workflows/model.d.ts +19 -3
- package/dist/workflows/render.js +10 -2
- package/package.json +44 -14
- package/src/affected.ts +56 -17
- package/src/dev.ts +379 -0
- package/src/family.ts +144 -0
- package/src/generate-ontology.ts +4 -0
- package/src/generate-workflows.ts +3 -11
- package/src/install-bun.ts +16 -13
- package/src/libraries.ts +27 -3
- 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 +97 -0
- package/src/pack-library.ts +21 -3
- package/src/pins.ts +55 -10
- package/src/plan.ts +143 -0
- package/src/readme.ts +278 -0
- package/src/releasing.ts +735 -0
- package/src/versions.ts +3 -7
- package/src/workflows/definitions.ts +262 -397
- package/src/workflows/model.ts +15 -3
- package/src/workflows/render.ts +10 -2
|
@@ -3,9 +3,8 @@
|
|
|
3
3
|
* are written once, the workflow of each library of commons is made from its manifest, and the rest are written here as values. Nothing is read from a file but the manifests, and nothing is written.
|
|
4
4
|
*
|
|
5
5
|
* @remarks
|
|
6
|
-
* `workflows(
|
|
7
|
-
*
|
|
8
|
-
* The workflows run on the same triggers, with the same jobs and steps and the same names as the hand-written ones they replaced, so that the names of their checks do not change.
|
|
6
|
+
* `workflows()` gives every workflow, in the order of their files' names; the libraries are proved by one workflow, `ci`, whose plan reads which libraries a change affects and runs a matrix of those (the folder, the
|
|
7
|
+
* name and the `verify` command of a manifest, 0027-commons-libraries FR-012, and what else the library needs from `LIBRARY_CI`, the facts of CI that a manifest does not hold: a library without a record has `verify` on Linux and nothing else).
|
|
9
8
|
*
|
|
10
9
|
* @limits
|
|
11
10
|
* It does not run a workflow or read one; a library that registers needs no entry of `LIBRARY_CI` unless its CI is more than `verify`.
|
|
@@ -60,247 +59,181 @@ const lines = (...l: readonly string[]): string => `${l.join("\n")}\n`;
|
|
|
60
59
|
const BUN_ACTION = ".github/actions/bun/**";
|
|
61
60
|
const own = (file: string): string => `.github/workflows/${file}.auto.yml`;
|
|
62
61
|
|
|
63
|
-
/**
|
|
64
|
-
export type
|
|
65
|
-
readonly name: string;
|
|
66
|
-
readonly verify: string;
|
|
67
|
-
/** The paths whose change affects it, which the library's workflow runs on (0027-commons-libraries FR-022). */
|
|
68
|
-
readonly paths: readonly string[];
|
|
69
|
-
/** Where it is published (0027-commons-libraries FR-015 to FR-017): the registries, `github` and, where a decision says so, `npm`. */
|
|
70
|
-
readonly distribution: readonly string[];
|
|
71
|
-
};
|
|
62
|
+
/** The systems other than Linux that a library's CI may ask for: only a library with code of its own for one of them (paths, processes, sockets, scheduled jobs) names it. */
|
|
63
|
+
export type OtherSystem = "windows-latest" | "macos-latest";
|
|
72
64
|
|
|
73
|
-
/** What a library's CI needs that its manifest does not say. */
|
|
65
|
+
/** What a library's CI needs that its manifest does not say: Linux and `verify` are for every library, and these are the rest. */
|
|
74
66
|
export type LibraryCi = {
|
|
75
|
-
/** The
|
|
76
|
-
readonly comment: string;
|
|
77
|
-
/** The steps after `verify`, in the job `verify`. */
|
|
78
|
-
readonly afterVerify?: readonly Step[];
|
|
79
|
-
/** The command that runs the tests on Node 26, the backup runtime, in a job of its own. */
|
|
67
|
+
/** The command that runs the tests on Node 26, the backup runtime, in the same job as `verify`. */
|
|
80
68
|
readonly nodeTests?: string;
|
|
81
|
-
/**
|
|
82
|
-
readonly
|
|
69
|
+
/** A command that runs after `verify`, in the same job. */
|
|
70
|
+
readonly after?: string;
|
|
71
|
+
/** The systems besides Linux where `verify` and the tests on Node run too, because the library has code of its own for them. */
|
|
72
|
+
readonly systems?: readonly OtherSystem[];
|
|
83
73
|
};
|
|
84
74
|
|
|
85
|
-
|
|
75
|
+
const NODE_TESTS = 'node --test "suite/**/*.test.ts"';
|
|
76
|
+
const ALL_OTHER: readonly OtherSystem[] = ["windows-latest", "macos-latest"];
|
|
77
|
+
const node: LibraryCi = { nodeTests: NODE_TESTS };
|
|
78
|
+
|
|
79
|
+
/** The facts of CI of the libraries that have more than `verify` on Linux, by the library's name; a library with no record has `verify` on Linux only. */
|
|
86
80
|
export const LIBRARY_CI: Readonly<Record<string, LibraryCi>> = {
|
|
87
|
-
data: {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
"RDF, typed RDF and its writers, a library lifted out of `commons/ts` (commons 0032-lifting-libraries): its own `verify` (the compiler, the specification checker, the trace, its tests and the",
|
|
112
|
-
"package with the inspection of its declarations) on Bun and its tests on Node 26, on Windows, macOS and Linux, because the package runs on all three.",
|
|
113
|
-
).trimEnd(),
|
|
114
|
-
nodeTests: 'node --test "suite/**/*.test.ts"',
|
|
115
|
-
systems: ["windows-latest", "macos-latest", "ubuntu-latest"],
|
|
116
|
-
},
|
|
117
|
-
terminal: {
|
|
118
|
-
comment: lines(
|
|
119
|
-
"Terminal, the command line and the console as pure code, a library lifted out of `commons/ts` (commons 0032-lifting-libraries): its own `verify` (the compiler, the specification checker, the trace, its tests and the",
|
|
120
|
-
"package with the inspection of its declarations) on Bun and its tests on Node 26, on Windows, macOS and Linux, because the package runs on all three.",
|
|
121
|
-
).trimEnd(),
|
|
122
|
-
nodeTests: 'node --test "suite/**/*.test.ts"',
|
|
123
|
-
systems: ["windows-latest", "macos-latest", "ubuntu-latest"],
|
|
124
|
-
},
|
|
125
|
-
net: {
|
|
126
|
-
comment: lines(
|
|
127
|
-
"Net, the network as one typed library (downloads, an HTTP server and clients, TCP and TLS, DNS and ACME), a library lifted out of `commons/ts` (commons 0032-lifting-libraries): its own `verify` (the compiler, the specification checker, the trace, its tests and the",
|
|
128
|
-
"packing of its package with the inspection of its declarations) on Bun and its tests on Node 26, on Windows, macOS and Linux, because the package runs on all three.",
|
|
129
|
-
).trimEnd(),
|
|
130
|
-
nodeTests: 'node --test "suite/**/*.test.ts"',
|
|
131
|
-
systems: ["windows-latest", "macos-latest", "ubuntu-latest"],
|
|
132
|
-
},
|
|
133
|
-
grc: {
|
|
134
|
-
comment: lines(
|
|
135
|
-
"GRC, governance, risk and compliance as code as one typed library, a library lifted out of `commons/ts` (commons 0032-lifting-libraries): its own `verify` (the compiler, the specification checker, the trace, its tests and the",
|
|
136
|
-
"packing of its package with the inspection of its declarations) on Bun and its tests on Node 26, on Windows, macOS and Linux, because the package runs on all three.",
|
|
137
|
-
).trimEnd(),
|
|
138
|
-
nodeTests: 'node --test "suite/**/*.test.ts"',
|
|
139
|
-
systems: ["windows-latest", "macos-latest", "ubuntu-latest"],
|
|
140
|
-
},
|
|
141
|
-
test: {
|
|
142
|
-
comment: lines(
|
|
143
|
-
"Test, tests that run unchanged under `bun test` and `node --test` and are recorded as evidence by their own code, a library lifted out of `commons/ts` (commons 0032-lifting-libraries): its own `verify` (the compiler, the specification checker, the trace, its tests and the",
|
|
144
|
-
"packing of its package with the inspection of its declarations) on Bun and its tests on Node 26, on Windows, macOS and Linux, because the package runs on all three.",
|
|
145
|
-
).trimEnd(),
|
|
146
|
-
nodeTests: 'node --test "suite/**/*.test.ts"',
|
|
147
|
-
systems: ["windows-latest", "macos-latest", "ubuntu-latest"],
|
|
148
|
-
},
|
|
149
|
-
lint: {
|
|
150
|
-
comment: lines(
|
|
151
|
-
"Lint, the lint plugin of Intellectual Frontiers, a library lifted out of `commons/ts` (commons 0032-lifting-libraries): its own `verify` (the pinned linter's canary, the compiler, the specification checker, the trace, its tests, which run",
|
|
152
|
-
"the real `bun lint`, and the packing of its package with the inspection of its declarations) on Bun and its tests on Node 26, on Windows, macOS and Linux, because the package runs on all three.",
|
|
153
|
-
).trimEnd(),
|
|
154
|
-
nodeTests: `bun x bun@${BUN_LINT_VERSION} --version && node --test "suite/**/*.test.ts"`,
|
|
155
|
-
systems: ["windows-latest", "macos-latest", "ubuntu-latest"],
|
|
156
|
-
},
|
|
157
|
-
githost: {
|
|
158
|
-
comment: lines(
|
|
159
|
-
"Githost, the Git hosts behind one typed interface (GitHub, GitLab and plain Git) and the reading of a remote, a library lifted out of `commons/ts` (commons 0032-lifting-libraries): its own `verify` (the compiler, the specification checker, the trace, its tests and the",
|
|
160
|
-
"packing of its package with the inspection of its declarations) on Bun and its tests on Node 26, on Windows, macOS and Linux, because the package runs on all three.",
|
|
161
|
-
).trimEnd(),
|
|
162
|
-
nodeTests: 'node --test "suite/**/*.test.ts"',
|
|
163
|
-
systems: ["windows-latest", "macos-latest", "ubuntu-latest"],
|
|
164
|
-
},
|
|
165
|
-
ontology: {
|
|
166
|
-
comment: lines(
|
|
167
|
-
"Ontology, the ontologies of commons as typed values (Mizan, IFCCM, IFQS, IFR, the audit of packaging and the software supply chain), a library lifted out of `commons/ts` (commons 0032-lifting-libraries): its own `verify` (the compiler, the spec checker, the trace, its tests and the packing of its package with the inspection of its declarations) on Bun and its tests on",
|
|
168
|
-
"Node 26, on Windows, macOS and Linux, because the package runs on all three.",
|
|
169
|
-
).trimEnd(),
|
|
170
|
-
nodeTests: 'node --test "suite/**/*.test.ts"',
|
|
171
|
-
systems: ["windows-latest", "macos-latest", "ubuntu-latest"],
|
|
172
|
-
},
|
|
173
|
-
mizan: {
|
|
174
|
-
comment: lines(
|
|
175
|
-
"Mizan, the harness and the rules of the IF Spec Profile as plugins, with the change-control and release rules, the levels, the integrations and the trace, a library lifted out of `commons/ts` (commons 0032-lifting-libraries): its own `verify` (the compiler, the spec checker, the trace, its tests and the packing of its package with the inspection of its declarations) on Bun and its tests on",
|
|
176
|
-
"Node 26, on Windows, macOS and Linux, because the package runs on all three.",
|
|
177
|
-
).trimEnd(),
|
|
178
|
-
nodeTests: 'node --test "suite/**/*.test.ts"',
|
|
179
|
-
systems: ["windows-latest", "macos-latest", "ubuntu-latest"],
|
|
180
|
-
},
|
|
181
|
-
libraries: {
|
|
182
|
-
comment: lines(
|
|
183
|
-
"Libraries, the tools that manage the libraries of a repository of commons and hold it to Mizan (the manifest, the affected libraries, the typed workflows and their generator, the pinned Bun, the packer and the",
|
|
184
|
-
"commands of the repository), a library lifted out of `commons/ts` (commons 0032-lifting-libraries): its own `verify` (the compiler, the specification checker, the trace, its tests and the packing of its package with",
|
|
185
|
-
"the inspection of its declarations) on Bun and its tests on Node 26, on Windows, macOS and Linux, because the package runs on all three.",
|
|
186
|
-
).trimEnd(),
|
|
187
|
-
nodeTests: 'node --test "suite/**/*.test.ts"',
|
|
188
|
-
systems: ["windows-latest", "macos-latest", "ubuntu-latest"],
|
|
189
|
-
},
|
|
190
|
-
headless: {
|
|
191
|
-
comment: lines(
|
|
192
|
-
"Headless, the contract of a program with no window in layers (governance, logical, the command-line surface), a library lifted out of `commons/ts` (commons 0032-lifting-libraries): its own `verify` (the compiler, the specification checker, the layers and trace checks, its tests and the",
|
|
193
|
-
"packing of its package with the inspection of its declarations) on Bun and its tests on Node 26, on Windows, macOS and Linux, because the package runs on all three.",
|
|
194
|
-
).trimEnd(),
|
|
195
|
-
nodeTests: 'node --test "suite/**/*.test.ts"',
|
|
196
|
-
systems: ["windows-latest", "macos-latest", "ubuntu-latest"],
|
|
197
|
-
},
|
|
198
|
-
kanon: {
|
|
199
|
-
comment: lines(
|
|
200
|
-
"Kanon, the pattern of a library built in three layers (commons 0033-kanon): its own `verify` (the compiler, the specification checker, the trace check, its tests and the",
|
|
201
|
-
"packing of its package with the inspection of its declarations) on Bun and its tests on Node 26, on Windows, macOS and Linux, because the package runs on all three.",
|
|
202
|
-
).trimEnd(),
|
|
203
|
-
nodeTests: 'node --test "suite/**/*.test.ts"',
|
|
204
|
-
systems: ["windows-latest", "macos-latest", "ubuntu-latest"],
|
|
205
|
-
},
|
|
206
|
-
telemetry: {
|
|
207
|
-
comment: lines(
|
|
208
|
-
"Telemetry, OpenTelemetry-native signals as one typed library, a library lifted out of `commons/ts` (commons 0032-lifting-libraries): its own `verify` (the compiler, the specification checker, the trace, its tests and the",
|
|
209
|
-
"packing of its package with the inspection of its declarations) on Bun and its tests on Node 26, on Windows, macOS and Linux, because the package runs on all three.",
|
|
210
|
-
).trimEnd(),
|
|
211
|
-
nodeTests: 'node --test "suite/**/*.test.ts"',
|
|
212
|
-
systems: ["windows-latest", "macos-latest", "ubuntu-latest"],
|
|
213
|
-
},
|
|
214
|
-
system: {
|
|
215
|
-
comment: lines(
|
|
216
|
-
"System, the host as one typed library (files, paths, processes, Git, scheduled jobs and the terminal's streams), a library lifted out of `commons/ts` (commons 0032-lifting-libraries): its own `verify` (the compiler, the specification checker, the trace, its tests and the",
|
|
217
|
-
"package with the inspection of its declarations) on Bun and its tests on Node 26, on Windows, macOS and Linux, because the package runs on all three.",
|
|
218
|
-
).trimEnd(),
|
|
219
|
-
nodeTests: 'node --test "suite/**/*.test.ts"',
|
|
220
|
-
systems: ["windows-latest", "macos-latest", "ubuntu-latest"],
|
|
221
|
-
},
|
|
222
|
-
formats: {
|
|
223
|
-
comment: lines(
|
|
224
|
-
"Formats, a library lifted out of `commons/ts` (commons 0032-lifting-libraries): its own `verify` (the compiler, the specification checker, the trace, its tests and the packing of its",
|
|
225
|
-
"package with the inspection of its declarations) on Bun and its tests on Node 26, on Windows, macOS and Linux, because the package runs on all three.",
|
|
226
|
-
).trimEnd(),
|
|
227
|
-
nodeTests: 'node --test "suite/**/*.test.ts"',
|
|
228
|
-
systems: ["windows-latest", "macos-latest", "ubuntu-latest"],
|
|
229
|
-
},
|
|
230
|
-
crypto: {
|
|
231
|
-
comment: lines(
|
|
232
|
-
"Crypto, a library lifted out of `commons/ts` (commons 0032-lifting-libraries): its own `verify` (the compiler, the specification checker, the trace, its tests and the packing of its",
|
|
233
|
-
"package with the inspection of its declarations) on Bun and its tests on Node 26, on Windows, macOS and Linux, because the package runs on all three.",
|
|
234
|
-
).trimEnd(),
|
|
235
|
-
nodeTests: 'node --test "suite/**/*.test.ts"',
|
|
236
|
-
systems: ["windows-latest", "macos-latest", "ubuntu-latest"],
|
|
237
|
-
},
|
|
238
|
-
quality: {
|
|
239
|
-
comment: lines(
|
|
240
|
-
"Quality, the quality system of commons (the record of a run as evidence, the quality branch, the ladder, the ledger, the Trust page and the assessor pack), a library lifted out of `commons/ts`",
|
|
241
|
-
"(commons 0032-lifting-libraries): its own `verify` on Bun and its tests, which run a real Git, on Node 26, on Linux.",
|
|
242
|
-
).trimEnd(),
|
|
243
|
-
nodeTests: 'node --test "suite/**/*.test.ts"',
|
|
244
|
-
},
|
|
245
|
-
ergonex: {
|
|
246
|
-
comment: lines(
|
|
247
|
-
"Ergonex, the workspaces management of Intellectual Frontiers, a library of commons (commons 0027-commons-libraries FR-010): its own `verify` on Bun and its tests on Node 26, the backup runtime,",
|
|
248
|
-
"on Windows first, then macOS and Linux (ergonex 0004-onboarding): a person on any of them installs the command from npm and runs it.",
|
|
249
|
-
).trimEnd(),
|
|
250
|
-
nodeTests: 'node --test "suite/**/*.test.ts"',
|
|
251
|
-
systems: ["windows-latest", "macos-latest", "ubuntu-latest"],
|
|
252
|
-
},
|
|
81
|
+
data: { nodeTests: NODE_TESTS, after: "bun tools/generate-dpv.ts --check" },
|
|
82
|
+
core: node,
|
|
83
|
+
rdf: node,
|
|
84
|
+
terminal: node,
|
|
85
|
+
net: { nodeTests: NODE_TESTS, systems: ALL_OTHER },
|
|
86
|
+
grc: node,
|
|
87
|
+
test: node,
|
|
88
|
+
lint: { nodeTests: `bun x bun@${BUN_LINT_VERSION} --version && ${NODE_TESTS}` },
|
|
89
|
+
githost: node,
|
|
90
|
+
ontology: node,
|
|
91
|
+
mizan: node,
|
|
92
|
+
libraries: { nodeTests: NODE_TESTS, systems: ALL_OTHER },
|
|
93
|
+
headless: { nodeTests: NODE_TESTS, systems: ALL_OTHER },
|
|
94
|
+
kanon: node,
|
|
95
|
+
telemetry: node,
|
|
96
|
+
system: { nodeTests: NODE_TESTS, systems: ALL_OTHER },
|
|
97
|
+
formats: node,
|
|
98
|
+
crypto: node,
|
|
99
|
+
quality: node,
|
|
100
|
+
ergonex: { nodeTests: NODE_TESTS, systems: ALL_OTHER },
|
|
101
|
+
"integrations-github": node,
|
|
102
|
+
"integrations-fhir": node,
|
|
103
|
+
"integrations-x12": node,
|
|
104
|
+
integrations: node,
|
|
253
105
|
};
|
|
254
106
|
|
|
255
|
-
/**
|
|
256
|
-
export
|
|
257
|
-
|
|
107
|
+
/** A cell of the matrix of a job of `ci`: a library, and where it runs where it is not on Linux. */
|
|
108
|
+
export type Cell = {
|
|
109
|
+
readonly name: string;
|
|
110
|
+
readonly folder: string;
|
|
111
|
+
readonly verify: string;
|
|
112
|
+
/** The command that runs the tests on Node 26, or the empty string. */
|
|
113
|
+
readonly node: string;
|
|
114
|
+
/** The command that runs after `verify`, or the empty string. */
|
|
115
|
+
readonly after: string;
|
|
116
|
+
/** Whether the packing is checked in this cell: the library changed its `exports` (or the packer changed), or the run is of everything. A push does not pack otherwise; the release does. */
|
|
117
|
+
readonly pack: boolean;
|
|
118
|
+
/** The runner, for a cell that is not on Linux. */
|
|
119
|
+
readonly os?: OtherSystem;
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
/** The cell of a library on a system (`ubuntu-latest`, where it names none), from its manifest and its record of CI; `pack` says whether the packing is checked in it. */
|
|
123
|
+
export function cellOf(l: { readonly name: string; readonly folder: string; readonly verify: string }, os?: OtherSystem, pack = false): Cell {
|
|
258
124
|
const ci = LIBRARY_CI[l.name];
|
|
259
|
-
const paths = l.paths;
|
|
260
|
-
const systems = ci?.systems;
|
|
261
|
-
const onSystems =
|
|
262
|
-
systems === undefined
|
|
263
|
-
? { runsOn: "ubuntu-latest" as const }
|
|
264
|
-
: { runsOn: expr("matrix.os"), strategy: { failFast: false, matrix: { os: systems } } };
|
|
265
|
-
const verify = job({
|
|
266
|
-
...onSystems,
|
|
267
|
-
timeoutMinutes: 15,
|
|
268
|
-
steps: [
|
|
269
|
-
checkout(),
|
|
270
|
-
bun(),
|
|
271
|
-
tools(folder, "The development tools, from bun.lock (the kernel is linked from commons/ts)"),
|
|
272
|
-
run(l.verify, { name: "verify", workingDirectory: folder }),
|
|
273
|
-
...(ci?.afterVerify ?? []),
|
|
274
|
-
],
|
|
275
|
-
});
|
|
276
|
-
const node =
|
|
277
|
-
ci?.nodeTests === undefined
|
|
278
|
-
? {}
|
|
279
|
-
: {
|
|
280
|
-
node: job({
|
|
281
|
-
...onSystems,
|
|
282
|
-
timeoutMinutes: 15,
|
|
283
|
-
steps: [
|
|
284
|
-
checkout(),
|
|
285
|
-
bun(),
|
|
286
|
-
setupNode(),
|
|
287
|
-
tools(folder),
|
|
288
|
-
run(ci.nodeTests, { name: "The tests on Node 26", workingDirectory: folder }),
|
|
289
|
-
],
|
|
290
|
-
}),
|
|
291
|
-
};
|
|
292
125
|
return {
|
|
293
|
-
file: l.name,
|
|
294
126
|
name: l.name,
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
127
|
+
folder: l.folder,
|
|
128
|
+
verify: l.verify,
|
|
129
|
+
pack,
|
|
130
|
+
node: ci?.nodeTests ?? "",
|
|
131
|
+
after: ci?.after ?? "",
|
|
132
|
+
...(os === undefined ? {} : { os }),
|
|
301
133
|
};
|
|
302
134
|
}
|
|
303
135
|
|
|
136
|
+
/** The paths a push or a pull request is run for by `ci`: the libraries and what they share. What a change affects within them is the plan's to say (0001-libraries FR-012), not a filter's. */
|
|
137
|
+
const CI_PATHS = ["commons/**", "package.json", "bun.lock", BUN_ACTION, own("ci")];
|
|
138
|
+
|
|
139
|
+
/** The steps that prove one library of a cell: install its tools, `verify`, what comes after, and its tests on Node 26. */
|
|
140
|
+
const cellSteps = (): readonly [Step, ...Step[]] => [
|
|
141
|
+
checkout(),
|
|
142
|
+
bun(),
|
|
143
|
+
tools(expr("matrix.folder"), "The development tools, from bun.lock (the kernel is linked from commons/ts)"),
|
|
144
|
+
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
|
+
run(expr("matrix.after"), { name: "After verify", when: "matrix.after != ''", workingDirectory: expr("matrix.folder"), shell: "bash" }),
|
|
146
|
+
run(expr("matrix.node"), { name: "The tests on Node 26", when: "matrix.node != ''", workingDirectory: expr("matrix.folder"), shell: "bash" }),
|
|
147
|
+
];
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* The one workflow that proves the libraries (0001-libraries FR-012): a job `plan` asks `plan.ts` which libraries the push or the pull request affects (the code of the `affected` command, from the commit the
|
|
151
|
+
* change starts at), and a matrix of those libraries and nothing else runs `verify` and the tests on Node 26 on Linux. A library whose record says it has code of its own for Windows or macOS runs there too;
|
|
152
|
+
* the others are not run there. The job `ci` is the one result to require: it fails where a job it needs failed, and passes where nothing was affected. A push to main has a group of its own for each commit, so that no commit's
|
|
153
|
+
* run is replaced by a later one: each plan starts at the commit main was at, and a replaced run would leave what it was to prove unproved.
|
|
154
|
+
*/
|
|
155
|
+
const ci: Workflow = {
|
|
156
|
+
file: "ci",
|
|
157
|
+
name: "ci",
|
|
158
|
+
comment: lines(
|
|
159
|
+
"The libraries of commons (commons 0001-libraries FR-012, 0027-commons-libraries FR-019 to FR-022): one workflow for every library. The job `plan` reads what the push or pull request changed, from the commit it starts at,",
|
|
160
|
+
"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
|
+
"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
|
+
).trimEnd(),
|
|
163
|
+
on: { push: { paths: CI_PATHS }, pullRequest: { paths: CI_PATHS }, workflowDispatch: true },
|
|
164
|
+
permissions: { contents: "read" },
|
|
165
|
+
env: { NODE_VERSION },
|
|
166
|
+
concurrency: {
|
|
167
|
+
group: `${expr("github.workflow")}-${expr("github.ref == 'refs/heads/main' && github.sha || github.ref")}`,
|
|
168
|
+
cancelInProgress: expr("github.ref != 'refs/heads/main'"),
|
|
169
|
+
},
|
|
170
|
+
jobs: {
|
|
171
|
+
plan: job({
|
|
172
|
+
runsOn: "ubuntu-latest",
|
|
173
|
+
timeoutMinutes: 10,
|
|
174
|
+
outputs: {
|
|
175
|
+
"has-linux": expr("steps.plan.outputs.has-linux"),
|
|
176
|
+
linux: expr("steps.plan.outputs.linux"),
|
|
177
|
+
"has-systems": expr("steps.plan.outputs.has-systems"),
|
|
178
|
+
systems: expr("steps.plan.outputs.systems"),
|
|
179
|
+
},
|
|
180
|
+
steps: [
|
|
181
|
+
checkout({ fetchDepth: 0, comment: "the whole history: the plan compares the head with the commit the change starts at" }),
|
|
182
|
+
bun(),
|
|
183
|
+
run("bun install --frozen-lockfile", { name: "The packages the plan reads, from the root's bun.lock" }),
|
|
184
|
+
run("bun commons/libraries/src/link.ts", { name: "The libraries, linked by name before any of them is imported (the root's packages are old copies from npm)" }),
|
|
185
|
+
run(
|
|
186
|
+
lines(
|
|
187
|
+
"# a pull request starts at its base; a push to main at the commit main was at; any other branch at main, so a push that replaced a run that was stopped still carries what that run was to prove",
|
|
188
|
+
'if [ "$GITHUB_EVENT_NAME" = pull_request ]; then base="${{ github.event.pull_request.base.sha }}"',
|
|
189
|
+
'elif [ "$GITHUB_REF" = refs/heads/main ]; then base="${{ github.event.before }}"',
|
|
190
|
+
"else base=origin/main; fi",
|
|
191
|
+
'case "$base" in ""|0000000000000000000000000000000000000000) base=origin/main ;; esac',
|
|
192
|
+
'if [ "$GITHUB_EVENT_NAME" = workflow_dispatch ]; then scope=--all; else scope="--base $base"; fi',
|
|
193
|
+
'bun commons/libraries/src/plan.ts $scope --github-output "$GITHUB_OUTPUT"',
|
|
194
|
+
),
|
|
195
|
+
{ name: "The libraries this change affects, and the systems each runs on", id: "plan", shell: "bash" },
|
|
196
|
+
),
|
|
197
|
+
],
|
|
198
|
+
}),
|
|
199
|
+
verify: job({
|
|
200
|
+
name: "verify (${{ matrix.name }})",
|
|
201
|
+
needs: ["plan"],
|
|
202
|
+
when: "needs.plan.outputs.has-linux == 'true'",
|
|
203
|
+
runsOn: "ubuntu-latest",
|
|
204
|
+
timeoutMinutes: 20,
|
|
205
|
+
strategy: { failFast: false, matrix: expr("fromJSON(needs.plan.outputs.linux)") },
|
|
206
|
+
steps: cellSteps(),
|
|
207
|
+
}),
|
|
208
|
+
systems: job({
|
|
209
|
+
name: "verify (${{ matrix.name }}, ${{ matrix.os }})",
|
|
210
|
+
needs: ["plan"],
|
|
211
|
+
when: "needs.plan.outputs.has-systems == 'true'",
|
|
212
|
+
runsOn: expr("matrix.os"),
|
|
213
|
+
timeoutMinutes: 20,
|
|
214
|
+
strategy: { failFast: false, matrix: expr("fromJSON(needs.plan.outputs.systems)") },
|
|
215
|
+
steps: cellSteps(),
|
|
216
|
+
}),
|
|
217
|
+
ci: job({
|
|
218
|
+
comment: "The one result to require: every job it needs passed or had nothing to run.",
|
|
219
|
+
needs: ["plan", "verify", "systems"],
|
|
220
|
+
when: "always()",
|
|
221
|
+
runsOn: "ubuntu-latest",
|
|
222
|
+
timeoutMinutes: 5,
|
|
223
|
+
steps: [
|
|
224
|
+
run(
|
|
225
|
+
lines(
|
|
226
|
+
'for r in "${{ needs.plan.result }}" "${{ needs.verify.result }}" "${{ needs.systems.result }}"; do',
|
|
227
|
+
' case "$r" in success|skipped) ;; *) echo "a job of ci ended $r"; exit 1 ;; esac',
|
|
228
|
+
"done",
|
|
229
|
+
),
|
|
230
|
+
{ name: "No job failed", shell: "bash" },
|
|
231
|
+
),
|
|
232
|
+
],
|
|
233
|
+
}),
|
|
234
|
+
},
|
|
235
|
+
};
|
|
236
|
+
|
|
304
237
|
const ifcTypescriptPaths = [
|
|
305
238
|
"commons/ts/**",
|
|
306
239
|
"commons/docs/**",
|
|
@@ -393,11 +326,11 @@ const ifcTypescript: Workflow = {
|
|
|
393
326
|
tools("commons/telemetry"),
|
|
394
327
|
run(
|
|
395
328
|
lines(
|
|
396
|
-
"
|
|
329
|
+
"url=$(sed -n 's/^OTELCOL_CONTRIB_URL_X86_64=//p' commons/generated/pins.auto.env)",
|
|
397
330
|
"sum=$(sed -n 's/^OTELCOL_CONTRIB_SHA256_X86_64=//p' commons/generated/pins.auto.env)",
|
|
398
331
|
'dir="$RUNNER_TEMP/otelcol"',
|
|
399
332
|
'mkdir -p "$dir"',
|
|
400
|
-
'curl -fsSL -o "$dir/otelcol.tar.gz" "
|
|
333
|
+
'curl -fsSL -o "$dir/otelcol.tar.gz" "$url"',
|
|
401
334
|
'echo "$sum $dir/otelcol.tar.gz" | sha256sum -c -',
|
|
402
335
|
'tar -xzf "$dir/otelcol.tar.gz" -C "$dir" otelcol-contrib',
|
|
403
336
|
'echo "IFC_OTELCOL=$dir/otelcol-contrib" >>"$GITHUB_ENV"',
|
|
@@ -606,7 +539,10 @@ const tests: Workflow = {
|
|
|
606
539
|
name: "Independent validators of the exports (rdflib, pySHACL, jsonschema), which the Mizan test uses where they are installed",
|
|
607
540
|
},
|
|
608
541
|
),
|
|
609
|
-
run("bun test ./tests
|
|
542
|
+
run("bun test ./tests/*.test.ts", {
|
|
543
|
+
name: "The tests on Bun (tests/release/ is the release's: it packs, installs and type-checks every library)",
|
|
544
|
+
when: "matrix.runtime == 'bun'",
|
|
545
|
+
}),
|
|
610
546
|
run('node --test "tests/*.test.ts"', { name: "The tests on Node 26", when: "matrix.runtime == 'node'" }),
|
|
611
547
|
],
|
|
612
548
|
}),
|
|
@@ -656,177 +592,106 @@ const tests: Workflow = {
|
|
|
656
592
|
},
|
|
657
593
|
};
|
|
658
594
|
|
|
659
|
-
/**
|
|
660
|
-
const
|
|
661
|
-
lines(
|
|
662
|
-
`pkg=$(tar -xzOf ./*.tgz package/package.json)`,
|
|
663
|
-
`name=$(printf '%s' "$pkg" | node -p "JSON.parse(require('fs').readFileSync(0,'utf8')).name")`,
|
|
664
|
-
`version=$(printf '%s' "$pkg" | node -p "JSON.parse(require('fs').readFileSync(0,'utf8')).version")`,
|
|
665
|
-
`if npm view "$name@$version" version${registry} >/dev/null 2>&1; then`,
|
|
666
|
-
' echo "$name@$version is already there"',
|
|
667
|
-
' echo "have=true" >> "$GITHUB_OUTPUT"',
|
|
668
|
-
"else",
|
|
669
|
-
' echo "have=false" >> "$GITHUB_OUTPUT"',
|
|
670
|
-
"fi",
|
|
671
|
-
);
|
|
672
|
-
const HAVE_NPM = HAVE("");
|
|
673
|
-
const HAVE_GITHUB = HAVE(" --registry https://npm.pkg.github.com");
|
|
595
|
+
/** The folder of a library's package that the release workflow packs: the cell of the matrix, `matrix.folder`. */
|
|
596
|
+
const PUBLISH_COMMAND = "bun commons/libraries/src/releasing.ts publish --dir package";
|
|
674
597
|
|
|
675
598
|
/**
|
|
676
|
-
* The workflow that
|
|
677
|
-
*
|
|
599
|
+
* The one workflow that releases (0001-libraries FR-014, FR-015): run by hand from main, never by a push. It reads the release record that `release apply` wrote (`commons/generated/release.auto.json`: the libraries
|
|
600
|
+
* whose version is to be published and tagged, in dependency order), proves and packs each of them in a matrix, and, where the run is asked to publish, sends them in that order to npm (trusted publishing with provenance, or
|
|
601
|
+
* the token `INFRO_NPMJS_TOKEN` where the repository has one) and to the GitHub package registry, and makes the tag of each with the runner's token. A run that is not asked to publish stops after the packing.
|
|
678
602
|
*/
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
on: { push: { tags: [`${l.name}-v*`] }, workflowDispatch: true },
|
|
692
|
-
permissions: { contents: "read" },
|
|
693
|
-
jobs: {
|
|
694
|
-
build: job({
|
|
695
|
-
runsOn: "ubuntu-latest",
|
|
696
|
-
timeoutMinutes: 15,
|
|
697
|
-
steps: [
|
|
698
|
-
checkout(),
|
|
699
|
-
bun(),
|
|
700
|
-
setupNode(),
|
|
701
|
-
tools(folder),
|
|
702
|
-
run(
|
|
703
|
-
lines(
|
|
704
|
-
`version=$(node -p "require('./package.json').version")`,
|
|
705
|
-
`if [ "$GITHUB_REF_TYPE" = tag ]; then`,
|
|
706
|
-
` test "$GITHUB_REF_NAME" = "${l.name}-v$version" || { echo "the tag $GITHUB_REF_NAME is not ${l.name}-v$version"; exit 1; }`,
|
|
707
|
-
`else`,
|
|
708
|
-
` test "$GITHUB_REF" = refs/heads/main || { echo "a run by hand publishes only from main, not $GITHUB_REF"; exit 1; }`,
|
|
709
|
-
`fi`,
|
|
710
|
-
),
|
|
711
|
-
{
|
|
712
|
-
name: "The tag, or main for a run by hand, is the version of the package",
|
|
713
|
-
workingDirectory: folder,
|
|
714
|
-
shell: "bash",
|
|
715
|
-
},
|
|
716
|
-
),
|
|
717
|
-
run("bun run verify", { name: "verify", workingDirectory: folder }),
|
|
718
|
-
run("bun tools/pack.ts", { name: "The package that is published", workingDirectory: folder }),
|
|
719
|
-
use(PIN.uploadArtifact, {
|
|
720
|
-
name: "The tarball, kept for the jobs that publish it",
|
|
721
|
-
with: { name: `${l.name}-package`, path: `${folder}/dist/*.tgz`, "if-no-files-found": "error" },
|
|
722
|
-
}),
|
|
723
|
-
],
|
|
724
|
-
}),
|
|
725
|
-
...(sendNpm
|
|
726
|
-
? {
|
|
727
|
-
"publish-npm": job({
|
|
728
|
-
needs: ["build"],
|
|
729
|
-
runsOn: "ubuntu-latest",
|
|
730
|
-
timeoutMinutes: 10,
|
|
731
|
-
permissions: { contents: "read", "id-token": "write" },
|
|
732
|
-
environment: { name: "npm" },
|
|
733
|
-
steps: [
|
|
734
|
-
use(PIN.downloadArtifact, { name: "The tarball", with: { name: `${l.name}-package`, path: "package" } }),
|
|
735
|
-
use(PIN.setupNode, { with: { "node-version": expr("env.NODE_VERSION"), "registry-url": "https://registry.npmjs.org" } }),
|
|
736
|
-
run(HAVE_NPM, {
|
|
737
|
-
name: "Is the version already on npm (published by hand, or by an earlier run)?",
|
|
738
|
-
id: "have",
|
|
739
|
-
shell: "bash",
|
|
740
|
-
workingDirectory: "package",
|
|
741
|
-
}),
|
|
742
|
-
run(tarball + " --access public --provenance", {
|
|
743
|
-
name: "Published to npm, with provenance and no token",
|
|
744
|
-
when: "steps.have.outputs.have != 'true'",
|
|
745
|
-
workingDirectory: "package",
|
|
746
|
-
shell: "bash",
|
|
747
|
-
}),
|
|
748
|
-
],
|
|
749
|
-
}),
|
|
750
|
-
}
|
|
751
|
-
: {}),
|
|
752
|
-
"publish-github": job({
|
|
753
|
-
needs: ["build"],
|
|
754
|
-
runsOn: "ubuntu-latest",
|
|
755
|
-
timeoutMinutes: 10,
|
|
756
|
-
permissions: { contents: "read", packages: "write" },
|
|
757
|
-
steps: [
|
|
758
|
-
use(PIN.downloadArtifact, { name: "The tarball", with: { name: `${l.name}-package`, path: "package" } }),
|
|
759
|
-
use(PIN.setupNode, {
|
|
760
|
-
with: {
|
|
761
|
-
"node-version": expr("env.NODE_VERSION"),
|
|
762
|
-
"registry-url": "https://npm.pkg.github.com",
|
|
763
|
-
scope: "@intellectual-frontiers",
|
|
764
|
-
},
|
|
765
|
-
}),
|
|
766
|
-
run(HAVE_GITHUB, {
|
|
767
|
-
name: "Is the version already on the GitHub package registry?",
|
|
768
|
-
id: "have",
|
|
769
|
-
shell: "bash",
|
|
770
|
-
workingDirectory: "package",
|
|
771
|
-
env: { NODE_AUTH_TOKEN: expr("secrets.GITHUB_TOKEN") },
|
|
772
|
-
}),
|
|
773
|
-
run(tarball, {
|
|
774
|
-
name: "Published to the GitHub package registry",
|
|
775
|
-
when: "steps.have.outputs.have != 'true'",
|
|
776
|
-
workingDirectory: "package",
|
|
777
|
-
shell: "bash",
|
|
778
|
-
env: { NODE_AUTH_TOKEN: expr("secrets.GITHUB_TOKEN") },
|
|
779
|
-
}),
|
|
780
|
-
],
|
|
781
|
-
}),
|
|
782
|
-
// a run by hand from main makes the tag that a push of one would have, where the runner's token may and a person's sandbox may not; it tags a version that is on its registry,
|
|
783
|
-
// however it got there (this workflow's jobs, or a person's first publish of a package that has no trusted publisher yet), and never fails on a tag that is there
|
|
784
|
-
tag: job({
|
|
785
|
-
needs: ["build", ...(sendNpm ? ["publish-npm"] : []), "publish-github"],
|
|
786
|
-
when: "always() && needs.build.result == 'success' && github.ref_type == 'branch'",
|
|
787
|
-
runsOn: "ubuntu-latest",
|
|
788
|
-
timeoutMinutes: 5,
|
|
789
|
-
permissions: { contents: "write" },
|
|
790
|
-
steps: [
|
|
791
|
-
checkout(),
|
|
792
|
-
use(PIN.setupNode, {
|
|
793
|
-
with: {
|
|
794
|
-
"node-version": expr("env.NODE_VERSION"),
|
|
795
|
-
...(sendNpm ? {} : { "registry-url": "https://npm.pkg.github.com", scope: "@intellectual-frontiers" }),
|
|
796
|
-
},
|
|
797
|
-
}),
|
|
798
|
-
run(
|
|
799
|
-
lines(
|
|
800
|
-
`version=$(node -p "require('./package.json').version")`,
|
|
801
|
-
`tag="${l.name}-v$version"`,
|
|
802
|
-
sendNpm
|
|
803
|
-
? `npm view "@intellectual-frontiers/${l.name}@$version" version >/dev/null 2>&1 || { echo "$version is not on npm: no tag"; exit 1; }`
|
|
804
|
-
: `npm view "@intellectual-frontiers/${l.name}@$version" version >/dev/null 2>&1 || { echo "$version is not on the GitHub package registry: no tag"; exit 1; }`,
|
|
805
|
-
'if gh api "repos/$GITHUB_REPOSITORY/git/ref/tags/$tag" >/dev/null 2>&1; then',
|
|
806
|
-
' echo "$tag is already there"',
|
|
807
|
-
"else",
|
|
808
|
-
' gh api "repos/$GITHUB_REPOSITORY/git/refs" -f "ref=refs/tags/$tag" -f "sha=$GITHUB_SHA"',
|
|
809
|
-
"fi",
|
|
810
|
-
),
|
|
811
|
-
{
|
|
812
|
-
name: "The tag of the version that is published, made once",
|
|
813
|
-
shell: "bash",
|
|
814
|
-
workingDirectory: folder,
|
|
815
|
-
env: { GH_TOKEN: expr("secrets.GITHUB_TOKEN"), ...(sendNpm ? {} : { NODE_AUTH_TOKEN: expr("secrets.GITHUB_TOKEN") }) },
|
|
816
|
-
},
|
|
817
|
-
),
|
|
818
|
-
],
|
|
819
|
-
}),
|
|
603
|
+
const release: Workflow = {
|
|
604
|
+
file: "release",
|
|
605
|
+
name: "release",
|
|
606
|
+
comment: lines(
|
|
607
|
+
"The release of the libraries (commons 0001-libraries FR-014, FR-015): by hand, from main, after `bun run release apply` (commons/libraries/src/releasing.ts) has written the versions and the record `commons/generated/release.auto.json` and they are pushed.",
|
|
608
|
+
"`plan` reads the record and leaves out what is tagged; `build` proves and packs each library (`verify`, `tools/pack.ts`); `publish`, where asked, sends the tarballs in dependency order to npm with provenance, by npm's trusted",
|
|
609
|
+
"publishing (the owner sets a trusted publisher once for each package on npmjs.com: this repository, this workflow's file, the environment `npm`) or, where the repository has the secret INFRO_NPMJS_TOKEN, by that token,",
|
|
610
|
+
"and to the GitHub package registry, and makes the tag of each. A version that is on a registry is skipped and a tag that is there is kept, so a run again continues where one stopped.",
|
|
611
|
+
).trimEnd(),
|
|
612
|
+
on: {
|
|
613
|
+
workflowDispatch: {
|
|
614
|
+
inputs: { publish: { description: "Publish and tag; without it the run only plans, proves and packs", type: "boolean", default: false } },
|
|
820
615
|
},
|
|
821
|
-
|
|
822
|
-
}
|
|
823
|
-
}
|
|
616
|
+
},
|
|
617
|
+
permissions: { contents: "read" },
|
|
618
|
+
env: { NODE_VERSION },
|
|
619
|
+
concurrency: { group: "release", cancelInProgress: false },
|
|
620
|
+
jobs: {
|
|
621
|
+
plan: job({
|
|
622
|
+
runsOn: "ubuntu-latest",
|
|
623
|
+
timeoutMinutes: 10,
|
|
624
|
+
outputs: {
|
|
625
|
+
"has-build": expr("steps.plan.outputs.has-build"),
|
|
626
|
+
build: expr("steps.plan.outputs.build"),
|
|
627
|
+
sequence: expr("steps.plan.outputs.sequence"),
|
|
628
|
+
},
|
|
629
|
+
steps: [
|
|
630
|
+
checkout({ fetchDepth: 0, comment: "the whole history and its tags: the plan leaves out what is tagged" }),
|
|
631
|
+
bun(),
|
|
632
|
+
run("bun install --frozen-lockfile", { name: "The packages the plan reads, from the root's bun.lock" }),
|
|
633
|
+
run("bun commons/libraries/src/link.ts", { name: "The libraries, linked by name before any of them is imported (the root's packages are old copies from npm)" }),
|
|
634
|
+
run(
|
|
635
|
+
lines(
|
|
636
|
+
'test "$GITHUB_REF" = refs/heads/main || { echo "a release is made from main, not $GITHUB_REF"; exit 1; }',
|
|
637
|
+
'bun commons/libraries/src/releasing.ts matrix --github-output "$GITHUB_OUTPUT"',
|
|
638
|
+
),
|
|
639
|
+
{ name: "The libraries to release, in dependency order, from the record", id: "plan", shell: "bash" },
|
|
640
|
+
),
|
|
641
|
+
],
|
|
642
|
+
}),
|
|
643
|
+
build: job({
|
|
644
|
+
name: "build (${{ matrix.slug }} ${{ matrix.version }})",
|
|
645
|
+
needs: ["plan"],
|
|
646
|
+
when: "needs.plan.outputs.has-build == 'true'",
|
|
647
|
+
runsOn: "ubuntu-latest",
|
|
648
|
+
timeoutMinutes: 20,
|
|
649
|
+
strategy: { failFast: true, matrix: expr("fromJSON(needs.plan.outputs.build)") },
|
|
650
|
+
steps: [
|
|
651
|
+
checkout(),
|
|
652
|
+
bun(),
|
|
653
|
+
tools(expr("matrix.folder")),
|
|
654
|
+
run("bun run verify", { name: "verify, which includes the packing", workingDirectory: expr("matrix.folder") }),
|
|
655
|
+
run("bun tools/pack.ts", { name: "The package that is published", workingDirectory: expr("matrix.folder") }),
|
|
656
|
+
use(PIN.uploadArtifact, {
|
|
657
|
+
name: "The tarball, kept for the job that publishes it",
|
|
658
|
+
with: { name: "package-${{ matrix.slug }}", path: "${{ matrix.folder }}/dist/*.tgz", "if-no-files-found": "error" },
|
|
659
|
+
}),
|
|
660
|
+
],
|
|
661
|
+
}),
|
|
662
|
+
publish: job({
|
|
663
|
+
needs: ["plan", "build"],
|
|
664
|
+
when: "inputs.publish && needs.plan.outputs.has-build == 'true'",
|
|
665
|
+
runsOn: "ubuntu-latest",
|
|
666
|
+
timeoutMinutes: 60,
|
|
667
|
+
permissions: { contents: "write", "id-token": "write", packages: "write" },
|
|
668
|
+
environment: { name: "npm" },
|
|
669
|
+
steps: [
|
|
670
|
+
checkout({ fetchDepth: 0, comment: "the tags: what is tagged is left out" }),
|
|
671
|
+
bun(),
|
|
672
|
+
run("bun install --frozen-lockfile", { name: "The packages the command reads, from the root's bun.lock" }),
|
|
673
|
+
run("bun commons/libraries/src/link.ts", { name: "The libraries, linked by name before any of them is imported" }),
|
|
674
|
+
use(PIN.setupNode, { with: { "node-version": expr("env.NODE_VERSION"), "registry-url": "https://registry.npmjs.org" } }),
|
|
675
|
+
use(PIN.downloadArtifact, { name: "The tarballs", with: { pattern: "package-*", path: "package" } }),
|
|
676
|
+
run(PUBLISH_COMMAND, {
|
|
677
|
+
name: "Published in dependency order to npm and to the GitHub package registry, and tagged: each release by itself, a version already on npm is only tagged",
|
|
678
|
+
shell: "bash",
|
|
679
|
+
env: {
|
|
680
|
+
NPM_TOKEN: expr("secrets.INFRO_NPMJS_TOKEN"),
|
|
681
|
+
GITHUB_TOKEN: expr("secrets.GITHUB_TOKEN"),
|
|
682
|
+
GH_TOKEN: expr("secrets.GITHUB_TOKEN"),
|
|
683
|
+
},
|
|
684
|
+
}),
|
|
685
|
+
],
|
|
686
|
+
}),
|
|
687
|
+
},
|
|
688
|
+
};
|
|
824
689
|
|
|
825
690
|
/** Every workflow, the libraries'' made from their manifests, in the order of their files' names. */
|
|
826
|
-
export function workflows(
|
|
691
|
+
export function workflows(): readonly Workflow[] {
|
|
827
692
|
return [
|
|
828
|
-
|
|
829
|
-
|
|
693
|
+
ci,
|
|
694
|
+
release,
|
|
830
695
|
docs,
|
|
831
696
|
ifcTypescript,
|
|
832
697
|
tests,
|