Skip to content

Commit cd7d66f

Browse files
author
while
committed
release
1 parent df57652 commit cd7d66f

10 files changed

Lines changed: 184 additions & 6 deletions

File tree

‎.github/workflows/release-app.yml‎

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,39 @@ jobs:
8383
build-command: pnpm run ios:build -- --target aarch64 --no-sign --ci
8484
secrets: inherit
8585

86+
release-sidestore:
87+
name: Release SideStore source
88+
needs: [check, release-ios]
89+
if: ${{ !cancelled() && needs.release-ios.result == 'success' }}
90+
runs-on: ubuntu-latest
91+
steps:
92+
- uses: actions/checkout@v5
93+
94+
- name: Download unsigned IPA
95+
env:
96+
GH_TOKEN: ${{ secrets.PUBLIC_RELEASE_TOKEN || secrets.GITHUB_TOKEN }}
97+
TAG: ${{ needs.check.outputs.tag }}
98+
run: gh release download "$TAG" --pattern '*_ios_unsigned.ipa' --output app.ipa
99+
100+
- name: Generate SideStore source
101+
env:
102+
TAG: ${{ needs.check.outputs.tag }}
103+
SIDESTORE_VERSION: ${{ needs.check.outputs.version }}
104+
SIDESTORE_NOTES: ${{ needs.check.outputs.notes }}
105+
SIDESTORE_OUTPUT: apps.json
106+
run: |
107+
set -euo pipefail
108+
SIDESTORE_SHA256="$(sha256sum app.ipa | cut -d' ' -f1)"
109+
SIDESTORE_SIZE="$(stat -c%s app.ipa)"
110+
SIDESTORE_DOWNLOAD_URL="https://github.com/${GITHUB_REPOSITORY}/releases/download/${TAG}/nes-emulator_${SIDESTORE_VERSION}_ios_unsigned.ipa" \
111+
node scripts/sidestore-source.cjs
112+
113+
- name: Upload SideStore source to release
114+
env:
115+
GH_TOKEN: ${{ secrets.PUBLIC_RELEASE_TOKEN || secrets.GITHUB_TOKEN }}
116+
TAG: ${{ needs.check.outputs.tag }}
117+
run: gh release upload "$TAG" apps.json --clobber
118+
86119
publish-manifest:
87120
needs: [check, release-desktop]
88121
if: ${{ !cancelled() && needs.release-desktop.result == 'success' }}

‎CHANGELOG.md‎

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Changelog
2+
3+
本文件记录 NES/FC 模拟器各端的发版说明。发版 workflow 会自动提取对应 `## <version>` 段落作为 GitHub Release notes。
4+
5+
## 0.1.1
6+
7+
### 通用
8+
9+
#### 新增
10+
11+
- 触屏手柄支持自定义布局,可分别调整竖屏与横屏下方向键、实体按键与功能键的位置
12+
- 键盘与手柄按键映射按玩家分组,玩家 1 / 玩家 2 各自独立设置
13+
- 画面宽高比可选 1:1(方像素)、8:7 与 4:3
14+
- 触屏手柄显示策略可选自动 / 常显 / 隐藏
15+
16+
#### 变更
17+
18+
- 全新 UI kit,优化画面、工具栏、ROM 库、存档面板与设置弹窗的布局和样式
19+
20+
#### 修复
21+
22+
- 修复二次加载 ROM 时画面变小并下移的问题
23+
- 修复二次加载 ROM 时黑屏的问题(保留 canvas)
24+
- 修复全屏切换的相关问题
25+
- 触屏手柄布局重叠时按键优先于方向键,修复圆形按键误触发方向的问题
26+
27+
### 桌面端
28+
29+
#### 新增
30+
31+
- 支持应用内自动更新(updater)
32+
33+
### 发布
34+
35+
#### 变更
36+
37+
- 统一发布工作流,推送 tag 后自动构建 mac / windows / linux / android / ios 产物并上传 Release
38+
- iOS 新增 SideStore 源分发,在 SideStore 中添加 source 即可安装与自动更新
39+
- 调整应用 bundle id
40+
41+
## 0.1.0
42+
43+
- 首个版本:NES/FC 模拟器,基于 fceumm 核心,支持 ROM 库、即时存档、触屏手柄与 PWA 离线游玩

‎apps/app/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@
3131
"vite": "catalog:",
3232
"vue-tsc": "catalog:"
3333
},
34-
"version": "0.1.0"
34+
"version": "0.1.1"
3535
}

‎apps/app/src-tauri/Cargo.lock‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎apps/app/src-tauri/Cargo.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "app"
3-
version = "0.1.0"
3+
version = "0.1.1"
44
description = "A Tauri App"
55
authors = ["while"]
66
license = ""

‎apps/pwa/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@
1818
"vite-plugin-pwa": "^1.3.0",
1919
"vue-tsc": "catalog:"
2020
},
21-
"version": "0.1.0"
21+
"version": "0.1.1"
2222
}

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "nes-emulator-workspace",
33
"private": true,
4-
"version": "0.1.0",
4+
"version": "0.1.1",
55
"packageManager": "pnpm@10.33.0",
66
"scripts": {
77
"dev": "pnpm run dev:pwa",

‎packages/ui/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"vue": "catalog:",
1111
"@qingfeng346/ui-kit": "link:../../../ui-kit/ui-kit"
1212
},
13-
"version": "0.1.0",
13+
"version": "0.1.1",
1414
"ciDependencies": {
1515
"@qingfeng346/ui-kit": "https://github.com/while-coder/ui-kit.git#0.0.1&path:/ui-kit"
1616
}

