build: publish desktop installer via Gitea releases
Some checks failed
Build and tests / test (push) Has been cancelled

This commit is contained in:
237899745
2026-07-27 15:20:09 +08:00
parent f760aa0ae9
commit a736d70d57
12 changed files with 405 additions and 5 deletions

View File

@@ -91,6 +91,25 @@ test('生产部署统一使用 Vite dist 且不会删除 lock 文件', () => {
}
});
test('桌面安装包由 Gitea Release 发布且不会再次提交到 Git', () => {
const gitignore = fs.readFileSync(path.join(projectRoot, '.gitignore'), 'utf8');
const release = JSON.parse(fs.readFileSync(
path.join(projectRoot, 'frontend', 'desktop-release.json'),
'utf8'
));
const installer = fs.readFileSync(path.join(projectRoot, 'install.sh'), 'utf8');
const compose = fs.readFileSync(path.join(projectRoot, 'docker-compose.yml'), 'utf8');
assert.ok(gitignore.split(/\r?\n/).includes('/frontend/downloads/*.exe'));
assert.strictEqual(gitignore.includes('!/frontend/downloads/'), false);
assert.match(release.sha256, /^[a-f0-9]{64}$/);
assert.ok(Number.isSafeInteger(release.size) && release.size > 0);
assert.strictEqual(release.tag, `v${release.version}`);
assert.strictEqual(release.publicPath, `/downloads/${release.asset}`);
assert.ok(installer.includes('sync_desktop_release'));
assert.ok(compose.includes('desktop-release:'));
});
test('Docker 构建上下文排除依赖、环境配置和运行时数据', () => {
const dockerIgnore = fs.readFileSync(path.join(projectRoot, 'backend', '.dockerignore'), 'utf8');
for (const requiredEntry of ['node_modules', '.env', 'data/*', 'storage/*']) {