Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 43 additions & 16 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ jobs:

- name: Restore dependencies
working-directory: src
run: dotnet restore UniGetUI.Avalonia/UniGetUI.Avalonia.csproj
run: dotnet restore UniGetUI.Avalonia/UniGetUI.Avalonia.csproj --runtime ${{ matrix.runtime }}

- name: Publish
working-directory: src
Expand All @@ -376,25 +376,52 @@ jobs:
--self-contained true \
--output ../bin/${{ matrix.name }}

- name: Install macOS packaging tools
if: runner.os == 'macOS'
run: brew install create-dmg

- name: Package (macOS)
if: runner.os == 'macOS'
run: |
mkdir -p output
set -euo pipefail
VERSION='${{ needs.preflight.outputs.package-version }}'
APP_BUNDLE="UniGetUI.app"
APP_EXECUTABLE="UniGetUI.Avalonia"

# .tar.gz
tar -czf output/UniGetUI.${{ matrix.name }}.tar.gz -C bin/${{ matrix.name }} .

# .dmg — create a staging folder, then convert to a compressed read-only image
DMG_STAGING=$(mktemp -d)
trap "rm -rf '$DMG_STAGING'" EXIT
mkdir -p "$DMG_STAGING/UniGetUI"
cp -R bin/${{ matrix.name }}/. "$DMG_STAGING/UniGetUI/"
hdiutil create \
-volname "UniGetUI" \
-srcfolder "$DMG_STAGING" \
-ov \
-format UDZO \
output/UniGetUI.${{ matrix.name }}.dmg
rm -rf "${APP_BUNDLE}" output
mkdir -p output
mkdir -p "${APP_BUNDLE}/Contents/MacOS"
mkdir -p "${APP_BUNDLE}/Contents/Resources"

cp -R "bin/${{ matrix.name }}/." "${APP_BUNDLE}/Contents/MacOS/"
chmod +x "${APP_BUNDLE}/Contents/MacOS/${APP_EXECUTABLE}"
sed "s|@VERSION@|${VERSION}|g" \
scripts/macos/Info.plist \
> "${APP_BUNDLE}/Contents/Info.plist"
cp scripts/macos/UniGetUI.icns "${APP_BUNDLE}/Contents/Resources/"

# Temporary ad-hoc signing only; proper Developer ID signing/notarization comes later.
find "${APP_BUNDLE}/Contents/MacOS" -type f | while IFS= read -r f; do
codesign --force --sign - "$f" 2>/dev/null || true
done
codesign --force --sign - "${APP_BUNDLE}"

COPYFILE_DISABLE=1 tar -czf "output/UniGetUI.${{ matrix.name }}.tar.gz" "${APP_BUNDLE}"

create-dmg \
--volname "UniGetUI" \
--volicon "scripts/macos/UniGetUI.icns" \
--window-pos 200 120 \
--window-size 600 400 \
--icon-size 128 \
--icon "UniGetUI.app" 150 185 \
--hide-extension "UniGetUI.app" \
--app-drop-link 450 185 \
"output/UniGetUI.${{ matrix.name }}.dmg" \
"${APP_BUNDLE}"

test -f "output/UniGetUI.${{ matrix.name }}.tar.gz"
test -f "output/UniGetUI.${{ matrix.name }}.dmg"

- name: Install Linux packaging tools
if: runner.os == 'Linux'
Expand Down
28 changes: 28 additions & 0 deletions scripts/macos/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleIdentifier</key>
<string>io.github.marticliment.unigetui</string>
<key>CFBundleName</key>
<string>UniGetUI</string>
<key>CFBundleDisplayName</key>
<string>UniGetUI</string>
<key>CFBundleExecutable</key>
<string>UniGetUI.Avalonia</string>
<key>CFBundleIconFile</key>
<string>UniGetUI</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleVersion</key>
<string>@VERSION@</string>
<key>CFBundleShortVersionString</key>
<string>@VERSION@</string>
<key>NSHighResolutionCapable</key>
<true/>
<key>LSMinimumSystemVersion</key>
<string>12.0</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
</dict>
</plist>
Binary file added scripts/macos/UniGetUI.icns
Binary file not shown.
Loading