Skip to content

Commit fc35575

Browse files
daniboybyeclaude
andcommitted
fix(build): stop shipping every previous release inside the artifact
`mix release --overwrite` overwrites the current version's files and leaves every earlier one exactly where it is — `releases/<old>` and `lib/<app>-<old>` both accumulate in the output tree. Both build scripts then copy that tree wholesale into the artifact, so the artifact carried every version ever built on that machine. The 0.4.0 bump made it visible: the Windows ZIP went from 166.2 MB to 230.1 MB, because `lib/elixir_torrent_web_ui-0.3.0` was still there at 194.8 MB — larger than 0.4.0 itself, having accumulated digested asset generations across builds. The macOS bundle was worse in kind if not in bytes: the 0.4.0 app I installed carried 0.2.0 and 0.3.0 alongside it, plus `elixir_torrent-0.6.0` next to the current Engine. That is not only dead weight. It means users received compiled code from versions we did not intend to ship, including a stale copy of the Engine, and the artifact grew monotonically on any machine that built more than once. A fresh CI checkout has only one version in `_build`, which is why neither CI nor the checksums ever showed it. Both scripts now remove the release output directory before `mix release`, so the tree that gets copied contains exactly the version being built. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 1e193e1 commit fc35575

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

priv/scripts/macos/build-macos-dmg.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,12 @@ mix deps.get --only prod --check-locked
4242
MIX_ENV=prod mix compile
4343
mix phx.digest.clean --all
4444
mix assets.deploy
45-
mix release --overwrite
4645

4746
RELEASE="$ROOT/_build/prod/rel/elixir_torrent_web_ui"
4847

48+
rm -rf "$RELEASE"
49+
mix release --overwrite
50+
4951
echo "==> Assembling ${APP_DISPLAY_NAME}.app…"
5052
rm -rf "$DIST"
5153
mkdir -p "$APP/Contents/MacOS" "$APP/Contents/Resources"

priv/scripts/windows/build-windows-zip.ps1

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,14 @@ if (-not $SkipRelease) {
140140

141141
Write-Host '==> mix release --overwrite (prod)' -ForegroundColor Cyan
142142
$env:MIX_ENV = 'prod'
143+
$ReleaseSource = Join-Path $RepoRoot '_build\prod\rel\elixir_torrent_web_ui'
144+
145+
if (Test-Path $ReleaseSource) {
146+
Remove-Item -Recurse -Force $ReleaseSource
147+
}
148+
143149
& mix release --overwrite
144150
if ($LASTEXITCODE -ne 0) { Fail 'mix release failed' }
145-
146-
$ReleaseSource = Join-Path $RepoRoot '_build\prod\rel\elixir_torrent_web_ui'
147151
if (-not (Test-Path $ReleaseSource)) {
148152
Fail "Expected release output at $ReleaseSource but it was not produced."
149153
}

0 commit comments

Comments
 (0)