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
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
- name: Build MacTree.app
env:
SIGN_IDENTITY: "-"
UNIVERSAL: "1"
BUILD_NUMBER: ${{ github.run_number }}
run: |
swift --version
Expand All @@ -32,6 +33,7 @@ jobs:

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

Expand Down
12 changes: 10 additions & 2 deletions scripts/build-app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,23 @@
# macOS keeps the Full Disk Access grant across rebuilds (an ad-hoc signature
# changes every build and the grant stops applying). Override with
# SIGN_IDENTITY="<name or SHA-1>", or SIGN_IDENTITY=- for ad-hoc.
#
# UNIVERSAL=1 builds one binary for both Apple silicon and Intel Macs.
set -euo pipefail
cd "$(dirname "$0")/.."

swift build -c release
if [ -n "${UNIVERSAL:-}" ]; then
swift build -c release --arch arm64 --arch x86_64
BINARY=.build/apple/Products/Release/MacTree
else
swift build -c release
BINARY=.build/release/MacTree
fi

APP=build/MacTree.app
rm -rf "$APP"
mkdir -p "$APP/Contents/MacOS" "$APP/Contents/Resources"
cp .build/release/MacTree "$APP/Contents/MacOS/MacTree"
cp "$BINARY" "$APP/Contents/MacOS/MacTree"
cp Resources/Info.plist "$APP/Contents/Info.plist"
cp -R Resources/*.lproj "$APP/Contents/Resources/"

Expand Down