TTP -> MTP, A lot of other stuff #21

Merged
alois merged 81 commits from dev into main 2026-07-21 11:57:33 +03:00
Showing only changes of commit 8bff0f503f - Show all commits

(fix): desktop uploads in workflow
All checks were successful
/ build-web (push) Successful in 5m47s
/ build-desktop (linux) (push) Successful in 6m52s
/ build-mobile (push) Successful in 20m43s
/ release (push) Successful in 2m44s

Alois 2026-07-03 14:39:26 +02:00

View file

@ -9,7 +9,7 @@ import {
statSync, statSync,
} from "node:fs"; } from "node:fs";
import { createHash } from "node:crypto"; import { createHash } from "node:crypto";
import { join } from "node:path"; import { basename, join } from "node:path";
import packageJson from "../package.json" with { type: "json" }; import packageJson from "../package.json" with { type: "json" };
const { version } = packageJson; const { version } = packageJson;
@ -57,6 +57,18 @@ if (existsSync(apkSrc)) {
// Electron desktop artifacts // Electron desktop artifacts
const electronReleaseDir = "apps/electron/release"; const electronReleaseDir = "apps/electron/release";
const electronArtifactPattern = /\.(AppImage|deb|rpm|exe|dmg|zip)$/i;
function readFilesRecursive(dir: string): string[] {
return readdirSync(dir).flatMap((file) => {
const filePath = join(dir, file);
const stat = statSync(filePath);
if (stat.isDirectory()) return readFilesRecursive(filePath);
if (stat.isFile()) return [filePath];
return [];
});
}
const copyElectronArtifacts = () => { const copyElectronArtifacts = () => {
if (!existsSync(electronReleaseDir)) { if (!existsSync(electronReleaseDir)) {
@ -66,12 +78,9 @@ const copyElectronArtifacts = () => {
return; return;
} }
for (const file of readdirSync(electronReleaseDir)) { for (const source of readFilesRecursive(electronReleaseDir)) {
if (file.endsWith(".blockmap") || file.endsWith(".yml")) continue; const file = basename(source);
if (!file.includes(version) && !file.includes(releaseVersion)) continue; if (!electronArtifactPattern.test(file)) continue;
const source = join(electronReleaseDir, file);
if (!statSync(source).isFile()) continue;
copyFileSync(source, join(releasesDir, file)); copyFileSync(source, join(releasesDir, file));
} }