code-foundry 1.44.7 → 1.44.9
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/.github/workflows/release.yml +51 -31
- package/CHANGELOG.md +15 -15
- package/package.json +1 -1
|
@@ -262,65 +262,85 @@ jobs:
|
|
|
262
262
|
const { execFileSync } = require('node:child_process');
|
|
263
263
|
const fs = require('node:fs');
|
|
264
264
|
|
|
265
|
-
const gh = (args) =>
|
|
265
|
+
const gh = (args) =>
|
|
266
|
+
execFileSync('gh', args, { encoding: 'utf8', maxBuffer: 32 * 1024 * 1024 });
|
|
266
267
|
|
|
267
268
|
const repo = process.env.REPOSITORY;
|
|
268
269
|
const config = JSON.parse(fs.readFileSync(process.env.CONFIG_FILE, 'utf8'));
|
|
269
270
|
const manifest = JSON.parse(fs.readFileSync('.release-please-manifest.json', 'utf8'));
|
|
270
271
|
|
|
271
272
|
// Newest merged release-please version pull requests first.
|
|
273
|
+
// The head filter keeps the query on the version-PR branch
|
|
274
|
+
// regardless of how many unrelated pull requests merged since.
|
|
272
275
|
const pulls = JSON.parse(gh([
|
|
273
276
|
'api', `repos/${repo}/pulls`,
|
|
274
277
|
'-X', 'GET',
|
|
275
278
|
'-f', 'state=closed',
|
|
276
279
|
'-f', 'sort=updated',
|
|
277
280
|
'-f', 'direction=desc',
|
|
278
|
-
'-f', 'per_page=
|
|
279
|
-
])).filter((pull) => pull.merged_at !== null
|
|
280
|
-
pull.head.ref.startsWith('release-please--branches--')
|
|
281
|
-
);
|
|
281
|
+
'-f', 'per_page=100',
|
|
282
|
+
])).filter((pull) => pull.merged_at !== null && pull.head.ref === 'release-please--branches--main');
|
|
282
283
|
|
|
283
284
|
// The newest existing tag supplies the tag prefix; the manifest
|
|
284
285
|
// supplies the version each merged pull request published.
|
|
285
286
|
const tags = JSON.parse(gh([
|
|
286
287
|
'api', `repos/${repo}/tags`, '-X', 'GET', '-f', 'per_page=100',
|
|
287
|
-
]));
|
|
288
|
-
|
|
288
|
+
])).map((tag) => tag.name);
|
|
289
|
+
// Only version-shaped tags inform the prefix; stray tags must
|
|
290
|
+
// not corrupt it.
|
|
291
|
+
const versionedTags = tags.filter((name) => /v?\d+\.\d+\.\d+$/.test(name));
|
|
292
|
+
const latestTag = versionedTags[0] ?? '';
|
|
289
293
|
const prefix = latestTag.replace(/v?\d+\.\d+\.\d+.*$/, '') || 'v';
|
|
290
294
|
|
|
291
|
-
let
|
|
295
|
+
let ensured = 0;
|
|
296
|
+
let failures = 0;
|
|
292
297
|
let lastTag = '';
|
|
293
298
|
let lastSha = '';
|
|
294
299
|
for (const pull of pulls) {
|
|
295
|
-
const version = /^chore\(main\): release (
|
|
300
|
+
const version = /^chore\(main\): release (\S+)/.exec(pull.title)?.[1];
|
|
296
301
|
if (!version) continue;
|
|
297
302
|
const tag = `${prefix}v${version}`;
|
|
298
|
-
|
|
299
|
-
|
|
303
|
+
// Draft releases are invisible to get-release-by-tag, so scan
|
|
304
|
+
// the list endpoint (which returns drafts) for the tag.
|
|
305
|
+
const releasesForCheck = JSON.parse(gh([
|
|
306
|
+
'api', `repos/${repo}/releases`, '-X', 'GET', '-f', 'per_page=100',
|
|
307
|
+
]));
|
|
308
|
+
if (releasesForCheck.some((release) => release.tag_name === tag)) {
|
|
300
309
|
console.log(`${tag}: release object already exists`);
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
310
|
+
} else {
|
|
311
|
+
// No release object for this tag: create it.
|
|
312
|
+
try {
|
|
313
|
+
if (!tags.includes(tag)) {
|
|
314
|
+
gh(['api', `repos/${repo}/git/refs`, '-X', 'POST',
|
|
315
|
+
'-f', `ref=refs/tags/${tag}`, '-f', `sha=${pull.merge_commit_sha}`]);
|
|
316
|
+
console.log(`${tag}: tag created at ${pull.merge_commit_sha.slice(0, 10)}`);
|
|
317
|
+
}
|
|
318
|
+
const body = JSON.stringify({
|
|
319
|
+
tag_name: tag,
|
|
320
|
+
name: tag,
|
|
321
|
+
body: pull.body ?? '',
|
|
322
|
+
draft: config.packages?.['.']?.draft ?? config.draft ?? false,
|
|
323
|
+
prerelease: version.includes('-'),
|
|
324
|
+
});
|
|
325
|
+
gh(['api', `repos/${repo}/releases`, '-X', 'POST', '--input', '-'], { input: body });
|
|
326
|
+
console.log(`${tag}: release object created`);
|
|
327
|
+
} catch (error) {
|
|
328
|
+
failures += 1;
|
|
329
|
+
console.log(`${tag}: creation failed: ${error.message}`);
|
|
330
|
+
continue;
|
|
331
|
+
}
|
|
304
332
|
}
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
333
|
+
// The newest ensured release drives the batched promotion step.
|
|
334
|
+
if (!lastTag) {
|
|
335
|
+
lastTag = tag;
|
|
336
|
+
lastSha = pull.merge_commit_sha;
|
|
309
337
|
}
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
draft: config.packages?.['.']?.draft ?? config.draft ?? false,
|
|
315
|
-
prerelease: version.includes('-'),
|
|
316
|
-
});
|
|
317
|
-
gh(['api', `repos/${repo}/releases`, '-X', 'POST', '--input', '-'], { input: body });
|
|
318
|
-
console.log(`${tag}: release object created`);
|
|
319
|
-
created += 1;
|
|
320
|
-
lastTag = tag;
|
|
321
|
-
lastSha = pull.merge_commit_sha;
|
|
338
|
+
ensured += 1;
|
|
339
|
+
}
|
|
340
|
+
if (failures > 0) {
|
|
341
|
+
throw new Error(`${failures} release object(s) could not be ensured; see the log above`);
|
|
322
342
|
}
|
|
323
|
-
if (
|
|
343
|
+
if (ensured === 0) {
|
|
324
344
|
throw new Error(
|
|
325
345
|
'release-please failed and no merged version pull request was waiting for a release object; ' +
|
|
326
346
|
'the failure needs human eyes'
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.44.9](https://github.com/0xPlayerOne/code-foundry/compare/v1.44.8...v1.44.9) (2026-10-06)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* **release:** make the REST fallback draft-aware and idempotent ([#725](https://github.com/0xPlayerOne/code-foundry/issues/725)) ([c29da6e](https://github.com/0xPlayerOne/code-foundry/commit/c29da6efb919d68a568c2328eea2c2f7654334fe))
|
|
9
|
+
|
|
10
|
+
## [1.44.8](https://github.com/0xPlayerOne/code-foundry/compare/v1.44.7...v1.44.8) (2026-10-06)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* **release:** query the version-PR branch directly in the REST fallback ([#722](https://github.com/0xPlayerOne/code-foundry/issues/722)) ([b38f394](https://github.com/0xPlayerOne/code-foundry/commit/b38f394c0ca6438117fdd2f45bd106b0b145a0f9))
|
|
16
|
+
|
|
3
17
|
## [1.44.7](https://github.com/0xPlayerOne/code-foundry/compare/v1.44.6...v1.44.7) (2026-10-05)
|
|
4
18
|
|
|
5
19
|
|
|
@@ -136,23 +150,9 @@
|
|
|
136
150
|
|
|
137
151
|
* register the adea-ai ui and themes consumers in the fleet manifest ([#680](https://github.com/0xPlayerOne/code-foundry/issues/680)) ([f50e6c6](https://github.com/0xPlayerOne/code-foundry/commit/f50e6c6a4ef4b7f0396cdce21f53070fec818c50))
|
|
138
152
|
|
|
139
|
-
## [1.38.1](https://github.com/0xPlayerOne/code-foundry/compare/v1.38.0...v1.38.1) (2026-09-30)
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
### Bug Fixes
|
|
143
|
-
|
|
144
|
-
* normalize blank runs when stripping legacy managed markers ([#678](https://github.com/0xPlayerOne/code-foundry/issues/678)) ([acd5afc](https://github.com/0xPlayerOne/code-foundry/commit/acd5afce12b3de3b3574259639e89067e1ab3cb0))
|
|
145
|
-
|
|
146
|
-
## [1.38.0](https://github.com/0xPlayerOne/code-foundry/compare/v1.37.3...v1.38.0) (2026-09-30)
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
### Features
|
|
150
|
-
|
|
151
|
-
* fold the Turbo impact check into the delivery candidate job ([#676](https://github.com/0xPlayerOne/code-foundry/issues/676)) ([fd99d29](https://github.com/0xPlayerOne/code-foundry/commit/fd99d29ae7e10ef9346b8059dcad0ed4df6df109))
|
|
152
|
-
|
|
153
153
|
<!-- code-foundry: packaged changelog -->
|
|
154
154
|
|
|
155
155
|
---
|
|
156
156
|
|
|
157
|
-
This packaged changelog lists the 20 most recent releases;
|
|
157
|
+
This packaged changelog lists the 20 most recent releases; 229 older releases are omitted to keep the package small.
|
|
158
158
|
See the [full changelog](https://github.com/0xPlayerOne/code-foundry/blob/main/CHANGELOG.md) for the complete history.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "code-foundry",
|
|
3
|
-
"version": "1.44.
|
|
3
|
+
"version": "1.44.9",
|
|
4
4
|
"description": "A fast, language-aware repository factory for agent-ready workflows, testing, security, and release automation.",
|
|
5
5
|
"homepage": "https://github.com/0xPlayerOne/code-foundry#readme",
|
|
6
6
|
"bugs": {
|