diff --git a/Docs/Media/wagejar-demo.gif b/Docs/Media/wagejar-demo.gif new file mode 100644 index 0000000..c3373f9 Binary files /dev/null and b/Docs/Media/wagejar-demo.gif differ diff --git a/README.md b/README.md index c16a9f5..592a5b7 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,12 @@ CI

+

+ + 下载 WageJar + +

+

WageJar 暖色工作场景封面

@@ -42,6 +48,16 @@ 它常驻 macOS 菜单栏,不占程序坞。点开看一眼,关掉继续工作。 +## 9 秒看看 WageJar + +

+ WageJar 今日工资、时间轴、收入日历与本地隐私功能演示 +

+ +

+ 动图使用隔离演示数据,不包含真实个人收入。 +

+ ## 一眼看懂今天 @@ -90,6 +106,16 @@
+## 下载使用 + +从 [GitHub Releases](https://github.com/LeoForgeLab/WageJar/releases/latest) 下载最新版: + +- `WageJar-*-macOS-universal.dmg`:推荐,打开后将 WageJar 拖入“应用程序”。 +- `WageJar-*-macOS-universal.zip`:解压后将 WageJar 拖入“应用程序”。 +- 支持 macOS 14 Sonoma 或更高版本,以及 Apple Silicon 和 Intel Mac。 + +当前版本采用本机临时签名,尚未完成 Apple 公证。第一次运行时,请在 Finder 的“应用程序”中**右键 WageJar → 打开 → 再次确认打开**。后续完成 Developer ID 签名、公证并接入更新框架后,即可正常双击启动和自动更新。 + ## 从源码开始 系统要求: @@ -111,7 +137,7 @@ cd WageJar dist/WageJar.app ``` -将它拖入 Finder 的“应用程序”文件夹即可。构建脚本使用本机临时签名,不要求 Apple Developer 证书;公开分发 `.dmg` 仍需要 Developer ID 签名和 Apple 公证。 +将它拖入 Finder 的“应用程序”文件夹即可。构建脚本使用本机临时签名,不要求 Apple Developer 证书;若要消除首次打开警告,仍需要 Developer ID 签名和 Apple 公证。 开发与测试: @@ -134,6 +160,7 @@ swift test │ └── WorkTrackerApp.swift # 菜单栏、弹窗与单实例生命周期 ├── Tests/WorkTrackerTests # Swift Testing 测试 ├── Scripts/build-app.sh # 生成 macOS App +├── Scripts/package-release.sh # 生成 Universal ZIP、DMG 与校验文件 └── Support # Info.plist 与应用图标 ``` diff --git a/README_EN.md b/README_EN.md index 4b8695e..74edb7b 100644 --- a/README_EN.md +++ b/README_EN.md @@ -24,6 +24,12 @@ CI

+

+ + Download WageJar + +

+

WageJar warm workday cover

@@ -42,6 +48,16 @@ Most salary tools stop at a monthly number. WageJar focuses on the workday happe WageJar lives in the macOS menu bar and stays out of the Dock. Open it for a glance, then get back to work. +## WageJar in nine seconds + +

+ WageJar daily earnings, timeline, earnings calendar, and local privacy demo +

+ +

+ The animation uses isolated demo data and contains no real personal income. +

