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
92 changes: 92 additions & 0 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: Package

on:
workflow_dispatch:
inputs:
release_type:
description: "Release architecture set"
required: true
default: "both"
type: choice
options:
- "x64"
- "both"
distribution:
description: "Distribution variant"
required: true
default: "lite"
type: choice
options:
- "lite"
- "runtime"
- "both"
retention_days:
description: "Artifact retention days"
required: true
default: "14"

jobs:
package:
runs-on: windows-latest
timeout-minutes: 90

env:
RELEASE_TYPE: ${{ inputs.release_type }}
DISTRIBUTION: ${{ inputs.distribution }}
OUTPUT_DIR: ${{ runner.temp }}\RMTRelease

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 24
cache: npm
cache-dependency-path: WebViewApp/package-lock.json

- name: Install WebView dependencies
working-directory: WebViewApp
run: npm ci

- name: Run repository verification
shell: powershell
run: >
.\scripts\verify.ps1
-AhkExe ".\.tools\AutoHotkey\v2\AutoHotkey64.exe"

- name: Prepare WebView2 Fixed Runtime
if: ${{ inputs.distribution != 'lite' }}
shell: powershell
run: >
.\scripts\prepare-webview2-runtime.ps1
-DestinationRoot ".\.tools\WebView2Runtime\Fixed"

- name: Package release
shell: powershell
run: >
.\PackRMT.ps1
-ReleaseType $env:RELEASE_TYPE
-Distribution $env:DISTRIBUTION
-OutputDir $env:OUTPUT_DIR
-NoWait

- name: Verify release layout
shell: powershell
run: |
$uiUtil = Get-Content -LiteralPath ".\Main\UIUtil.ahk" -Raw
if ($uiUtil -notmatch 'RMT_WEBVIEW_VERSION\s*:=\s*"RMTv(?<version>\d+(?:\.\d+){1,2})"') {
throw "Unable to read RMT_WEBVIEW_VERSION from Main\UIUtil.ahk"
}
$releaseRoot = Join-Path $env:OUTPUT_DIR "RMTv$($matches.version)"
.\scripts\verify-release-layout.ps1 -ReleaseRoot $releaseRoot

- name: Upload release zips
uses: actions/upload-artifact@v4
with:
name: rmt-${{ inputs.distribution }}-${{ github.run_number }}
path: ${{ runner.temp }}\RMTRelease\*.zip
if-no-files-found: error
retention-days: ${{ inputs.retention_days }}
compression-level: 0
35 changes: 35 additions & 0 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Verify

on:
pull_request:
push:
branches:
- master
- main
- "codex/**"
workflow_dispatch:

jobs:
verify:
runs-on: windows-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 24
cache: npm
cache-dependency-path: WebViewApp/package-lock.json

- name: Install WebView dependencies
working-directory: WebViewApp
run: npm ci

- name: Run repository verification
shell: powershell
run: >
.\scripts\verify.ps1
-AhkExe ".\.tools\AutoHotkey\v2\AutoHotkey64.exe"
18 changes: 10 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,21 @@ installed
*/build*
.codebuddy/
.idea
.tools/
.tools/*
!.tools/AutoHotkey/
!.tools/AutoHotkey/**
.tmp-*
WebViewApp/node_modules/
WebViewApp/*.tsbuildinfo
WebViewApp/playwright-report/
WebViewApp/test-results/
RMT帮助文档.html
Runtimes/WebView2/Fixed/
ReleaseX32/Plugins/WebViewToo/
ReleaseX32/WebViewApp/
ReleaseX32/Runtimes/
ReleaseX64/Plugins/WebViewToo/
ReleaseX64/WebViewApp/
ReleaseX64/Runtimes/
RMT帮助文档.html
RMT帮助文档-搜索*.html
ReleaseX32/
ReleaseX64/
Setting/
Thread/Work[0-9]*.exe
!Thread/Work1.exe
!Thread/Work2.exe
!Thread/Work3.exe
Binary file added .tools/AutoHotkey/Compiler/Ahk2Exe.exe
Binary file not shown.
Binary file added .tools/AutoHotkey/Compiler/AutoHotkey32.exe
Binary file not shown.
Binary file added .tools/AutoHotkey/Compiler/AutoHotkey64.exe
Binary file not shown.
Binary file added .tools/AutoHotkey/v2/AutoHotkey32.exe
Binary file not shown.
Binary file added .tools/AutoHotkey/v2/AutoHotkey64.exe
Binary file not shown.
Binary file added .tools/AutoHotkey/v2/Unicode 32-bit.bin
Binary file not shown.
Binary file added .tools/AutoHotkey/v2/Unicode 64-bit.bin
Binary file not shown.
4 changes: 2 additions & 2 deletions LocalWeb/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -429,11 +429,11 @@ function openTool(toolName) {
function showHelp() {
var ahk = getAhkObj();
if (ahk) { ahk.ShowHelp(); }
else { window.location.href = 'RMT帮助文档.html'; }
else { window.location.href = 'index.html'; }
}
function onAHKMessage(msg) {
console.log('收到 AHK 消息:', msg);
if (msg.action === 'initData' && msg.data) { renderUI(msg.data); }
else if (msg.action === 'tabChanged' && msg.data) { switchTab(msg.data.tabIndex); }
}
window.onAHKMessage = onAHKMessage;
window.onAHKMessage = onAHKMessage;
4 changes: 2 additions & 2 deletions LocalWeb/js/main.js.bak
Original file line number Diff line number Diff line change
Expand Up @@ -897,7 +897,7 @@ function showHelp() {
if (ahk) {
ahk.ShowHelp();
} else {
window.location.href = 'RMT帮助文档.html';
window.location.href = 'index.html';
}
}

Expand All @@ -913,4 +913,4 @@ function onAHKMessage(msg) {
}

// 导出给 AHK 调用
window.onAHKMessage = onAHKMessage;
window.onAHKMessage = onAHKMessage;
2 changes: 1 addition & 1 deletion Main/UIUtil.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ RmtDispatchWebAction(actionType, payload) {
MenuReload()
return ""
case "openHelp":
Run(A_WorkingDir "\RMT帮助文档.html")
Run(A_WorkingDir "\index.html")
return ""
case "openUrl":
url := RmtGet(payload, "url", "")
Expand Down
6 changes: 3 additions & 3 deletions Main/WebView2UI.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class WebView2UI {
case "showSettingMgr":
MySettingMgrGui.ShowGui()
case "showHelp":
Run(A_WorkingDir "\RMT帮助文档.html")
Run(A_WorkingDir "\index.html")
case "tabChange":
this.OnTabChanged(tabIndex)
; 忽略未知动作
Expand Down Expand Up @@ -386,7 +386,7 @@ WebMessageHandlerInvoke(interface, args) {

; 帮助打开函数
ShowHelpOpen() {
Run(A_WorkingDir "\RMT帮助文档.html")
Run(A_WorkingDir "\index.html")
}

; 格式化热键显示(JS调用)
Expand All @@ -403,4 +403,4 @@ FormatHotkeyForJS(keyCombo) {
result := RegExReplace(result, "i)<#", "Win+")
result := RegExReplace(result, "i)<\^", "Ctrl+")
return result
}
}
Loading
Loading