code-foundry 1.44.8 → 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 +48 -29
- package/CHANGELOG.md +8 -8
- package/package.json +1 -1
|
@@ -262,7 +262,8 @@ 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'));
|
|
@@ -275,53 +276,71 @@ jobs:
|
|
|
275
276
|
'api', `repos/${repo}/pulls`,
|
|
276
277
|
'-X', 'GET',
|
|
277
278
|
'-f', 'state=closed',
|
|
278
|
-
'-f', `head=${repo.split('/')[0]}:release-please--branches--main`,
|
|
279
279
|
'-f', 'sort=updated',
|
|
280
280
|
'-f', 'direction=desc',
|
|
281
281
|
'-f', 'per_page=100',
|
|
282
|
-
])).filter((pull) => pull.merged_at !== null);
|
|
282
|
+
])).filter((pull) => pull.merged_at !== null && pull.head.ref === 'release-please--branches--main');
|
|
283
283
|
|
|
284
284
|
// The newest existing tag supplies the tag prefix; the manifest
|
|
285
285
|
// supplies the version each merged pull request published.
|
|
286
286
|
const tags = JSON.parse(gh([
|
|
287
287
|
'api', `repos/${repo}/tags`, '-X', 'GET', '-f', 'per_page=100',
|
|
288
|
-
]));
|
|
289
|
-
|
|
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] ?? '';
|
|
290
293
|
const prefix = latestTag.replace(/v?\d+\.\d+\.\d+.*$/, '') || 'v';
|
|
291
294
|
|
|
292
|
-
let
|
|
295
|
+
let ensured = 0;
|
|
296
|
+
let failures = 0;
|
|
293
297
|
let lastTag = '';
|
|
294
298
|
let lastSha = '';
|
|
295
299
|
for (const pull of pulls) {
|
|
296
|
-
const version = /^chore\(main\): release (
|
|
300
|
+
const version = /^chore\(main\): release (\S+)/.exec(pull.title)?.[1];
|
|
297
301
|
if (!version) continue;
|
|
298
302
|
const tag = `${prefix}v${version}`;
|
|
299
|
-
|
|
300
|
-
|
|
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)) {
|
|
301
309
|
console.log(`${tag}: release object already exists`);
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
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
|
+
}
|
|
305
332
|
}
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
333
|
+
// The newest ensured release drives the batched promotion step.
|
|
334
|
+
if (!lastTag) {
|
|
335
|
+
lastTag = tag;
|
|
336
|
+
lastSha = pull.merge_commit_sha;
|
|
310
337
|
}
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
draft: config.packages?.['.']?.draft ?? config.draft ?? false,
|
|
316
|
-
prerelease: version.includes('-'),
|
|
317
|
-
});
|
|
318
|
-
gh(['api', `repos/${repo}/releases`, '-X', 'POST', '--input', '-'], { input: body });
|
|
319
|
-
console.log(`${tag}: release object created`);
|
|
320
|
-
created += 1;
|
|
321
|
-
lastTag = tag;
|
|
322
|
-
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`);
|
|
323
342
|
}
|
|
324
|
-
if (
|
|
343
|
+
if (ensured === 0) {
|
|
325
344
|
throw new Error(
|
|
326
345
|
'release-please failed and no merged version pull request was waiting for a release object; ' +
|
|
327
346
|
'the failure needs human eyes'
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
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
|
+
|
|
3
10
|
## [1.44.8](https://github.com/0xPlayerOne/code-foundry/compare/v1.44.7...v1.44.8) (2026-10-06)
|
|
4
11
|
|
|
5
12
|
|
|
@@ -143,16 +150,9 @@
|
|
|
143
150
|
|
|
144
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))
|
|
145
152
|
|
|
146
|
-
## [1.38.1](https://github.com/0xPlayerOne/code-foundry/compare/v1.38.0...v1.38.1) (2026-09-30)
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
### Bug Fixes
|
|
150
|
-
|
|
151
|
-
* 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))
|
|
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": {
|