Prepare FileBow 1.0.1 packages and dependency source distribution
This commit is contained in:
1 parent
0e84a1c452
commit
569f0324d6
22 files changed
+282647
-68
No files matched your search
@@ -2,6 +2,7 @@
|
||||
param(
|
||||
[ValidateSet('Development','Store')][string]$Channel = 'Development',
|
||||
[string]$IdentityFile,
|
||||
[string]$AppDirectory,
|
||||
[switch]$SignDevelopment,
|
||||
[string]$SdkBin
|
||||
)
|
||||
@@ -24,8 +25,10 @@ if (-not $SdkBin) {
|
||||
$SdkBin = $candidates | Where-Object { Test-Path (Join-Path $_ 'makeappx.exe') } | Select-Object -First 1
|
||||
}
|
||||
if (-not $SdkBin) { throw 'Windows SDK BuildTools fehlt. Zuerst dotnet restore native/FileBow.Windows.csproj ausführen.' }
|
||||
$appPath = Join-Path $projectRoot 'out\FileBow-win32-x64'
|
||||
$appPath = if (-not $AppDirectory) { Join-Path $projectRoot 'out\FileBow-win32-x64' } elseif ([IO.Path]::IsPathRooted($AppDirectory)) { [IO.Path]::GetFullPath($AppDirectory) } else { [IO.Path]::GetFullPath((Join-Path $projectRoot $AppDirectory)) }
|
||||
if (-not (Test-Path "$appPath\FileBow.exe")) { throw 'Zuerst pnpm build ausführen.' }
|
||||
$appMetadata = Get-Content -LiteralPath (Join-Path $appPath 'resources\app\package.json') -Raw | ConvertFrom-Json
|
||||
if ("$($appMetadata.version).0" -ne $identity.Version) { throw 'App version and MSIX identity version do not match. Rebuild the app before packaging.' }
|
||||
$stage = [IO.Path]::GetFullPath((Join-Path $projectRoot "build\msix-$Channel-$([Guid]::NewGuid().ToString('N').Substring(0,8))"))
|
||||
$expectedParent = [IO.Path]::GetFullPath((Join-Path $projectRoot 'build'))
|
||||
if ([IO.Path]::GetDirectoryName($stage) -ne $expectedParent) { throw 'Unerwarteter Staging-Pfad.' }
|
||||
@@ -83,6 +86,6 @@ if ($SignDevelopment) {
|
||||
$certificatePath = Join-Path $outputDir 'FileBow-Development.cer'
|
||||
Export-Certificate -Cert $certificate -FilePath $certificatePath -Force | Out-Null
|
||||
}
|
||||
$record = @{ Channel=$Channel; Package=$package; Stage=$stage; Identity=$identity; Signed=[bool]$SignDevelopment; Certificate=$certificatePath; SHA256=(Get-FileBowSha256 $package); BuiltAt=(Get-Date).ToUniversalTime().ToString('o') }
|
||||
$record = @{ Channel=$Channel; Package=$package; AppDirectory=$appPath; Stage=$stage; Identity=$identity; Signed=[bool]$SignDevelopment; Certificate=$certificatePath; SHA256=(Get-FileBowSha256 $package); BuiltAt=(Get-Date).ToUniversalTime().ToString('o') }
|
||||
$record | ConvertTo-Json -Depth 5 | Set-Content (Join-Path $outputDir "build-$Channel.json") -Encoding utf8
|
||||
Write-Output $package
|
||||
@@ -10,15 +10,18 @@ import zipfile
|
||||
root = Path(__file__).resolve().parents[1]
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('--tag', required=True)
|
||||
parser.add_argument('--app-directory', type=Path, default=root / 'out/FileBow-win32-x64')
|
||||
args = parser.parse_args()
|
||||
if not re.fullmatch(r'v\d+\.\d+\.\d+(?:-[a-zA-Z0-9.-]+)?', args.tag):
|
||||
parser.error('Expected a version tag such as v1.0.0-rc.1')
|
||||
version = json.loads((root / 'package.json').read_text('utf-8'))['version']
|
||||
if args.tag[1:].split('-')[0] != version:
|
||||
parser.error('Release tag does not match package.json')
|
||||
source = root / 'out/FileBow-win32-x64'
|
||||
source = args.app_directory.resolve()
|
||||
if not (source / 'FileBow.exe').is_file():
|
||||
raise SystemExit('Run pnpm build first.')
|
||||
if json.loads((source / 'resources/app/package.json').read_text('utf-8'))['version'] != version:
|
||||
raise SystemExit('The built app version does not match package.json.')
|
||||
for name in ['FEATURE_PARITY.md', 'VALIDATION.md']:
|
||||
if (source / 'resources/app' / name).exists():
|
||||
raise SystemExit('Internal notes found in the app. Rebuild before packaging.')
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
"""Package a verified source collection into ordinary release ZIPs below 900 MiB."""
|
||||
import argparse
|
||||
import hashlib
|
||||
import json
|
||||
from pathlib import Path
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
import zipfile
|
||||
|
||||
root = Path(__file__).resolve().parents[1]
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument('directory', type=Path)
|
||||
parser.add_argument('--output', type=Path, required=True)
|
||||
args = parser.parse_args()
|
||||
directory = args.directory.resolve()
|
||||
output = args.output.resolve()
|
||||
subprocess.run([sys.executable, str(root / 'scripts/verify-sources.py'), str(directory)], check=True)
|
||||
manifest = json.loads((directory / 'SOURCE-MANIFEST.json').read_text('utf-8'))
|
||||
version = manifest['filebow_version']
|
||||
if version != json.loads((root / 'package.json').read_text('utf-8'))['version']:
|
||||
raise SystemExit('Source collection version does not match package.json.')
|
||||
output.mkdir(parents=True, exist_ok=True)
|
||||
shutil.copy2(root / 'licenses/sources/BUILDING.md', directory / 'BUILDING.md')
|
||||
groups = {}
|
||||
for row in manifest['sources']:
|
||||
family = row['file'].split('/')[0]
|
||||
group = 'ffmpeg' if family.startswith('ffmpeg') else 'rust' if family == 'rust' else 'runtime'
|
||||
groups.setdefault(group, []).append(row)
|
||||
bundles = []
|
||||
def write_bundle(name, files):
|
||||
path = output / name
|
||||
with zipfile.ZipFile(path, 'w', compression=zipfile.ZIP_STORED) as archive:
|
||||
for relative in files:
|
||||
archive.write(directory / relative, relative)
|
||||
with zipfile.ZipFile(path) as archive:
|
||||
if bad := archive.testzip():
|
||||
raise SystemExit(f'ZIP integrity error: {bad}')
|
||||
with path.open('rb') as stream:
|
||||
digest = hashlib.file_digest(stream, 'sha256').hexdigest()
|
||||
bundles.append({'file': name, 'bytes': path.stat().st_size, 'sha256': digest, 'members': files})
|
||||
print(f'Created {name} ({path.stat().st_size:,} bytes)', flush=True)
|
||||
for group, rows in groups.items():
|
||||
part, size, members = 1, 0, []
|
||||
for row in sorted(rows, key=lambda r: r['file']):
|
||||
if row['bytes'] > 900 * 1024**2:
|
||||
raise SystemExit(f"Source archive exceeds bundle size: {row['file']}")
|
||||
if members and size + row['bytes'] > 900 * 1024**2:
|
||||
write_bundle(f'FileBow-{version}-sources-{group}-{part}.zip', members)
|
||||
part, size, members = part + 1, 0, []
|
||||
members.append(row['file'])
|
||||
size += row['bytes']
|
||||
if members:
|
||||
write_bundle(f'FileBow-{version}-sources-{group}-{part}.zip', members)
|
||||
notes = ['SOURCE-MANIFEST.json', 'BUILDING.md', 'HEIF-BUILD-EVIDENCE.txt',
|
||||
'CHROMIUM-DEPS.txt', 'FFMPEG-BUILD-CONFIGURATION.txt', 'FFMPEG-CACHE-ALIASES.json']
|
||||
write_bundle(f'FileBow-{version}-sources-notes.zip', notes)
|
||||
(output / 'SOURCE-BUNDLES.json').write_text(json.dumps({'version': version, 'bundles': bundles}, indent=2) + '\n', encoding='utf-8')
|
||||
shutil.copy2(directory / 'SOURCE-MANIFEST.json', output / 'SOURCE-MANIFEST.json')
|
||||
shutil.copy2(directory / 'BUILDING.md', output / 'BUILDING-SOURCES.md')
|
||||
+1
-1
@@ -7,7 +7,7 @@ const buildOutput=path.resolve(root,process.env.FILEBOW_BUILD_OUT||'out');
|
||||
const output=await packager({dir:root,name:'FileBow',executableName:'FileBow',platform:'win32',arch:'x64',electronVersion:'43.7.0',out:buildOutput,overwrite:true,asar:false,
|
||||
icon:path.join(root,'assets/icon.ico'),appVersion:require('../package.json').version,
|
||||
win32metadata:{ProductName:'FileBow',FileDescription:'FileBow – File tools',InternalName:'FileBow',OriginalFilename:'FileBow.exe'},
|
||||
ignore:[/^\/(?:\.venv|\.git|build|out|test-results|tests|scripts|native|store|engine|node_modules)(?:\/|$)/,/^\/(?:FEATURE_PARITY|VALIDATION)\.md$/i,/\/\.gitignore$/,/default-docx-template(?:\/|$)/,/\.pyc$/,/\.pdb$/,/requirements\./,/pnpm/,/^\/vendor\/native(?:\/|$)/],
|
||||
ignore:[/^\/(?:\.venv|\.git|build|out|test-results|tests|scripts|native|store|engine|node_modules)(?:\/|$)/,/^\/(?:FEATURE_PARITY|VALIDATION)\.md$/i,/^\/licenses\/sources\/.*\.tar\.(?:gz|xz)$/,/\/\.gitignore$/,/default-docx-template(?:\/|$)/,/\.pyc$/,/\.pdb$/,/requirements\./,/pnpm/,/^\/vendor\/native(?:\/|$)/],
|
||||
prune:true});
|
||||
console.log(output.join('\n'));
|
||||
})().catch(error=>{console.error(error);process.exit(1);});
|
||||
@@ -36,10 +36,11 @@ for name in ['LICENSE','LICENSES.chromium.html']:
|
||||
if (electron/name).exists():shutil.copy2(electron/name,out/('Electron-'+name))
|
||||
(out/'components.json').write_text(json.dumps(records,indent=2,ensure_ascii=False),encoding='utf-8')
|
||||
(out/'FileBow-LICENSE.txt').write_text((root/'COPYRIGHT.md').read_text(encoding='utf-8')+'\n\n'+(root/'LICENSE').read_text(encoding='utf-8'),encoding='utf-8')
|
||||
parts=['<!doctype html><html lang="en"><meta charset="utf-8"><title>FileBow – License notices</title><style>body{font:15px system-ui;max-width:960px;margin:40px auto;padding:24px;line-height:1.6;color:#20232a}pre{white-space:pre-wrap;overflow-wrap:anywhere;font:12px monospace}summary{cursor:pointer}a{color:#9a4518}</style><h1>FileBow – Third-party components</h1><p>The following components are distributed under their respective licenses. These notices do not change any rights granted by those licenses.</p><h2>FFmpeg</h2><p>FileBow uses FFmpeg libraries under the GNU LGPL version 3. FFmpeg runs as a separate process. The shared libraries are included unmodified. Version: n9.0.2-36-g6882969ce9, BtbN LGPL shared x64. Source archives and build scripts are in <code>licenses/sources</code>.</p>']
|
||||
parts.append('<h2>FileBow</h2><p>Copyright (C) 2026 Nordik.dev. Licensed under GPL-3.0-or-later. You may redistribute and modify FileBow under the GNU GPL; there is no warranty. <a href="https://git.nordik.dev/nordik/FileBow">Source code</a>.</p><h2>HEIF codecs</h2><p>The pillow-heif wheel contains GPL-covered x265, as well as LGPL-covered libheif and libde265. Its BSD wrapper license does not cover the whole binary wheel. See the preserved upstream notices below.</p><p>Source archives currently cover FFmpeg itself and its build recipes, not every bundled dependency. See <a href="sources/README.md">source availability</a> before redistributing a binary build.</p>')
|
||||
parts=['<!doctype html><html lang="en"><meta charset="utf-8"><title>FileBow – License notices</title><style>body{font:15px system-ui;max-width:960px;margin:40px auto;padding:24px;line-height:1.6;color:#20232a}pre{white-space:pre-wrap;overflow-wrap:anywhere;font:12px monospace}summary{cursor:pointer}a{color:#9a4518}</style><h1>FileBow – Third-party components</h1><p>The following components are distributed under their respective licenses. These notices do not change any rights granted by those licenses.</p><h2>FFmpeg</h2><p>FileBow uses FFmpeg libraries under the GNU LGPL version 3. FFmpeg runs as a separate process. The shared libraries are included unmodified. Version: n9.0.2-36-g6882969ce9, BtbN LGPL shared x64. Source downloads and build instructions are linked below.</p>']
|
||||
parts.append('<h2>FileBow</h2><p>Copyright (C) 2026 Nordik.dev. Licensed under GPL-3.0-or-later. You may redistribute and modify FileBow under the GNU GPL; there is no warranty. <a href="https://git.nordik.dev/nordik/FileBow">Source code</a>.</p><h2>HEIF codecs</h2><p>The pillow-heif wheel contains GPL-covered x265, as well as LGPL-covered libheif and libde265. Its BSD wrapper license does not cover the whole binary wheel. See the preserved upstream notices below.</p><p><a href="https://git.nordik.dev/nordik/FileBow/releases/tag/v1.0.1">Download FileBow 1.0.1 and third-party sources</a>. Source archives, Windows build recipes, patches and checksums are provided separately. See <a href="https://git.nordik.dev/nordik/FileBow/src/tag/v1.0.1/licenses/sources/BUILDING.md">build instructions and coverage</a>.</p>')
|
||||
for file in sorted(out.glob('*.txt')) + sorted((out/'upstream').glob('*.txt')):
|
||||
parts.append(f'<details><summary>{html.escape(file.name)}</summary><pre>{html.escape(file.read_text(encoding="utf-8",errors="replace"))}</pre></details>')
|
||||
parts.append('<h2>Supplemental notices</h2><p><a href="Native-NOTICES.html">Native library and source notices</a> · <a href="Rust-NOTICES.html">Rust dependency notices</a></p>')
|
||||
parts.append('<h2>Electron / Chromium</h2><p><a href="Electron-LICENSES.chromium.html">Chromium-License notices</a></p>')
|
||||
for record in records:
|
||||
parts.append(f'<h2>{html.escape(record["name"])} {record["version"]}</h2>')
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
"""Verify every archive in an extracted FileBow dependency source collection."""
|
||||
import argparse
|
||||
import hashlib
|
||||
import json
|
||||
from pathlib import Path
|
||||
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument('directory', type=Path)
|
||||
args = parser.parse_args()
|
||||
directory = args.directory.resolve()
|
||||
manifest = json.loads((directory / 'SOURCE-MANIFEST.json').read_text('utf-8'))
|
||||
seen = set()
|
||||
for item in manifest['sources']:
|
||||
relative = item['file']
|
||||
file = (directory / relative).resolve()
|
||||
if not file.is_relative_to(directory) or relative in seen:
|
||||
raise SystemExit(f'Invalid or duplicate source path: {relative}')
|
||||
seen.add(relative)
|
||||
if not file.is_file() or file.stat().st_size != item['bytes']:
|
||||
raise SystemExit(f'Missing source or incorrect size: {relative}')
|
||||
with file.open('rb') as stream:
|
||||
actual = hashlib.file_digest(stream, 'sha256').hexdigest()
|
||||
if actual != item['sha256']:
|
||||
raise SystemExit(f'SHA-256 mismatch: {relative}')
|
||||
print(f"Verified {len(seen)} source archives for FileBow {manifest['filebow_version']}.")
|
||||
Reference in new issue
Block a user