+ ## See the day at a glance @@ -90,6 +106,16 @@ WageJar lives in the macOS menu bar and stays out of the Dock. Open it for a gla
+## Download + +Get the latest version from [GitHub Releases](https://github.com/LeoForgeLab/WageJar/releases/latest): + +- `WageJar-*-macOS-universal.dmg`: recommended; open it and drag WageJar into **Applications**. +- `WageJar-*-macOS-universal.zip`: unzip it and drag WageJar into **Applications**. +- Supports macOS 14 Sonoma or later on both Apple Silicon and Intel Macs. + +The current release is ad-hoc signed and not yet Apple-notarized. On first launch, open Finder → **Applications**, right-click WageJar, choose **Open**, and confirm **Open** again. A future Developer ID-signed and notarized release with an update framework will support normal double-click launching and automatic updates. + ## Start from source Requirements: @@ -111,7 +137,7 @@ The app bundle is generated at: dist/WageJar.app ``` -Drag it into the Finder **Applications** folder. The build script uses local ad-hoc signing and does not require an Apple Developer certificate. Public `.dmg` distribution still requires Developer ID signing and Apple notarization. +Drag it into the Finder **Applications** folder. The build script uses local ad-hoc signing and does not require an Apple Developer certificate. Removing the first-launch warning still requires Developer ID signing and Apple notarization. Development and tests: @@ -134,6 +160,7 @@ swift test │ └── WorkTrackerApp.swift # Menu bar, popover, and single-instance lifecycle ├── Tests/WorkTrackerTests # Swift Testing tests ├── Scripts/build-app.sh # macOS app bundle builder +├── Scripts/package-release.sh # Universal ZIP, DMG, and checksum builder └── Support # Info.plist and app icon ``` diff --git a/Scripts/package-release.sh b/Scripts/package-release.sh new file mode 100755 index 0000000..c36ccbf --- /dev/null +++ b/Scripts/package-release.sh @@ -0,0 +1,107 @@ +#!/bin/zsh + +set -euo pipefail + +ROOT="${0:A:h:h}" +APP_NAME="WageJar" +PLIST="$ROOT/Support/Info.plist" +VERSION="${1:-$(plutil -extract CFBundleShortVersionString raw "$PLIST")}" +PLIST_VERSION="$(plutil -extract CFBundleShortVersionString raw "$PLIST")" +MIN_MACOS="$(plutil -extract LSMinimumSystemVersion raw "$PLIST")" +BUILD_ROOT="$ROOT/.build/release-package" +DIST_DIR="$ROOT/dist" +APP_DIR="$DIST_DIR/$APP_NAME.app" +ZIP_PATH="$DIST_DIR/$APP_NAME-v$VERSION-macOS-universal.zip" +DMG_PATH="$DIST_DIR/$APP_NAME-v$VERSION-macOS-universal.dmg" +CHECKSUM_PATH="$DIST_DIR/SHA256SUMS.txt" + +if [[ "$VERSION" != "$PLIST_VERSION" ]]; then + echo "版本不一致:Info.plist 为 $PLIST_VERSION,打包参数为 $VERSION" >&2 + exit 1 +fi + +build_arch() { + local arch="$1" + local scratch="$BUILD_ROOT/$arch" + local triple="$arch-apple-macosx$MIN_MACOS" + + swift build \ + -c release \ + --triple "$triple" \ + --scratch-path "$scratch" + + swift build \ + -c release \ + --triple "$triple" \ + --scratch-path "$scratch" \ + --show-bin-path +} + +cd "$ROOT" +mkdir -p "$DIST_DIR" + +ARM_BIN_DIR="$(build_arch arm64 | tail -n 1)" +INTEL_BIN_DIR="$(build_arch x86_64 | tail -n 1)" +RESOURCE_BUNDLE="$ARM_BIN_DIR/WorkTracker_WorkTracker.bundle" + +rm -rf "$APP_DIR" +mkdir -p "$APP_DIR/Contents/MacOS" "$APP_DIR/Contents/Resources" + +lipo -create \ + "$ARM_BIN_DIR/WorkTracker" \ + "$INTEL_BIN_DIR/WorkTracker" \ + -output "$APP_DIR/Contents/MacOS/WorkTracker" + +for resource in \ + warm-workday-banner.png \ + warm-evening-banner.png \ + menu-bar-jar-template.png +do + cp "$RESOURCE_BUNDLE/$resource" "$APP_DIR/Contents/Resources/$resource" +done + +cp "$ROOT/Support/Icon/WorkTrackerIcon.icns" \ + "$APP_DIR/Contents/Resources/WorkTrackerIcon.icns" +cp "$PLIST" "$APP_DIR/Contents/Info.plist" + +codesign --force --deep --sign - "$APP_DIR" +codesign --verify --deep --strict --verbose=2 "$APP_DIR" + +ARCHS="$(lipo -archs "$APP_DIR/Contents/MacOS/WorkTracker")" +if [[ "$ARCHS" != *"arm64"* || "$ARCHS" != *"x86_64"* ]]; then + echo "Universal 二进制校验失败:$ARCHS" >&2 + exit 1 +fi + +rm -f "$ZIP_PATH" "$DMG_PATH" "$CHECKSUM_PATH" +ditto -c -k --sequesterRsrc --keepParent "$APP_DIR" "$ZIP_PATH" + +DMG_STAGE="$(mktemp -d "${TMPDIR:-/tmp}/wagejar-dmg.XXXXXX")" +trap 'rm -rf "$DMG_STAGE"' EXIT + +cp -R "$APP_DIR" "$DMG_STAGE/$APP_NAME.app" +cp "$ROOT/Support/Release/安装说明.txt" "$DMG_STAGE/安装说明.txt" +ln -s /Applications "$DMG_STAGE/Applications" + +hdiutil create \ + -volname "$APP_NAME" \ + -srcfolder "$DMG_STAGE" \ + -ov \ + -format UDZO \ + "$DMG_PATH" + +( + cd "$DIST_DIR" + shasum -a 256 \ + "$(basename "$ZIP_PATH")" \ + "$(basename "$DMG_PATH")" \ + > "$(basename "$CHECKSUM_PATH")" +) + +echo +echo "已生成:" +echo " $APP_DIR" +echo " $ZIP_PATH" +echo " $DMG_PATH" +echo " $CHECKSUM_PATH" +echo "架构:$ARCHS" diff --git "a/Support/Release/\345\256\211\350\243\205\350\257\264\346\230\216.txt" "b/Support/Release/\345\256\211\350\243\205\350\257\264\346\230\216.txt" new file mode 100644 index 0000000..0dd60bd --- /dev/null +++ "b/Support/Release/\345\256\211\350\243\205\350\257\264\346\230\216.txt" @@ -0,0 +1,21 @@ +WageJar v0.1.0 + +安装方法 +1. 将 WageJar 拖入右侧的 Applications 文件夹。 +2. 第一次运行时,在 Finder 的“应用程序”中右键 WageJar,选择“打开”。 +3. 在 macOS 的安全提示中再次选择“打开”。 + +为什么需要右键打开? +当前公开版本采用本机临时签名,尚未使用 Apple Developer ID 进行签名和公证。 +代码、构建脚本与隐私边界均可在项目仓库中查看: + +https://github.com/LeoForgeLab/WageJar + +Requirements +- macOS 14 Sonoma or later +- Apple Silicon or Intel Mac + +First launch +Drag WageJar into Applications. In Finder, right-click WageJar and choose Open, +then confirm Open in the macOS security dialog. This release is ad-hoc signed +and not yet notarized with an Apple Developer ID.