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
Binary file added Docs/Media/wagejar-demo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 28 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@
<img alt="CI" src="https://github.com/LeoForgeLab/WageJar/actions/workflows/ci.yml/badge.svg">
</p>

<p align="center">
<a href="https://github.com/LeoForgeLab/WageJar/releases/latest">
<img alt="下载 WageJar" src="https://img.shields.io/badge/下载-WageJar%20v0.1.0-cf5632?style=for-the-badge&logo=apple&logoColor=white">
</a>
</p>

<p align="center">
<img src="Sources/WorkTracker/Resources/warm-workday-banner.png" width="900" alt="WageJar 暖色工作场景封面">
</p>
Expand All @@ -42,6 +48,16 @@

它常驻 macOS 菜单栏,不占程序坞。点开看一眼,关掉继续工作。

## 9 秒看看 WageJar

<p align="center">
<img src="Docs/Media/wagejar-demo.gif" width="900" alt="WageJar 今日工资、时间轴、收入日历与本地隐私功能演示">
</p>

<p align="center">
<sub>动图使用隔离演示数据,不包含真实个人收入。</sub>
</p>

## 一眼看懂今天

<table>
Expand Down Expand Up @@ -90,6 +106,16 @@
</tr>
</table>

## 下载使用

从 [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 签名、公证并接入更新框架后,即可正常双击启动和自动更新。

## 从源码开始

系统要求:
Expand All @@ -111,7 +137,7 @@ cd WageJar
dist/WageJar.app
```

将它拖入 Finder 的“应用程序”文件夹即可。构建脚本使用本机临时签名,不要求 Apple Developer 证书;公开分发 `.dmg` 仍需要 Developer ID 签名和 Apple 公证。
将它拖入 Finder 的“应用程序”文件夹即可。构建脚本使用本机临时签名,不要求 Apple Developer 证书;若要消除首次打开警告,仍需要 Developer ID 签名和 Apple 公证。

开发与测试:

Expand All @@ -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 与应用图标
```

Expand Down
29 changes: 28 additions & 1 deletion README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@
<img alt="CI" src="https://github.com/LeoForgeLab/WageJar/actions/workflows/ci.yml/badge.svg">
</p>

<p align="center">
<a href="https://github.com/LeoForgeLab/WageJar/releases/latest">
<img alt="Download WageJar" src="https://img.shields.io/badge/Download-WageJar%20v0.1.0-cf5632?style=for-the-badge&logo=apple&logoColor=white">
</a>
</p>

<p align="center">
<img src="Sources/WorkTracker/Resources/warm-workday-banner.png" width="900" alt="WageJar warm workday cover">
</p>
Expand All @@ -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

<p align="center">
<img src="Docs/Media/wagejar-demo.gif" width="900" alt="WageJar daily earnings, timeline, earnings calendar, and local privacy demo">
</p>

<p align="center">
<sub>The animation uses isolated demo data and contains no real personal income.</sub>
</p>

## See the day at a glance

<table>
Expand Down Expand Up @@ -90,6 +106,16 @@ WageJar lives in the macOS menu bar and stays out of the Dock. Open it for a gla
</tr>
</table>

## 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:
Expand All @@ -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:

Expand All @@ -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
```

Expand Down
107 changes: 107 additions & 0 deletions Scripts/package-release.sh
Original file line number Diff line number Diff line change
@@ -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"
21 changes: 21 additions & 0 deletions Support/Release/安装说明.txt
Original file line number Diff line number Diff line change
@@ -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.
Loading