‎packages/ui/src/components/TouchControls.vue‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,23 @@ function finishDirection() {
142142
if (pointerId !== null) releaseCapture(dpadRef.value, pointerId)
143143
}
144144
145+
/** 按键热区外扩:补偿圆形按键命中的圆角缺口与手指落点偏差。 */
146+
const BUTTON_HOTZONE = 6
147+
148+
/** 按下点是否落在任一实体按键(A/B/连发/Select/Start/菜单)的热区内。 */
149+
function overButton(clientX: number, clientY: number): boolean {
150+
for (const el of controlsRef.value?.querySelectorAll<HTMLElement>('.akey, .fkey') ?? []) {
151+
const r = el.getBoundingClientRect()
152+
if (clientX >= r.left - BUTTON_HOTZONE && clientX <= r.right + BUTTON_HOTZONE
153+
&& clientY >= r.top - BUTTON_HOTZONE && clientY <= r.bottom + BUTTON_HOTZONE) return true
154+
}
155+
return false
156+
}
157+
145158
function onDpadDown(e: PointerEvent) {
146159
if (props.disabled || settings.misc.touchPad === 'never' || dirPointerId !== null || e.button !== 0) return
160+
// 布局重叠时按键优先:落点在按键热区内(含穿透到摇杆的)不驱动方向。
161+
if (overButton(e.clientX, e.clientY)) return
147162
e.preventDefault()
148163
// 先捕获再记录状态;捕获失败时不留下按住标记。
149164
dpadRef.value?.setPointerCapture(e.pointerId)

‎scripts/sidestore-source.cjs‎

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
#!/usr/bin/env node
2+
/**
3+
* 生成 SideStore / AltStore 源文件(apps.json)。
4+
*
5+
* 发布 workflow 会下载未签名 IPA,计算 sha256 与大小后调用本脚本生成
6+
* apps.json 并上传到 Release。用户在 SideStore 里添加下面的 sourceURL
7+
* 即可订阅并一键安装/更新(SideStore 会用用户自己的 Apple ID 重签):
8+
*
9+
* https://github.com/while-coder/nes-emulator/releases/latest/download/apps.json
10+
*
11+
* 环境变量:
12+
* SIDESTORE_VERSION 版本号(必填)
13+
* SIDESTORE_DOWNLOAD_URL IPA 下载地址(必填)
14+
* SIDESTORE_SHA256 IPA 的 sha256(必填)
15+
* SIDESTORE_SIZE IPA 字节大小(必填)
16+
* SIDESTORE_NOTES 版本说明(可选)
17+
* SIDESTORE_OUTPUT 输出文件(可选,缺省输出到 stdout)
18+
*/
19+
const fs = require("node:fs");
20+
21+
const REPO = "while-coder/nes-emulator";
22+
const BUNDLE_ID = "com.while.nesemulator";
23+
// releases/latest/download 是 GitHub 提供的稳定地址,始终指向最新 Release 的同名资源。
24+
const SOURCE_URL = `https://github.com/${REPO}/releases/latest/download/apps.json`;
25+
const ICON_URL = `https://raw.githubusercontent.com/${REPO}/main/apps/icon/icon.png`;
26+
const WEBSITE = "https://while-coder.github.io/nes-emulator/";
27+
const TINT_COLOR = "#C8102E";
28+
const APP_NAME = "NES Emulator";
29+
const DEFAULT_NOTES = "NES/FC 模拟器,支持触屏手柄与即时存档。";
30+
31+
const version = process.env.SIDESTORE_VERSION;
32+
const downloadURL = process.env.SIDESTORE_DOWNLOAD_URL;
33+
const sha256 = process.env.SIDESTORE_SHA256;
34+
const size = Number(process.env.SIDESTORE_SIZE);
35+
const notes = (process.env.SIDESTORE_NOTES || "").trim() || DEFAULT_NOTES;
36+
37+
for (const [name, value] of [["SIDESTORE_VERSION", version], ["SIDESTORE_DOWNLOAD_URL", downloadURL], ["SIDESTORE_SHA256", sha256]]) {
38+
if (!value) {
39+
console.error(`缺少环境变量 ${name}`);
40+
process.exit(1);
41+
}
42+
}
43+
if (!Number.isFinite(size) || size <= 0) {
44+
console.error("SIDESTORE_SIZE 必须是正整数(IPA 字节大小)");
45+
process.exit(1);
46+
}
47+
48+
// AltStore / SideStore 源格式:https://github.com/AltStore/AltStore/blob/main/Sources.md
49+
const source = {
50+
name: APP_NAME,
51+
identifier: `${BUNDLE_ID}.source`,
52+
sourceURL: SOURCE_URL,
53+
iconURL: ICON_URL,
54+
website: WEBSITE,
55+
tintColor: TINT_COLOR,
56+
apps: [
57+
{
58+
name: APP_NAME,
59+
bundleIdentifier: BUNDLE_ID,
60+
developerName: "while",
61+
localizedDescription: "NES/FC 模拟器,支持触屏手柄与即时存档,可离线游玩。",
62+
iconURL: ICON_URL,
63+
tintColor: TINT_COLOR,
64+
category: "games",
65+
appID: BUNDLE_ID,
66+
versions: [
67+
{
68+
version,
69+
date: new Date().toISOString(),
70+
localizedDescription: notes,
71+
downloadURL,
72+
size,
73+
sha256,
74+
},
75+
],
76+
},
77+
],
78+
};
79+
80+
const json = JSON.stringify(source, null, 2) + "\n";
81+
const output = process.env.SIDESTORE_OUTPUT;
82+
if (output) {
83+
fs.writeFileSync(output, json);
84+
console.log(`已生成 ${output}(v${version},${size} 字节)`);
85+
} else {
86+
process.stdout.write(json);
87+
}

0 commit comments

Comments
 (0)