Skip to content

CodexBar 是一个 macOS 菜单栏应用,用于查看本机 Codex 账号状态、额度、Token 用量、详细统计信息

chore: 完善应用分发与通知配置

Bob3b7df085d5b0
diff --git a/.github/workflows/issue-notification.yml b/.github/workflows/issue-notification.yml
index 0edde82..3dc4c7a 100644
--- a/.github/workflows/issue-notification.yml
+++ b/.github/workflows/issue-notification.yml
@@ -16,8 +16,8 @@ jobs:
timeout-minutes: 2
env:
BARK_TOKEN: ${{ secrets.BARK_TOKEN }}
- BARK_ICON_URL: https://bucket.zabrian.com/codexbar/icon.png
- BARK_SERVER_URL: https://bark.zebedy.com
+ BARK_ICON_URL: ${{ secrets.BARK_ICON_URL }}
+ BARK_SERVER_URL: ${{ secrets.BARK_SERVER_URL }}
SELF_LOGIN: ${{ vars.SELF_LOGIN || github.repository_owner }}
steps:
- name: Build and send notification
diff --git a/Config/Version.xcconfig b/Config/Version.xcconfig
index 470b40f..7436192 100644
--- a/Config/Version.xcconfig
+++ b/Config/Version.xcconfig
@@ -1,2 +1,2 @@
-MARKETING_VERSION = 4.0.2
-CURRENT_PROJECT_VERSION = 102
+MARKETING_VERSION = 4.0.3
+CURRENT_PROJECT_VERSION = 103
diff --git a/Scripts/dmg.sh b/Scripts/dmg.sh
index c9acd93..bcbc9a7 100755
--- a/Scripts/dmg.sh
+++ b/Scripts/dmg.sh
@@ -79,7 +79,7 @@ MOUNT_POINT=""
cleanup() {
if [[ -n "${MOUNT_POINT}" ]]; then
- hdiutil detach "${MOUNT_POINT}" >/dev/null 2>&1 || true
+ diskutil eject "${MOUNT_POINT}" >/dev/null 2>&1 || true
fi
rm -rf "${STAGING_DIR}"
@@ -94,7 +94,15 @@ require_command() {
fi
}
-require_command hdiutil
+run_quietly() {
+ local output
+ if ! output="$("$@" 2>&1)"; then
+ printf '%s\n' "${output}" >&2
+ return 1
+ fi
+}
+
+require_command diskutil
require_command osascript
require_command ditto
@@ -105,20 +113,20 @@ echo "==> Preparing DMG contents"
ditto "${APP_PATH}" "${STAGING_DIR}/${APP_NAME}.app"
echo "==> Creating writable DMG"
-hdiutil create \
- -volname "${VOLUME_NAME}" \
- -srcfolder "${STAGING_DIR}" \
- -ov \
- -format UDRW \
- "${RW_DMG}" >/dev/null
+run_quietly diskutil image create from \
+ --format RAW \
+ --volumeName "${VOLUME_NAME}" \
+ "${STAGING_DIR}" \
+ "${RW_DMG}"
echo "==> Mounting writable DMG"
-ATTACH_OUTPUT="$(hdiutil attach -readwrite -noverify -noautoopen "${RW_DMG}")"
-MOUNT_POINT="$(printf '%s\n' "${ATTACH_OUTPUT}" | awk '/\/Volumes\// {print substr($0, index($0, "/Volumes/")); exit}')"
+MOUNT_POINT="${STAGING_DIR}/mount"
+run_quietly diskutil image attach \
+ --mountPoint "${MOUNT_POINT}" \
+ "${RW_DMG}"
if [[ -z "${MOUNT_POINT}" || ! -d "${MOUNT_POINT}" ]]; then
echo "error: 挂载 DMG 失败" >&2
- printf '%s\n' "${ATTACH_OUTPUT}" >&2
exit 1
fi
@@ -161,16 +169,14 @@ else
fi
sync
-hdiutil detach "${MOUNT_POINT}" >/dev/null
+run_quietly diskutil eject "${MOUNT_POINT}"
MOUNT_POINT=""
echo "==> Creating compressed DMG"
-hdiutil convert \
+run_quietly diskutil image create from \
+ --format UDZO \
"${RW_DMG}" \
- -format UDZO \
- -imagekey zlib-level=9 \
- -ov \
- -o "${TEMP_OUTPUT_PATH}" >/dev/null
+ "${TEMP_OUTPUT_PATH}"
mv -f "${TEMP_OUTPUT_PATH}" "${OUTPUT_PATH}"
diff --git a/appcast.xml b/appcast.xml
index ad613b8..8509824 100644
--- a/appcast.xml
+++ b/appcast.xml
@@ -7,6 +7,15 @@
<link>https://codexbar.zabrian.app/appcast.xml</link>
<description>CodexBar appcast feed</description>
<language>zh-CN</language>
+ <item>
+ <title>CodexBar.app 4.0.3</title>
+ <sparkle:version>103</sparkle:version>
+ <sparkle:shortVersionString>4.0.3</sparkle:shortVersionString>
+ <sparkle:minimumSystemVersion>15.0</sparkle:minimumSystemVersion>
+ <sparkle:releaseNotesLink>https://codexbar.zabrian.app/notes#4.0.3</sparkle:releaseNotesLink>
+ <pubDate>Thu, 17 Sep 2026 12:49:39 +0800</pubDate>
+ <enclosure url="https://codexbar.zabrian.app/download/CodexBar-v4.0.3.dmg" sparkle:edSignature="sCcPcMguzYYIXTCjZS3rxE+cs13r89VUchTBu+swabtov6DCaCCVsGCc0XWssu+EaOYrVriT4sHjx4qYgh6hDQ==" length="8303616" type="application/octet-stream"/>
+ </item>
<item>
<title>CodexBar.app 4.0.2</title>
<sparkle:version>102</sparkle:version>