Skip to content

Commit 10f53eb

Browse files
committed
Reduce portable artifact size and enforce size limits
1 parent 5d3fdc6 commit 10f53eb

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,18 @@ jobs:
5555
run: |
5656
$portable = Get-Item "dist/WinGroup.exe"
5757
$setup = Get-Item "dist/WinGroup-Setup.exe"
58+
$maxPortableMb = 80
59+
$maxSetupMb = 60
5860
$portableMb = [Math]::Round($portable.Length / 1MB, 2)
5961
$setupMb = [Math]::Round($setup.Length / 1MB, 2)
6062
"Portable size: $portableMb MB"
6163
"Setup size: $setupMb MB"
64+
if ($portableMb -gt $maxPortableMb) {
65+
throw "WinGroup.exe is too large ($portableMb MB). Limit is $maxPortableMb MB."
66+
}
67+
if ($setupMb -gt $maxSetupMb) {
68+
throw "WinGroup-Setup.exe is too large ($setupMb MB). Limit is $maxSetupMb MB."
69+
}
6270
"### Release Artifact Sizes" >> $env:GITHUB_STEP_SUMMARY
6371
"- WinGroup.exe: $portableMb MB" >> $env:GITHUB_STEP_SUMMARY
6472
"- WinGroup-Setup.exe: $setupMb MB" >> $env:GITHUB_STEP_SUMMARY

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ run: icon
4040
dotnet run --project $(PROJECT)
4141

4242
publish: icon restore
43-
dotnet publish $(PROJECT) -c $(CONFIG) -r $(RID) --self-contained false -p:PublishSingleFile=true -p:DebugType=None -p:DebugSymbols=false -p:Version=$(VERSION) -p:InformationalVersion=$(INFO_VERSION) -o $(OUT_DIR)
43+
dotnet publish $(PROJECT) -c $(CONFIG) -r $(RID) --self-contained true -p:PublishSingleFile=true -p:EnableCompressionInSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true -p:IncludeAllContentForSelfExtract=true -p:DebugType=None -p:DebugSymbols=false -p:Version=$(VERSION) -p:InformationalVersion=$(INFO_VERSION) -o $(OUT_DIR)
4444

4545
portable: publish
4646
pwsh -NoProfile -Command "New-Item -ItemType Directory -Force -Path '$(DIST_DIR)' | Out-Null; Copy-Item '$(OUT_DIR)/WinGroup.exe' '$(DIST_DIR)/$(PORTABLE_FILENAME)' -Force"

0 commit comments

Comments
 (0)