The swiss army knife of lossless video/audio editing
Release checks: fixes from review
Claudeb7fd2b4f43d0
diff --git a/.github/workflows/build.yml b/.github/workflows/build.ymlindex 565a3b20..8e23d1fe 100644--- a/.github/workflows/build.yml+++ b/.github/workflows/build.yml@@ -201,7 +201,8 @@ jobs:# Catches e.g. an asset that was built without ffmpeg (#3147)check-release-assets:needs: release- if: startsWith(github.ref, 'refs/tags/v')+ # Also when a build job failed, to check the assets that were uploaded+ if: ${{ !cancelled() && startsWith(github.ref, 'refs/tags/v') }}runs-on: ubuntu-lateststeps:- uses: actions/checkout@v6diff --git a/CONTRIBUTING.md b/CONTRIBUTING.mdindex 63ae39b7..492e5b1f 100644--- a/CONTRIBUTING.md+++ b/CONTRIBUTING.md@@ -23,6 +23,7 @@ Run one of the below commands:yarn download-ffmpeg-darwin-x64yarn download-ffmpeg-darwin-arm64yarn download-ffmpeg-linux-x64+yarn download-ffmpeg-linux-arm64yarn download-ffmpeg-win32-x64yarn download-ffmpeg-win32-arm64```diff --git a/script/afterPack.ts b/script/afterPack.tsindex 74c450c7..a059a6fe 100644--- a/script/afterPack.ts+++ b/script/afterPack.ts@@ -15,7 +15,8 @@ export default async function afterPack({ appOutDir, arch, electronPlatformName,const path = join(resourcesDir, electronPlatformName === 'win32' ? `${name}.exe` : name);assert(existsSync(path), `${path} is missing. Did you run download-ffmpeg for ${electronPlatformName}-${Arch[arch]}?`);- // If the binary can run on this machine, check that it does (e.g. not a broken download or missing libraries)+ // If the binary can run on this machine, check that it does (e.g. not a broken download or missing libraries).+ // Mac App Store builds have electronPlatformName 'mas', so they're not run (the dmg builds use the same binaries)if (electronPlatformName === process.platform && Arch[arch] === process.arch) {// Like the app does on Linux (see src/main/ffmpeg.ts)const { stdout } = await execa(path, ['-hide_banner', '-version'], { env: { LD_LIBRARY_PATH: resourcesDir } });diff --git a/script/checkReleaseAssets.ts b/script/checkReleaseAssets.tsindex c027e894..dbc5fdf8 100644--- a/script/checkReleaseAssets.ts+++ b/script/checkReleaseAssets.ts@@ -4,7 +4,7 @@import assert from 'node:assert';const tag = process.argv[2];-const token = process.env['GH_TOKEN'];+const token = process.env['GH_TOKEN'] || undefined;assert(tag != null, 'Usage: node script/checkReleaseAssets.ts <tag>');const repo = process.env['GITHUB_REPOSITORY'] ?? 'mifi/lossless-cut';@@ -19,14 +19,13 @@ async function get<T>(path: string) {return await response.json() as T;}-// Drafts don't have a tag yet as far as the "release by tag" endpoint is concerned, so look in the list-const release = (await get<Release[]>('releases?per_page=20')).find((r) => r.tag_name === tag);+// The "release by tag" endpoint only returns published releases, so look in the list (drafts come first)+const release = (await get<Release[]>('releases?per_page=100')).find((r) => r.tag_name === tag);assert(release != null, `No release found for ${tag}`);const previous = await get<Release>('releases/latest');-assert(previous.tag_name !== tag, `${tag} is already the latest published release, nothing to compare with`);-const formatMb = (bytes: number) => `${(bytes / 1e6).toFixed(0)} MB`;-const problems = previous.assets.flatMap(({ name, size }) => {+// Nothing to compare with when re-running after the release was published+const problems = previous.tag_name === tag ? [] : previous.assets.flatMap(({ name, size }) => {const asset = release.assets.find((a) => a.name === name);if (asset == null) return [`${name} is missing (${formatMb(size)} in ${previous.tag_name})`];if (asset.size < size * minRatio) return [`${name} is ${formatMb(asset.size)}, was ${formatMb(size)} in ${previous.tag_name}`];