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
75 changes: 75 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Build

on:
push:
branches: [main]
tags: ["v*"]
pull_request:
workflow_dispatch:

permissions:
contents: read

jobs:
build:
name: build
runs-on: macos-15
steps:
- uses: actions/checkout@v7

- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable

- name: Build MacTree.app
env:
SIGN_IDENTITY: "-"
BUILD_NUMBER: ${{ github.run_number }}
run: |
swift --version
if [[ "$GITHUB_REF" == refs/tags/v* ]]; then export VERSION="${GITHUB_REF_NAME#v}"; fi
./scripts/build-app.sh

- name: Smoke test
run: |
build/MacTree.app/Contents/MacOS/MacTree --bench "$GITHUB_WORKSPACE/Sources"
codesign --verify --deep --strict build/MacTree.app

- name: Package
run: ditto -c -k --keepParent build/MacTree.app MacTree.zip

- uses: actions/upload-artifact@v7
with:
name: MacTree
path: MacTree.zip
if-no-files-found: error

release:
name: release
needs: build
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/download-artifact@v8
with:
name: MacTree

- name: Publish GitHub release
env:
GH_TOKEN: ${{ github.token }}
run: |
mv MacTree.zip "MacTree-${GITHUB_REF_NAME}.zip"
cat > notes.md <<'NOTES'
WizTree-style disk space analyzer for macOS 15 or later (Apple silicon and Intel).

**Install:** unzip, move `MacTree.app` to Applications, and open it. The build is ad-hoc signed and not notarized, so macOS blocks the first launch. To allow it, go to System Settings › Privacy & Security and click **Open Anyway**. Or run `xattr -dr com.apple.quarantine /Applications/MacTree.app`.

For complete results, allow **Full Disk Access** when MacTree asks.
NOTES
gh release create "$GITHUB_REF_NAME" "MacTree-${GITHUB_REF_NAME}.zip" \
--repo "$GITHUB_REPOSITORY" \
--title "MacTree ${GITHUB_REF_NAME}" \
--notes-file notes.md \
--generate-notes
27 changes: 27 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// swift-tools-version:6.0
import PackageDescription

/**
* MacTree: one macOS 15+ executable built as the app binary.
*
* Release builds use -Ounchecked for the scanner's hot loops. The target links
* AppKit, Quartz (Quick Look) and UniformTypeIdentifiers (file icons).
* scripts/build-app.sh wraps the binary into MacTree.app.
*/
let package = Package(
name: "MacTree",
platforms: [.macOS(.v15)],
targets: [
.executableTarget(
name: "MacTree",
path: "Sources/MacTree",
swiftSettings: [.unsafeFlags(["-Ounchecked"], .when(configuration: .release))],
linkerSettings: [
.linkedFramework("AppKit"),
.linkedFramework("Quartz"),
.linkedFramework("UniformTypeIdentifiers"),
]
)
],
swiftLanguageModes: [.v5]
)
67 changes: 67 additions & 0 deletions Resources/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?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>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleLocalizations</key>
<array>
<string>en</string>
<string>ko</string>
</array>
<key>CFBundleDisplayName</key>
<string>MacTree</string>
<key>CFBundleExecutable</key>
<string>MacTree</string>
<key>CFBundleIconFile</key>
<string>AppIcon</string>
<key>CFBundleIdentifier</key>
<string>com.aodjo.MacTree</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>MacTree</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.utilities</string>
<key>LSMinimumSystemVersion</key>
<string>15.0</string>
<key>NSHighResolutionCapable</key>
<true/>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>NSDesktopFolderUsageDescription</key>
<string>MacTree reads folder and file sizes on your Desktop to show what is using disk space.</string>
<key>NSDocumentsFolderUsageDescription</key>
<string>MacTree reads folder and file sizes in Documents to show what is using disk space.</string>
<key>NSDownloadsFolderUsageDescription</key>
<string>MacTree reads folder and file sizes in Downloads to show what is using disk space.</string>
<key>NSRemovableVolumesUsageDescription</key>
<string>MacTree reads folder and file sizes on removable drives you choose to scan.</string>
<key>NSNetworkVolumesUsageDescription</key>
<string>MacTree reads folder and file sizes on network volumes you choose to scan.</string>
<key>NSHumanReadableCopyright</key>
<string>Disk space analyzer for macOS</string>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeName</key>
<string>Folder</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>LSHandlerRank</key>
<string>None</string>
<key>LSItemContentTypes</key>
<array>
<string>public.folder</string>
<string>public.volume</string>
</array>
</dict>
</array>
</dict>
</plist>
Empty file.
6 changes: 6 additions & 0 deletions Resources/ko.lproj/InfoPlist.strings
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/* Shown by macOS when MacTree first reads a protected folder. */
"NSDesktopFolderUsageDescription" = "디스크 공간을 무엇이 차지하는지 보여주기 위해 데스크탑의 폴더와 파일 크기를 읽습니다.";
"NSDocumentsFolderUsageDescription" = "디스크 공간을 무엇이 차지하는지 보여주기 위해 문서 폴더의 폴더와 파일 크기를 읽습니다.";
"NSDownloadsFolderUsageDescription" = "디스크 공간을 무엇이 차지하는지 보여주기 위해 다운로드 폴더의 폴더와 파일 크기를 읽습니다.";
"NSRemovableVolumesUsageDescription" = "스캔하도록 선택한 외장 드라이브의 폴더와 파일 크기를 읽습니다.";
"NSNetworkVolumesUsageDescription" = "스캔하도록 선택한 네트워크 볼륨의 폴더와 파일 크기를 읽습니다.";
Loading