Skip to content

Commit

Permalink
Merge pull request #61 from Steveice10/macos-fixup
Browse files Browse the repository at this point in the history
Fix code signing and version on macOS published build.
  • Loading branch information
13xforever authored Feb 11, 2024
2 parents e4043b7 + 20572f1 commit 29678b0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
3 changes: 2 additions & 1 deletion UI.Avalonia/UI.Avalonia.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
<CFBundleName>PS3 Disc Dumper</CFBundleName>
<CFBundleDisplayName>PS3 Disc Dumper</CFBundleDisplayName>
<CFBundleIdentifier>com.github.13xforever.ps3-disc-dumper</CFBundleIdentifier>
<CFBundleShortVersionString>4.1.4</CFBundleShortVersionString>
<CFBundleVersion>4.1.4</CFBundleVersion>
<CFBundleShortVersionString>$(CFBundleVersion)</CFBundleShortVersionString>
<CFBundleExecutable>ps3-disc-dumper</CFBundleExecutable>
<CFBundleIconFile>icon.icns</CFBundleIconFile>
</PropertyGroup>
Expand Down
12 changes: 8 additions & 4 deletions publish-mac.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,21 @@ Remove-Item -LiteralPath UI.Avalonia/obj -Recurse -Force -ErrorAction SilentlyCo

Write-Host 'Building macOS binary...' -ForegroundColor Cyan
dotnet publish -v:q -t:BundleApp -r osx-arm64 -f net8.0 --self-contained -c MacOS -o distrib/gui/mac/ UI.Avalonia/UI.Avalonia.csproj /p:PublishTrimmed=False /p:PublishSingleFile=True

Write-Host 'Clearing extra files in distrib...' -ForegroundColor Cyan
Get-ChildItem -LiteralPath distrib -Include *.pdb,*.config -Recurse | Remove-Item

if (($LASTEXITCODE -eq 0) -and ($IsMacOS -or ($PSVersionTable.Platform -eq 'Unix')))
{
chmod +x distrib/gui/mac/ps3-disc-dumper
# The final app bundle needs to be re-signed as a whole.
codesign --deep -fs - 'distrib/gui/mac/PS3 Disc Dumper.app'
}

Write-Host 'Clearing extra files in distrib...' -ForegroundColor Cyan
Get-ChildItem -LiteralPath distrib -Include *.pdb,*.config -Recurse | Remove-Item

Write-Host 'Bundling...' -ForegroundColor Cyan
if (Test-Path -LiteralPath distrib/gui/mac/ps3-disc-dumper)
if (Test-Path -LiteralPath 'distrib/gui/mac/PS3 Disc Dumper.app')
{
# tar to preserve file permissions.
tar -C distrib/gui/mac -cvzf distrib/ps3-disc-dumper_macos_NEW.tar.gz 'PS3 Disc Dumper.app'
}

Expand Down

0 comments on commit 29678b0

Please sign in to comment.