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: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:

- name: Package app bundle
if: startsWith(github.ref, 'refs/tags/v')
run: APP_BINARY=.build/universal/PDFReader APP_VERSION="${GITHUB_REF_NAME}" APP_BUILD="${GITHUB_RUN_NUMBER}" ./scripts/make-app.sh release
run: ./scripts/make-app.sh release release APP_BINARY=.build/universal/PDFReader APP_VERSION="${GITHUB_REF_NAME}" APP_BUILD="${GITHUB_RUN_NUMBER}"

- name: Build DMG
if: startsWith(github.ref, 'refs/tags/v')
Expand Down
10 changes: 9 additions & 1 deletion scripts/make-app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,16 @@ else
fi

rm -rf "$APP_DIR"
mkdir -p "$APP_DIR/Contents/MacOS" "$APP_DIR/Contents/Resources"
mkdir -p "$APP_DIR/Contents/MacOS" "$APP_DIR/Contents/Frameworks" "$APP_DIR/Contents/Resources"
cp "$BIN" "$APP_DIR/Contents/MacOS/PDFReader"
# The binary's Sparkle load command uses @rpath, but SwiftPM only emits
# toolchain rpaths (/usr/lib/swift, …). Without an app-bundle rpath, dyld
# can never resolve @rpath/Sparkle.framework from Contents/Frameworks and
# the app aborts at launch (DYLD "Library missing"). Add it if absent.
EXEC="$APP_DIR/Contents/MacOS/PDFReader"
if ! otool -l "$EXEC" | grep -q 'path @executable_path/../Frameworks'; then
xcrun install_name_tool -add_rpath '@executable_path/../Frameworks' "$EXEC"
fi
# Copy Sparkle framework for update checking
cp -R ".build/$CONFIG/Sparkle.framework" "$APP_DIR/Contents/Frameworks/"
# App icon (generated by scripts/generate-icon.swift).
Expand Down
Loading