init
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
# 变更原因与设计记录
|
||||
|
||||
## 完整下载地址集中输出(2026-09-24)
|
||||
|
||||
用户指出前一轮只核对已有代码而未产生修改。本次调整上传成功日志:先输出 IPFS URI,末尾集中输出下载总页及七个文件的完整 HTTP(S) URL,每个地址单独一行,使用当前 API 同源网关和实际返回 CID。仅改变日志排版,不改上传、包格式或流水线配置,无迁移要求。通过本机 HTTP fixture 验证八条独立地址及失败不输出成功汇总;未重新发布真实 IPFS 产物。
|
||||
|
||||
## 发布目标缩减为三个(2026-09-24)
|
||||
|
||||
按用户要求排除 windows/arm64、linux/arm64、darwin/amd64,仅构建和发布 linux/amd64、windows/amd64、darwin/arm64。同步编译循环、归档目标、清单/索引校验及回归测试;有限并行和下载直链不变,不修改流水线触发。每次发布生成三个包及两份本地清单,执行三个单包 add 和一次四文件索引 add,成功回执含七项文件。旧六平台产物/CID不删除;新校验不接受旧六平台清单,需使用新输出目录重新打包,消费者不应写死旧包数。无应用或数据库迁移。验证使用隔离 fake Go 与 HTTP fixture,不宣称三平台真实重新编译或上传已完成。
|
||||
|
||||
@@ -28,6 +28,8 @@ tag 必须为 `v<VERSION>`,例如 `VERSION=0.3.0` 对应 `v0.3.0`;不匹配
|
||||
|
||||
## IPFS 配置与下载
|
||||
|
||||
成功日志末尾以 `=== IPFS upload complete: download URLs ===` 集中列出下载总页、三个包和四份索引/清单的完整地址;每个 HTTP(S) URL 独占一行,便于复制。当前配置使用 `https://ipfs.freeicu.top/ipfs/<CID>`;原始 IPFS URI 放在此汇总之前。
|
||||
|
||||
`upload-ipfs` 的 `IPFS_API` 固定为 `https://ipfs.freeicu.top`,不再要求 `ipfs_api` Secret。
|
||||
|
||||
此节点要求认证。按用户要求,`IPFS_TOKEN` 直接配置在 YAML 中,不依赖 Drone Secret。仓库读者及 Git 历史读者可获取令牌,应限制访问并在泄露时轮换,不要在其他文档或日志中重复令牌。
|
||||
|
||||
@@ -221,12 +221,13 @@ if (process.argv[1] && pathToFileURL(resolve(process.argv[1])).href === import.m
|
||||
const result = uploadRelease(resolveProjectPath(process.argv[3] || 'bin/releases/ci'), process.env.IPFS_API, process.env.IPFS_TOKEN);
|
||||
const gateway = new URL(process.env.IPFS_API).origin;
|
||||
console.log(`IPFS index directory CID (pin requested): ${result.cid}`);
|
||||
console.log(`Download page: ${gateway}/ipfs/${result.cid}/`);
|
||||
for (const entry of result.files) console.log(entry.uri);
|
||||
console.log('\n=== IPFS upload complete: download URLs ===');
|
||||
console.log(`Download page:\n${gateway}/ipfs/${result.cid}/`);
|
||||
for (const entry of result.files) {
|
||||
const download = new URL(`${gateway}/ipfs/${entry.uri.slice('ipfs://'.length)}`);
|
||||
if (entry.cid) download.searchParams.set('filename', entry.file);
|
||||
console.log(`Download ${entry.file}: ${download.href}`);
|
||||
console.log(entry.uri);
|
||||
console.log(`\nDownload ${entry.file}:\n${download.href}`);
|
||||
}
|
||||
} else {
|
||||
throw new Error('Usage: node scripts/ci-release.mjs package [binary-directory] [output-directory] | upload [release-directory]');
|
||||
|
||||
@@ -181,7 +181,10 @@ test('four add requests pin three archives and an index directory without changi
|
||||
for (const part of parts.slice(2)) assert.equal(part.body, readFileSync(join(output, part.file), 'utf8'));
|
||||
assert.equal(result.stdout.includes(token) || result.stderr.includes(token), false);
|
||||
assert(result.stdout.includes(`IPFS index directory CID (pin requested): ${directoryCid}`));
|
||||
assert(result.stdout.includes(`Download page: ${new URL(server.api).origin}/ipfs/${directoryCid}/`));
|
||||
assert(result.stdout.includes(`Download page:\n${new URL(server.api).origin}/ipfs/${directoryCid}/`));
|
||||
const summary = result.stdout.split('=== IPFS upload complete: download URLs ===')[1];
|
||||
assert(summary && !summary.includes('ipfs://'));
|
||||
assert.equal(summary.split('\n').filter(line => /^https?:\/\//.test(line)).length, 8);
|
||||
for (const [offset, entry] of manifest.packages.entries()) {
|
||||
assert(result.stdout.includes(`Uploading IPFS archive ${offset + 1}/${targets.length}: ${entry.file}`));
|
||||
}
|
||||
@@ -193,7 +196,7 @@ test('four add requests pin three archives and an index directory without changi
|
||||
for (const entry of receipt.files) {
|
||||
const download = new URL(`${new URL(server.api).origin}/ipfs/${entry.uri.slice('ipfs://'.length)}`);
|
||||
if (entry.cid) download.searchParams.set('filename', entry.file);
|
||||
assert(result.stdout.includes(`Download ${entry.file}: ${download.href}`));
|
||||
assert(summary.includes(`Download ${entry.file}:\n${download.href}`));
|
||||
assert(result.stdout.includes(entry.uri));
|
||||
}
|
||||
assert(!JSON.stringify(receipt).includes(token));
|
||||
|
||||
Reference in New Issue
Block a user